/* TrueCostMotors main-page styles (2026-09-25).
   Pilot design language ("car magazine meets fintech") for every non-car-detail
   page: home, calculator, cars index, compare, bang-for-buck, blog, garage,
   about, contact, privacy. Tokens come from pilot.css (:root); this file only
   styles the main pages' legacy class names plus a mobile nav toggle.
   Car pages are untouched (they load pilot.css only). */

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 1.25rem; }

/* ---------- mobile nav toggle (main pages only; main.js wires .nav-toggle) ---------- */
.p-nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-size: 1.2rem; cursor: pointer; flex: none;
}
@media (max-width: 760px) {
  .p-nav-toggle { display: inline-flex; }
  .p-header-inner { position: relative; }
  .p-nav {
    display: none; position: absolute; top: calc(100% + .5rem); right: 1.25rem;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--card-2); border: 1px solid var(--line); border-radius: 14px;
    padding: .5rem; min-width: 13rem;
    box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .9);
  }
  .p-nav a:not(.p-nav-cta) { display: block; padding: .65rem .9rem; border-radius: 8px; }
  .p-nav a:not(.p-nav-cta):hover { background: rgba(255, 255, 255, .05); }
  .p-nav .p-nav-cta { margin: .4rem .35rem .35rem; text-align: center; }
  .p-nav.open { display: flex; }
}
@media (min-width: 761px) {
  .p-nav { display: flex; }
}

/* ---------- buttons (legacy .btn names, pilot look) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: #fff; color: #111; font-weight: 700; font-size: .95rem;
  padding: .8rem 1.6rem; border-radius: 999px; text-decoration: none;
  border: 0; cursor: pointer; font-family: var(--fb);
  transition: transform .16s ease, box-shadow .16s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .6); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-hot); }
.btn-secondary { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-secondary:hover { border-color: var(--mut); box-shadow: none; }
.btn-small { padding: .5rem 1rem; font-size: .85rem; }
.btn-danger { background: transparent; color: var(--red-hot); border: 1.5px solid rgba(255, 45, 30, .4); }
.btn-danger:hover { background: rgba(225, 6, 0, .12); box-shadow: none; }

/* ---------- type helpers ---------- */
.lede { font-size: clamp(1.02rem, 2.6vw, 1.2rem); color: var(--mut); max-width: 62ch; }
.fine-print { color: var(--dim); font-size: .85rem; max-width: 70ch; }
.fine-print a { color: var(--dim); }
.section-sub { color: var(--mut); margin: 0 0 1.75rem; max-width: 64ch; }
.affiliate, .blurb { color: var(--dim); font-size: .9rem; }

/* ---------- generic sections ---------- */
main > .wrap { padding-block: clamp(2.5rem, 7vw, 3.5rem); }
main > .wrap > h1 {
  font-family: var(--fd); font-weight: 700; letter-spacing: -.02em;
  font-size: clamp(1.9rem, 7vw, 3rem); line-height: 1.06;
  margin: 0 0 1rem; text-wrap: balance; max-width: 20ch;
}
main > section { padding-block: clamp(2.5rem, 7vw, 4rem); }
main > section + section { border-top: 1px solid var(--line-soft); }
main > section > .wrap > h2 {
  font-family: var(--fd); font-weight: 700; letter-spacing: -.015em;
  font-size: clamp(1.4rem, 5.2vw, 2rem); line-height: 1.15;
  margin: 0 0 1rem; text-wrap: balance;
}
main > section > .wrap > h2 + p { color: var(--mut); max-width: 64ch; }

/* ---------- cards ---------- */
.cards-3 { display: grid; gap: 1.25rem; grid-template-columns: 1fr; margin-top: 1.5rem; }
@media (min-width: 760px) { .cards-3 { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line); border-radius: var(--r);
  padding: clamp(1.25rem, 4vw, 1.75rem);
  box-shadow: 0 18px 44px -28px rgba(0, 0, 0, .9);
  display: flex; flex-direction: column; gap: .6rem;
  transition: border-color .18s ease, transform .18s ease;
}
.card:hover { border-color: rgba(255, 255, 255, .18); transform: translateY(-2px); }
.card h2, .card h3 { font-family: var(--fd); font-size: 1.15rem; letter-spacing: -.01em; margin: 0; }
.card h2 a, .card h3 a { color: var(--ink); text-decoration: none; }
.card h2 a:hover, .card h3 a:hover { color: var(--red-hot); }
.card p { color: var(--mut); margin: 0; font-size: .95rem; }
.card p strong { color: var(--ink); }
.card .fine-print { margin: 0; }
.card > p:last-child { margin-top: auto; padding-top: .5rem; }
.card img { border-radius: 10px; }

/* ---------- homepage: car jump ---------- */
.car-jump {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line); border-radius: var(--r);
  padding: clamp(1.25rem, 4vw, 2rem); margin-top: 1.5rem;
  box-shadow: 0 18px 44px -28px rgba(0, 0, 0, .9);
}
.car-jump label { display: block; font-size: .8rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); margin-bottom: .7rem; }
.car-jump label strong { color: var(--ink); }
.car-jump-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.car-jump-row select {
  flex: 1 1 12rem; background: #0a0e13; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  padding: .7rem .85rem; font: inherit; font-size: 1rem;
}
.car-jump .fine-print { margin: .9rem 0 0; }

/* ---------- homepage: how it works steps ---------- */
.steps { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: 1fr; counter-reset: step; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.steps > li {
  background: var(--card); border: 1px solid var(--line-soft); border-radius: 14px;
  padding: 1.25rem 1.2rem; counter-increment: step; position: relative;
}
.steps > li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--fd); font-weight: 700; font-size: 1.6rem; color: var(--red-hot);
  display: block; margin-bottom: .5rem; letter-spacing: -.02em;
}
.steps h3 { margin: 0 0 .4rem; font-size: 1.02rem; font-family: var(--fd); }
.steps p { margin: 0; color: var(--mut); font-size: .92rem; }

/* ---------- homepage: faq ---------- */
.faq details { background: var(--card); border: 1px solid var(--line-soft); border-radius: 14px; margin-bottom: .7rem; overflow: hidden; }
.faq summary {
  cursor: pointer; list-style: none; padding: 1.05rem 1.25rem; font-weight: 600;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex: none; width: 1.7rem; height: 1.7rem; border-radius: 50%;
  border: 1px solid var(--line); color: var(--red-hot);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 400; transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0; padding: 0 1.25rem 1.2rem; color: var(--mut); }
.faq details p strong { color: var(--ink); }

/* ---------- calculator ---------- */
.calc-layout { display: grid; grid-template-columns: 1fr; gap: 1.5rem; margin: 1.5rem 0; }
@media (min-width: 1000px) { .calc-layout { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; } }
.calc-card {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line); border-radius: var(--r);
  padding: clamp(1.25rem, 4vw, 2rem);
  box-shadow: 0 18px 44px -28px rgba(0, 0, 0, .9);
}
.calc-card h2 {
  font-family: var(--fd); font-size: 1.25rem; letter-spacing: -.01em;
  margin: 0 0 1.25rem; padding-bottom: .9rem; border-bottom: 1px solid var(--line-soft);
}
.calc-card h3 { font-family: var(--fd); font-size: 1.05rem; margin: 1.75rem 0 .75rem; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .78rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); margin-bottom: .45rem; }
.field input, .field select {
  width: 100%; background: #0a0e13; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  padding: .7rem .85rem; font: inherit; font-size: 1rem; box-sizing: border-box;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--red-hot); box-shadow: 0 0 0 3px rgba(225, 6, 0, .25); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.mode-toggle { display: flex; gap: .5rem; margin-bottom: 1rem; }
.mode-toggle label {
  flex: 1; text-align: center; padding: .65rem; cursor: pointer; font-weight: 650;
  border: 1.5px solid var(--line); border-radius: 10px; color: var(--mut);
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.mode-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.mode-toggle label:has(input:checked) { border-color: var(--red-hot); background: rgba(225, 6, 0, .1); color: var(--ink); }
/* compare page variant: buttons instead of radios */
.mode-toggle button {
  flex: 1; background: var(--card); color: var(--mut); border: 1.5px solid var(--line);
  padding: .65rem 1rem; font: inherit; font-weight: 650; font-size: .95rem;
  border-radius: 10px; cursor: pointer;
}
.mode-toggle button.active { background: var(--red); border-color: var(--red); color: #fff; }

.hero-cost {
  background: #0a0e13; border: 1px solid var(--line); border-radius: 14px;
  padding: 1.25rem 1.5rem; margin: .5rem 0 1.25rem;
  box-shadow: inset 3px 0 0 var(--red);
}
.hero-cost .label { font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--mut); }
.hero-cost .value {
  font-family: var(--fd); font-weight: 700; font-size: clamp(2.4rem, 10vw, 3.2rem);
  line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff 30%, #c9d2dd 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-cost .sub { color: var(--dim); font-size: .9rem; margin-top: .3rem; }
.result-row { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line-soft); }
.result-row:last-child { border-bottom: 0; }
.result-row .k { font-weight: 600; color: var(--mut); }
.result-row .v { text-align: right; font-variant-numeric: tabular-nums; }
.result-row .v strong { color: var(--ink); }

.cost-bar { display: flex; height: 26px; border-radius: 8px; overflow: hidden; background: rgba(255, 255, 255, .06); margin: .9rem 0 .6rem; }
.cost-bar .seg { min-width: 0; transition: width .25s ease; }
.seg-payment { background: var(--red); }
.seg-insurance { background: #2f6fde; }
.seg-fuel { background: var(--amber); }
.seg-maint { background: #2e9e5b; }
.seg-reg { background: #805ad5; }
.seg-proptax { background: #319795; }
.bar-legend { list-style: none; padding: 0; margin: 0 0 .5rem; display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; font-size: .88rem; color: var(--mut); }
.bar-legend .dot { display: inline-block; width: .75rem; height: .75rem; border-radius: 3px; margin-right: .4rem; vertical-align: baseline; }
.bar-legend strong { color: var(--ink); font-variant-numeric: tabular-nums; }

.alert {
  background: rgba(225, 6, 0, .1); border: 1px solid rgba(225, 6, 0, .4);
  color: #ffb3ad; border-radius: 12px; padding: 1rem 1.2rem; margin: 1rem 0;
}
.ppi-note {
  background: rgba(255, 180, 0, .08); border: 1px solid rgba(255, 180, 0, .3);
  color: var(--amber); border-radius: 12px; padding: .9rem 1.1rem; margin: 1rem 0; font-size: .92rem;
}
.save-garage-wrap { margin: 1.25rem 0; }
.afford-result {
  background: #0a0e13; border: 1px solid var(--line-soft); border-radius: 12px;
  padding: 1rem 1.15rem; margin-top: .9rem;
}
.afford-line { margin: 0; display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: baseline; }
.afford-detail { color: var(--mut); font-size: .88rem; flex-basis: 100%; }

.issue-grid { display: grid; gap: 1rem; margin: 1.25rem 0; grid-template-columns: 1fr; }
@media (min-width: 760px) { .issue-grid { grid-template-columns: 1fr 1fr; } }
.issue-card {
  background: var(--card); border: 1px solid var(--line-soft); border-left: 3px solid var(--red);
  border-radius: 12px; padding: 1.1rem 1.25rem;
}
.issue-card h3 { margin: 0 0 .4rem; font-size: 1.02rem; font-family: var(--fd); }
.issue-card p { margin: .35rem 0; color: var(--mut); font-size: .92rem; }
.issue-cost { font-weight: 700; color: var(--amber); }

/* ---------- compare ---------- */
.compare-picks { display: flex; flex-wrap: wrap; gap: 1rem; align-items: end; margin: 1.5rem 0; }
.compare-picks > div { flex: 1 1 12rem; min-width: 0; }
.compare-picks label { display: block; font-size: .78rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); margin-bottom: .45rem; }
.compare-picks select {
  width: 100%; background: #0a0e13; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  padding: .7rem .85rem; font: inherit; font-size: 1rem;
}
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); -webkit-overflow-scrolling: touch; }
.compare-table { width: 100%; border-collapse: collapse; font-size: .94rem; min-width: 36rem; }
.compare-table th, .compare-table td { padding: .85rem 1.25rem; text-align: right; border-top: 1px solid var(--line-soft); vertical-align: top; white-space: nowrap; font-variant-numeric: tabular-nums; }
.compare-table thead th {
  font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--dim); border-top: 0; background: rgba(255, 255, 255, .02);
}
.compare-table th:first-child, .compare-table td:first-child { text-align: left; white-space: normal; }
.compare-table tbody th[scope="row"] { font-weight: 550; color: var(--mut); }
.compare-table td.win { background: rgba(52, 209, 123, .12); font-weight: 700; color: var(--ink); }
.compare-table tr.row-highlight td, .compare-table tr.row-highlight th { background: rgba(225, 6, 0, .07); }
.compare-table tr.row-highlight td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.compare-table a { color: var(--red-hot); font-weight: 600; text-decoration: none; }
.compare-table a:hover { text-decoration: underline; }

/* ---------- bang for buck ---------- */
.method-note p, .bracket p { color: var(--mut); max-width: 68ch; }
.method-note a, .bracket a { color: var(--red-hot); font-weight: 600; text-decoration: none; }
.method-note a:hover, .bracket a:hover { text-decoration: underline; }
.bracket-winner {
  background: rgba(225, 6, 0, .07); border: 1px solid rgba(225, 6, 0, .25);
  border-left: 3px solid var(--red); border-radius: 12px;
  padding: .9rem 1.15rem; color: var(--ink); max-width: 60rem;
}
.bracket-winner strong { font-variant-numeric: tabular-nums; }
.bracket .table-scroll { margin-top: 1.25rem; }

/* ---------- garage ---------- */
.garage-grid { display: grid; gap: 1.25rem; grid-template-columns: 1fr; margin: 1.5rem 0; }
@media (min-width: 760px) { .garage-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .garage-grid { grid-template-columns: repeat(3, 1fr); } }
.garage-card {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 1.25rem; display: flex; flex-direction: column; gap: .8rem;
  box-shadow: 0 18px 44px -28px rgba(0, 0, 0, .9);
}
.garage-card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.garage-card-head h3 { margin: 0; font-size: 1.15rem; font-family: var(--fd); letter-spacing: -.01em; }
.mode-badge {
  display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; padding: .3rem .75rem; border-radius: 999px;
  background: rgba(47, 111, 222, .15); color: #7aa5f5; border: 1px solid rgba(47, 111, 222, .4);
  flex: none;
}
.mode-badge.mode-used { background: rgba(255, 180, 0, .1); color: var(--amber); border-color: rgba(255, 180, 0, .4); }
.garage-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 0; }
.garage-stats > div { background: #0a0e13; border: 1px solid var(--line-soft); border-radius: 10px; padding: .6rem .7rem; }
.garage-stats dt { font-size: .64rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); margin-bottom: .2rem; }
.garage-stats dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; font-size: .95rem; }
.garage-config { color: var(--dim); font-size: .82rem; margin: 0; }
.garage-actions { display: flex; gap: .6rem; margin-top: auto; padding-top: .4rem; }
.empty-state {
  text-align: center; background: var(--card); border: 1px dashed var(--line);
  border-radius: var(--r); padding: clamp(2rem, 8vw, 4rem) 1.5rem; margin: 1.5rem 0;
}
.empty-state h2 { font-family: var(--fd); margin: 0 0 .75rem; }
.empty-state p { color: var(--mut); max-width: 52ch; margin: 0 auto 1.5rem; }
.garage-error {
  background: rgba(225, 6, 0, .1); border: 1px solid rgba(225, 6, 0, .4);
  color: #ffb3ad; border-radius: 12px; padding: 1rem 1.2rem; margin: 1rem 0;
}
main section details { background: var(--card); border: 1px solid var(--line-soft); border-radius: 14px; margin-bottom: .7rem; overflow: hidden; }
main section details summary {
  cursor: pointer; list-style: none; padding: 1.05rem 1.25rem; font-weight: 600;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
main section details summary::-webkit-details-marker { display: none; }
main section details summary::after {
  content: "+"; flex: none; width: 1.7rem; height: 1.7rem; border-radius: 50%;
  border: 1px solid var(--line); color: var(--red-hot);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 400; transition: transform .2s ease;
}
main section details[open] summary::after { transform: rotate(45deg); }
main section details p { margin: 0; padding: 0 1.25rem 1.2rem; color: var(--mut); }

/* ---------- blog ---------- */
.prose { max-width: 46rem; }
.prose > .fine-print:first-child { margin-bottom: .5rem; }
.prose h1 {
  font-family: var(--fd); font-weight: 700; letter-spacing: -.02em;
  font-size: clamp(1.8rem, 6.5vw, 2.75rem); line-height: 1.08;
  margin: 0 0 1.5rem; text-wrap: balance;
}
.prose h2 {
  font-family: var(--fd); font-weight: 700; letter-spacing: -.015em;
  font-size: clamp(1.3rem, 4.5vw, 1.7rem); line-height: 1.2;
  margin: 2.5rem 0 1rem;
}
.prose h3 { font-family: var(--fd); font-size: 1.12rem; margin: 2rem 0 .75rem; }
.prose p, .prose li { color: #c9d1db; }
.prose p strong, .prose li strong { color: var(--ink); }
.prose p { margin: 0 0 1.15rem; }
.prose ul, .prose ol { margin: 0 0 1.25rem; padding-left: 1.4rem; }
.prose li { margin-bottom: .5rem; }
.prose a { color: var(--red-hot); font-weight: 600; text-decoration: none; }
.prose a:hover { text-decoration: underline; }
.prose a.btn { color: #111; }
.prose a.btn-primary { color: #fff; }
.prose a.btn-secondary { color: var(--ink); }
.prose table { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 1.5rem 0; }
.prose th, .prose td { padding: .7rem .9rem; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.prose thead th {
  font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--dim);
}
.prose td { font-variant-numeric: tabular-nums; }
.prose .table-scroll { margin: 1.5rem 0; }
.prose .table-scroll table { margin: 0; }
.prose blockquote {
  margin: 1.5rem 0; padding: .25rem 0 .25rem 1.25rem;
  border-left: 3px solid var(--red); color: var(--mut); font-size: 1.05rem;
}
.prose img { border-radius: 12px; border: 1px solid var(--line); }

/* ---------- about / contact / privacy ---------- */
.disclaimer {
  background: rgba(255, 180, 0, .07); border: 1px solid rgba(255, 180, 0, .28);
  border-radius: 14px; padding: 1.1rem 1.25rem; margin: 1.75rem 0;
  color: var(--mut); font-size: .95rem;
}
.disclaimer strong { color: var(--ink); }
.contact-email-big { font-size: 1.35rem; font-weight: 700; font-family: var(--fd); }
.contact-email-big a { color: var(--red-hot); text-decoration: none; }
.contact-email-big a:hover { text-decoration: underline; }
.form-note { color: var(--dim); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .card:hover, .btn:hover { transform: none; }
}
