/* Free trade marketing tools, November 2026.
   Styles for the tool panels and report form on the trade pages
   (/electrician, /garage-door, /foundation-repair, /generator-installer,
   /home-inspector). Loaded only by those pages. */
:root {
  --tt-orange: #F26B01;
  --tt-orange-dark: #C95700;
  --tt-navy: #17012C;
  --tt-text: #504E4E;
  --tt-muted: #68717d;
  --tt-line: #e4ded2;
  --tt-soft: #fbf9fd;
  --tt-good: #1f7a4d;
  --tt-warn: #b25e00;
  --tt-bad: #b42318;
}
.tt-section {
  padding: 72px 0 64px;
  background: linear-gradient(180deg, #f7f4fb 0%, #fff 100%);
  border-bottom: 1px solid var(--tt-line);
  scroll-margin-top: 90px;
}
.tt-head { max-width: 760px; margin: 0 auto 32px; text-align: center; }
.tt-eyebrow {
  display: inline-block; margin: 0 0 12px; padding: 6px 14px; border-radius: 999px;
  background: rgba(242, 107, 1, 0.1); color: var(--tt-orange-dark);
  font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.tt-title { margin: 0 0 14px; color: var(--tt-navy); font-size: clamp(28px, 4vw, 42px); line-height: 1.2; text-wrap: balance; }
.tt-lead { margin: 0; color: var(--tt-text); font-size: 17px; line-height: 1.75; }

.tt-tabs {
  display: flex; gap: 8px; margin: 0 auto 20px; padding: 6px; max-width: 100%; width: fit-content;
  overflow-x: auto; scrollbar-width: thin; border: 1px solid var(--tt-line); border-radius: 14px; background: #fff;
}
.tt-tab {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; border: 0; border-radius: 10px;
  background: transparent; color: var(--tt-navy); font: inherit; font-size: 15px; font-weight: 600; line-height: 1.2; cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.tt-tab i { color: var(--tt-orange); }
.tt-tab:hover { background: var(--tt-soft); }
.tt-tab[aria-selected="true"] { background: var(--tt-navy); color: #fff; }
.tt-tab[aria-selected="true"] i { color: #F29F5C; }
.tt-tab:focus-visible, .tt-btn:focus-visible, .tt-choice input:focus-visible + span, .tt-input:focus-visible, .tt-link:focus-visible {
  outline: 3px solid rgba(242, 107, 1, 0.45); outline-offset: 2px;
}

.tt-panel {
  max-width: 980px; margin: 0 auto; padding: 32px; border: 1px solid var(--tt-line); border-radius: 18px; background: #fff;
  box-shadow: 0 18px 40px rgba(23, 1, 44, 0.06);
}
.tt-panel[hidden] { display: none; }
.tt-panel__title { margin: 0 0 8px; color: var(--tt-navy); font-size: 24px; line-height: 1.3; }
.tt-panel__intro { margin: 0 0 24px; color: var(--tt-text); line-height: 1.75; }
.tt-demo-badge {
  display: inline-block; margin-left: 8px; padding: 3px 10px; border-radius: 999px; vertical-align: middle;
  background: rgba(100, 97, 252, 0.12); color: #4a47c9; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}

.tt-grid { display: grid; grid-template-columns: 1fr; gap: 18px 20px; }
@media (min-width: 768px) { .tt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tt-field { min-width: 0; }
.tt-field[hidden] { display: none; }
.tt-field--full { grid-column: 1 / -1; }
.tt-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.tt-label { display: block; margin: 0 0 8px; padding: 0; color: var(--tt-navy); font-size: 15px; font-weight: 600; line-height: 1.45; }
.tt-help { display: block; margin-top: 6px; color: var(--tt-muted); font-size: 13px; line-height: 1.55; }
.tt-input {
  display: block; width: 100%; min-height: 48px; padding: 11px 14px; border: 1px solid #d9d3e3; border-radius: 10px;
  background: #fff; color: var(--tt-navy); font: inherit; font-size: 15px; line-height: 1.4;
}
textarea.tt-input { min-height: 88px; resize: vertical; }
select.tt-input { appearance: auto; }
.tt-input--file { padding: 10px; }
.tt-input:focus { border-color: var(--tt-orange); }
.tt-affix { display: flex; align-items: stretch; }
.tt-affix span {
  display: inline-flex; align-items: center; padding: 0 12px; border: 1px solid #d9d3e3; border-right: 0;
  border-radius: 10px 0 0 10px; background: var(--tt-soft); color: var(--tt-muted); font-weight: 600;
}
.tt-affix .tt-input { border-radius: 0 10px 10px 0; }

.tt-segmented, .tt-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.tt-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.tt-choice { position: relative; margin: 0; cursor: pointer; }
.tt-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tt-choice span {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 9px 14px; border: 1px solid #d9d3e3; border-radius: 10px;
  background: #fff; color: var(--tt-navy); font-size: 14px; font-weight: 500; line-height: 1.35; transition: all 0.15s ease;
}
.tt-checks .tt-choice span::before {
  content: ""; flex: 0 0 18px; width: 18px; height: 18px; border: 2px solid #c9c1d6; border-radius: 5px; background: #fff;
}
.tt-choice input:checked + span { border-color: var(--tt-orange); background: rgba(242, 107, 1, 0.08); font-weight: 600; }
.tt-checks .tt-choice input:checked + span::before {
  border-color: var(--tt-orange); background: var(--tt-orange) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.4' d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.tt-range { display: flex; align-items: center; gap: 14px; }
.tt-range input[type="range"] { flex: 1; min-width: 0; accent-color: var(--tt-orange); height: 32px; }
.tt-range output { flex: 0 0 auto; min-width: 76px; text-align: right; color: var(--tt-navy); font-weight: 700; font-variant-numeric: tabular-nums; }

.tt-actions, .tt-result__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.tt-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 12px 24px; border: 2px solid var(--tt-orange);
  border-radius: 10px; background: var(--tt-orange); color: #fff; font: inherit; font-size: 15px; font-weight: 700; line-height: 1.2;
  text-align: center; cursor: pointer; transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.tt-btn:hover { background: var(--tt-orange-dark); border-color: var(--tt-orange-dark); color: #fff; }
.tt-btn--ghost { background: #fff; color: var(--tt-navy); border-color: #d9d3e3; }
.tt-btn--ghost:hover { background: var(--tt-soft); border-color: var(--tt-navy); color: var(--tt-navy); }
.tt-btn[disabled] { opacity: 0.6; cursor: not-allowed; }
.tt-link { padding: 0; border: 0; background: none; color: #704017; font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.tt-link:hover { color: var(--tt-navy); }

.tt-result { margin-top: 28px; padding-top: 28px; border-top: 1px dashed var(--tt-line); scroll-margin-top: 120px; }
.tt-result[hidden] { display: none; }
.tt-result__title { margin: 26px 0 12px; color: var(--tt-navy); font-size: 19px; line-height: 1.35; }
.tt-result__title:first-child { margin-top: 0; }
.tt-note { margin: 14px 0 0; color: var(--tt-muted); font-size: 13px; line-height: 1.6; }
.tt-callout { margin: 20px 0 0; padding: 14px 18px; border-left: 4px solid var(--tt-orange); border-radius: 8px; background: var(--tt-soft); color: var(--tt-navy); line-height: 1.65; }

.tt-score { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.tt-score__ring {
  --tt-score: 0; --tt-ring: var(--tt-orange);
  position: relative; display: grid; place-items: center; width: 132px; height: 132px; border-radius: 50%;
  background: conic-gradient(var(--tt-ring) calc(var(--tt-score) * 1%), #efeaf4 0);
}
.tt-score__ring::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: #fff; }
.tt-score__ring span { position: relative; color: var(--tt-navy); line-height: 1; text-align: center; }
.tt-score__num { display: block; font-size: 38px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tt-score__of { display: block; margin-top: 4px; color: var(--tt-muted); font-size: 13px; font-weight: 600; }
.tt-score__grade { margin: 0 0 4px; color: var(--tt-navy); font-size: 22px; font-weight: 800; line-height: 1.3; }
.tt-score__sub { margin: 0; color: var(--tt-muted); }

.tt-bars { display: grid; gap: 12px; margin-top: 24px; }
.tt-bar { display: grid; grid-template-columns: 140px minmax(0, 1fr) 64px; align-items: center; gap: 12px; }
.tt-bar__label { color: var(--tt-navy); font-size: 14px; font-weight: 600; }
.tt-bar__track { height: 10px; border-radius: 999px; background: #efeaf4; overflow: hidden; }
.tt-bar__fill { display: block; height: 100%; border-radius: inherit; background: var(--tt-orange); }
.tt-bar__value { color: var(--tt-navy); font-size: 14px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 575px) { .tt-bar { grid-template-columns: 1fr 56px; } .tt-bar__track { grid-column: 1 / -1; grid-row: 2; } }

.tt-fixes { margin: 0; padding: 0; list-style: none; counter-reset: tt-fix; display: grid; gap: 12px; }
.tt-fixes li { counter-increment: tt-fix; position: relative; padding: 16px 18px 16px 58px; border: 1px solid var(--tt-line); border-radius: 12px; background: #fff; }
.tt-fixes li::before {
  content: counter(tt-fix); position: absolute; left: 16px; top: 16px; display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: 50%; background: var(--tt-navy); color: #fff; font-size: 14px; font-weight: 700;
}
.tt-fix__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.tt-fix__head strong { color: var(--tt-navy); font-size: 16px; line-height: 1.4; }
.tt-fixes p { margin: 6px 0 0; color: var(--tt-text); font-size: 15px; line-height: 1.65; }
.tt-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; background: rgba(242, 107, 1, 0.12); color: var(--tt-orange-dark); font-size: 12px; font-weight: 700; white-space: nowrap; }
.tt-pill--good { background: rgba(31, 122, 77, 0.12); color: var(--tt-good); }
.tt-pill--warn { background: rgba(178, 94, 0, 0.12); color: var(--tt-warn); }
.tt-pill--bad { background: rgba(180, 35, 24, 0.12); color: var(--tt-bad); }

.tt-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.tt-stat { padding: 18px; border: 1px solid var(--tt-line); border-radius: 12px; background: var(--tt-soft); }
.tt-stat__label { display: block; color: var(--tt-muted); font-size: 13px; font-weight: 600; line-height: 1.4; }
.tt-stat__value { display: block; margin-top: 6px; color: var(--tt-navy); font-size: 26px; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tt-stat__sub { display: block; margin-top: 4px; color: var(--tt-muted); font-size: 13px; }

.tt-copy { margin-top: 16px; border: 1px solid var(--tt-line); border-radius: 12px; background: #fff; overflow: hidden; }
.tt-copy__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 16px; border-bottom: 1px solid var(--tt-line); background: var(--tt-soft); }
.tt-copy__head h4 { flex: 1 1 auto; margin: 0; color: var(--tt-navy); font-size: 16px; line-height: 1.35; }
.tt-count { color: var(--tt-muted); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tt-count--over { color: var(--tt-bad); }
.tt-copy__btn {
  min-height: 36px; padding: 6px 14px; border: 1px solid #d9d3e3; border-radius: 8px; background: #fff; color: var(--tt-navy);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.tt-copy__btn:hover { border-color: var(--tt-navy); }
.tt-copy__text { margin: 0; padding: 16px; background: #fff; color: var(--tt-navy); font-family: inherit; font-size: 15px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.tt-copy .tt-note { margin: 0; padding: 0 16px 14px; }
.tt-kv { display: grid; gap: 0; }
.tt-kv__row { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--tt-line); }
.tt-kv__row:last-child { border-bottom: 0; }
.tt-kv__key { color: var(--tt-muted); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.tt-kv__val { color: var(--tt-navy); line-height: 1.6; word-break: break-word; }
@media (max-width: 575px) { .tt-kv__row { grid-template-columns: 1fr auto; } .tt-kv__key { grid-column: 1 / -1; } }

.tt-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; padding: 16px; }
.tt-photo { border: 1px solid var(--tt-line); border-radius: 10px; overflow: hidden; background: var(--tt-soft); }
.tt-photo img { display: block; width: 100%; height: 150px; object-fit: cover; }
.tt-photo div { padding: 10px 12px; font-size: 13px; line-height: 1.5; color: var(--tt-navy); word-break: break-word; }
.tt-photo code { color: var(--tt-orange-dark); font-size: 12px; }

.tt-estimate { display: grid; gap: 24px; }
@media (min-width: 992px) { .tt-estimate { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; } }
.tt-estimate .tt-grid { grid-template-columns: 1fr; }
.tt-estimate .tt-result { margin-top: 0; padding: 24px; border: 2px solid var(--tt-navy); border-radius: 16px; background: var(--tt-soft); position: sticky; top: 110px; }
.tt-price { margin: 4px 0 6px; color: var(--tt-navy); font-size: clamp(30px, 4vw, 40px); font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tt-price__label { margin: 0; color: var(--tt-muted); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.tt-headline { margin: 0 0 12px; color: var(--tt-orange-dark); font-weight: 700; }
.tt-list { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.tt-list li { position: relative; padding-left: 26px; color: var(--tt-navy); font-size: 14px; line-height: 1.55; }
.tt-list li::before { content: "\2713"; position: absolute; left: 0; top: 0; color: var(--tt-good); font-weight: 800; }
.tt-list--notes li::before { content: "i"; top: 1px; display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: var(--tt-navy); color: #fff; font-size: 11px; font-style: italic; }

.tt-flags { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.tt-flags li { padding: 12px 16px; border: 1px solid var(--tt-line); border-radius: 10px; background: #fff; color: var(--tt-navy); line-height: 1.55; }
.tt-flags strong { display: block; }
.tt-flags span { color: var(--tt-text); font-size: 14px; }
.tt-mark { padding: 1px 4px; border-radius: 4px; background: rgba(242, 107, 1, 0.18); color: var(--tt-navy); }

.tt-section noscript p { max-width: 640px; margin: 0 auto; text-align: center; }

/* Report form */
.tt-report { padding: 72px 0; background: var(--tt-navy, #17012C); color: #fff; scroll-margin-top: 90px; }
.tt-report__inner { display: grid; gap: 36px; }
@media (min-width: 992px) { .tt-report__inner { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: start; } }
.tt-report__title { margin: 0 0 14px; color: #fff; font-size: clamp(28px, 3.6vw, 38px); line-height: 1.2; text-wrap: balance; }
.tt-report__text { margin: 0 0 18px; color: rgba(255, 255, 255, 0.85); line-height: 1.75; }
.tt-report .tt-list li { color: #fff; }
.tt-report .tt-list li::before { color: #F29F5C; }
.tt-report__included { margin: 18px 0 0; padding: 14px 16px; border: 1px dashed rgba(255, 255, 255, 0.35); border-radius: 10px; color: rgba(255, 255, 255, 0.9); font-size: 14px; line-height: 1.6; }
.tt-report__included[hidden] { display: none; }
.tt-report__form { padding: 28px; border-radius: 18px; background: #fff; color: #504E4E; }
.tt-report__form h3 { margin: 0 0 18px; color: #17012C; font-size: 22px; }
.tt-report__form .tt-input { border-color: #d9d3e3; }
.tt-report__form label.error { display: block; margin-top: 6px; color: #b42318; font-size: 13px; font-weight: 600; }
.tt-report__form .tt-input.error { border-color: #b42318; }
.tt-report__privacy { margin: 14px 0 0; color: #68717d; font-size: 13px; line-height: 1.6; }
.tt-report__privacy i { color: #F26B01; margin-right: 6px; }

/* Trade page content helpers */
.tt-proof { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 8px 0 24px; }
.tt-proof div { padding: 16px; border: 1px solid #e4ded2; border-radius: 12px; background: #fbf9fd; }
.tt-proof strong { display: block; color: #17012C; font-size: 26px; font-weight: 800; line-height: 1.15; }
.tt-proof span { display: block; margin-top: 6px; color: #504E4E; font-size: 14px; line-height: 1.5; }
.tt-jump { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 28px; }

@media (max-width: 767px) {
  .tt-section, .tt-report { padding: 52px 0; }
  .tt-panel { padding: 22px 18px; border-radius: 14px; }
  .tt-tabs { width: 100%; flex-wrap: wrap; overflow: visible; }
  .tt-tab { flex: 1 1 calc(50% - 8px); justify-content: center; padding: 10px 8px; font-size: 14px; }
  .tt-report__form { padding: 22px 18px; }
  .tt-estimate .tt-result { position: static; }
  .tt-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .tt-tab, .tt-btn, .tt-choice span { transition: none; }
}
