/* GetCarWise Redesign — shared base styles
   Loaded on every redesigned page. Tokens are in tokens.css. */

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-sans); font-size: 16px; line-height: 1.6; color: var(--ink); background: var(--surface); -webkit-font-smoothing: antialiased; }
a { color: var(--coral-700); text-decoration: none; }
a:hover { color: var(--coral-600); text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
p:not(.no-max), dd { max-width: 72ch; }
summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
details[open] .faq-icon { transform: rotate(45deg); }

/* ---- Focus ---- */
:focus-visible { outline: 3px solid var(--plate-blue); outline-offset: 2px; }
.dark :focus-visible, .dark a:focus-visible, .dark button:focus-visible, .dark input:focus-visible { outline-color: var(--plate-yellow); }

/* ---- Layout ---- */
.container { max-width: var(--content-max); margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.section { padding-top: var(--space-8); padding-bottom: var(--space-8); }
@media (max-width: 640px) { .section { padding-top: var(--space-7); padding-bottom: var(--space-7); } }

/* ---- Header ---- */
.site-header { background: var(--navy-900); color: var(--on-dark); border-bottom: 1px solid var(--navy-800); position: sticky; top: 0; z-index: 100; }
.site-header .container { min-height: 72px; display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding-top: 12px; padding-bottom: 12px; }
.logo { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; color: #fff; text-decoration: none; line-height: 1; white-space: nowrap; }
.logo .wise { color: var(--coral-400); }
.nav-main { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.nav-main a { min-height: var(--touch-min); padding: 0 10px; display: inline-flex; align-items: center; font-size: 15px; font-weight: 500; color: var(--on-dark-muted); text-decoration: none; }
.nav-main a:hover { color: #fff; text-decoration: none; }
.nav-main a[aria-current="page"] { font-weight: 700; color: #fff; text-decoration: underline; text-decoration-color: var(--coral-400); text-decoration-thickness: 3px; text-underline-offset: 10px; }
.menu-btn { display: none; width: 44px; height: 44px; border: 0; border-radius: var(--radius-md); background: transparent; color: #fff; cursor: pointer; align-items: center; justify-content: center; }

/* Nav dropdowns */
.nav-dropdown-wrap { position: relative; }
.nav-drop-btn { min-height: var(--touch-min); padding: 0 10px; display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-sans); font-size: 15px; font-weight: 500; color: var(--on-dark-muted); background: none; border: none; cursor: pointer; white-space: nowrap; }
.nav-drop-btn:hover { color: #fff; }
.nav-drop-btn svg { transition: transform 0.2s; }
.nav-drop-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.nav-dropdown { display: none; position: absolute; top: 100%; left: 0; min-width: 200px; background: var(--navy-800); border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius-md); padding: 8px 0; box-shadow: 0 12px 32px rgba(0,0,0,0.4); z-index: 101; }
.nav-dropdown.open { display: flex; flex-direction: column; }
.nav-dropdown a { padding: 10px 20px; font-size: 15px; font-weight: 500; color: var(--on-dark-muted); text-decoration: none; white-space: nowrap; }
.nav-dropdown a:hover { color: #fff; background: rgba(255,255,255,0.06); text-decoration: none; }

/* Mobile nav */
@media (max-width: 760px) {
  .nav-main { display: none; }
  .nav-main.open { display: flex; flex-direction: column; position: fixed; top: 60px; left: 0; right: 0; bottom: 0; background: var(--navy-900); padding: 24px; gap: 0; z-index: 99; overflow-y: auto; }
  .nav-main.open > a, .nav-main.open > .nav-dropdown-wrap > .nav-drop-btn { width: 100%; padding: 16px 0; border-bottom: 1px solid var(--navy-800); font-size: 18px; }
  .nav-main.open .nav-dropdown { position: static; background: transparent; border: none; box-shadow: none; padding: 0 0 0 16px; border-radius: 0; }
  .nav-main.open .nav-dropdown a { padding: 12px 0; border-bottom: 1px solid var(--navy-800); font-size: 16px; }
  .menu-btn { display: flex; }
  .site-header .container { min-height: 60px; padding-left: 16px; padding-right: 16px; }
  .logo { font-size: 22px; }
}

/* ---- Footer ---- */
.site-footer { background: var(--navy-950); color: var(--on-dark-muted); font-size: 15px; line-height: 1.6; }
.site-footer .container { padding-top: 64px; padding-bottom: 32px; display: flex; flex-direction: column; gap: 40px; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 40px 56px; }
.footer-brand { flex: 1 1 260px; display: flex; flex-direction: column; gap: 12px; }
.footer-brand p { color: var(--on-dark-subtle); max-width: 300px; }
.footer-nav { flex: 1 1 160px; display: flex; flex-direction: column; gap: 8px; }
.footer-nav-title { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; }
.footer-nav a { color: var(--on-dark-muted); text-decoration: none; }
.footer-nav a:hover { color: #fff; text-decoration: underline; }
.footer-legal { margin: 0; padding-top: 24px; border-top: 1px solid #262a3a; font-size: 14px; color: var(--on-dark-subtle); }

/* ---- Plate input ---- */
.plate-wrap { display: flex; height: var(--control-height); border-radius: var(--radius-md); overflow: hidden; background: var(--plate-yellow); border: 3px solid var(--navy-950); }
.plate-band { width: 46px; flex: none; background: var(--plate-blue); color: #fff; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 10px; font-size: 13px; font-weight: 700; }
.plate-input { flex: 1; width: 0; min-width: 0; border: 0; background: transparent; font-family: var(--font-sans); font-size: var(--fs-plate); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--plate-ink); padding: 0 16px; }
.plate-input::placeholder { color: var(--plate-placeholder); opacity: 1; }
.plate-input:focus { outline: none; }
.plate-wrap:focus-within { box-shadow: 0 0 0 3px var(--plate-blue); }
.dark .plate-wrap:focus-within { box-shadow: 0 0 0 3px var(--plate-yellow); }

/* ---- Buttons ---- */
.btn-primary { height: var(--control-height); padding: 0 24px; border-radius: var(--radius-md); background: var(--coral-600); color: #fff; font-family: var(--font-sans); font-size: 16px; font-weight: 700; border: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; white-space: nowrap; }
.btn-primary:hover { background: var(--coral-700); text-decoration: none; color: #fff; }
.btn-secondary { height: var(--control-height); padding: 0 24px; border-radius: var(--radius-md); background: transparent; color: var(--ink); font-family: var(--font-sans); font-size: 16px; font-weight: 700; border: 2px solid var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; white-space: nowrap; }
.btn-secondary:hover { background: var(--surface-sunken); text-decoration: none; }

/* ---- Consent checkbox (legacy form-based) ---- */
.consent-label { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.45; cursor: pointer; }
.dark .consent-label { color: var(--on-dark-muted); }
.consent-label input[type="checkbox"] { flex: none; width: 24px; height: 24px; margin: 0; accent-color: var(--coral-600); }
.consent-label a { color: #fff; text-decoration: underline; }
.consent-error { display: none; color: var(--coral-400); font-size: 13px; margin-top: 4px; }
.consent-error.visible { display: block; }

/* ---- app.js form elements ---- */
.btn-loading { display: none; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.6s linear infinite; vertical-align: middle; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.email-field { display: none; }
.email-input { width: 100%; padding: 13px 18px; border-radius: var(--radius-md); border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.06); color: white; font-size: 0.92rem; outline: none; font-family: var(--font-sans); }

.marketing-agree { display: none; }
.marketing-label { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.marketing-checkbox { margin-top: 3px; }
.marketing-text { font-size: 0.75rem; color: rgba(255,255,255,0.8); line-height: 1.4; }

.terms-agree { margin-top: 4px; }
.terms-agree label { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; line-height: 1.45; color: rgba(255,255,255,0.7); min-height: 44px; }
.terms-agree input[type="checkbox"] { width: 24px; height: 24px; cursor: pointer; accent-color: var(--coral-600); flex-shrink: 0; margin: 0; }
.terms-agree a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.terms-agree a:hover { color: rgba(255,255,255,0.8); }

.human-check { margin-top: 10px; padding: 12px 16px; background: rgba(233,69,96,0.08); border: 1px solid rgba(233,69,96,0.2); border-radius: var(--radius-md); }
.human-check-label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.8rem; color: rgba(255,255,255,0.9); font-weight: 600; }
.human-check input[type="checkbox"] { width: 20px; height: 20px; cursor: pointer; accent-color: var(--coral-600); flex-shrink: 0; }

.error-msg { max-width: 640px; margin: 10px 0 0; padding: 12px 18px; border-radius: var(--radius-md); font-size: 0.85rem; font-weight: 500; line-height: 1.5; display: none; text-align: left; }
.error-msg.visible { display: block; }
.error-msg.error { background: rgba(233,69,96,0.1); border: 1px solid rgba(233,69,96,0.2); color: #ff8a9e; }
.error-msg.error a { color: #ff8a9e; text-decoration: underline; }
.error-msg.success { background: rgba(74,222,128,0.1); border: 1px solid rgba(74,222,128,0.2); color: #4ade80; }

/* ---- Reg form layout ---- */
.reg-row { display: flex; flex-wrap: wrap; gap: 12px; }
.reg-row .plate-wrap { flex: 1 1 min(300px, 100%); }

/* ---- Data source strip ---- */
.source-strip { padding-top: 20px; border-top: 1px solid var(--navy-800); display: flex; flex-direction: column; gap: 8px; font-size: 16px; line-height: 1.5; color: var(--on-dark-subtle); }
.source-strip p { margin: 0; }
.source-strip .provided-by { color: var(--emphasis-on-dark); font-weight: 700; white-space: nowrap; }
.experian-inline { display: block; }
.experian-inline img { display: inline; vertical-align: middle; }

/* ---- FAQ ---- */
.faq-list { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.faq-list details { padding: 20px 24px; }
.faq-list details + details { border-top: 1px solid var(--line); }
.faq-list summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: 18px; font-weight: 700; }
.faq-icon { flex: none; transition: transform 0.2s; }
.faq-list p { margin: 10px 0 0; color: var(--ink-muted); }

/* ---- Section headings ---- */
.section-head { display: flex; flex-direction: column; gap: 12px; max-width: 720px; }
.section-head h2 { margin: 0; font-size: var(--fs-h2); line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; }
.section-head p { margin: 0; font-size: 16px; line-height: 1.55; color: var(--ink-muted); }

/* ---- Cards ---- */
.card { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.card-featured { border: 2px solid var(--ink); }
.card-title { margin: 0; font-size: var(--fs-card-title); font-weight: 700; line-height: 1.3; }
.card-price { margin: 2px 0 0; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }

/* ---- Link grid tiles ---- */
.link-tile { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border: none; border-radius: var(--radius-md); text-decoration: none; font-size: 14px; font-weight: 600; transition: box-shadow 0.15s, transform 0.15s, background 0.15s; }
.link-tile::after { content: '\203A'; font-size: 18px; font-weight: 400; transition: color 0.15s, transform 0.15s; }
.link-tile:hover { transform: translateY(-2px); text-decoration: none; }
.link-tile:hover::after { transform: translateX(2px); }
.link-tile--blue { background: var(--plate-blue); color: #fff; }
.link-tile--blue::after { color: rgba(255,255,255,0.6); }
.link-tile--blue:hover { background: #1a44a0; color: #fff; box-shadow: 0 4px 16px rgba(31,79,176,0.35); }
.link-tile--blue:hover::after { color: #fff; }
.link-tile--navy { background: var(--navy-900); color: #fff; }
.link-tile--navy::after { color: rgba(255,255,255,0.4); }
.link-tile--navy:hover { background: var(--navy-800); color: #fff; box-shadow: 0 4px 16px rgba(27,30,46,0.4); }
.link-tile--navy:hover::after { color: #fff; }

/* ---- Link cards (with data preview) ---- */
.link-card { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; border-radius: var(--radius-md); text-decoration: none; color: #fff; transition: box-shadow 0.15s, transform 0.15s, background 0.15s; }
.link-card:hover { transform: translateY(-2px); text-decoration: none; color: #fff; }
.link-card-title { font-size: 16px; font-weight: 700; }
.link-card-meta { font-size: 13px; opacity: 0.7; }
.link-card--blue { background: var(--plate-blue); }
.link-card--blue:hover { background: #1a44a0; box-shadow: 0 6px 20px rgba(31,79,176,0.4); }
.link-card--navy { background: var(--navy-900); }
.link-card--navy:hover { background: var(--navy-800); box-shadow: 0 6px 20px rgba(27,30,46,0.5); }

/* ---- How it works ---- */
.how-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; width: 100%; max-width: 800px; }
.how-step { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.how-icon { width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.how-icon--yellow { background: var(--plate-yellow); }
.how-icon--coral { background: var(--coral-600); }
.how-icon--blue { background: var(--plate-blue); }
.how-step h3 { margin: 0; font-size: 16px; font-weight: 700; color: #fff; }
.how-step p { margin: 0; font-size: 14px; color: var(--on-dark-muted); line-height: 1.55; }

/* ---- Popular models grid ---- */
.model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.model-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: #fff; border-radius: var(--radius-md); border: 1px solid var(--line); }
.model-name { font-size: 15px; font-weight: 700; }
.model-links { display: flex; gap: 12px; flex-shrink: 0; }
.model-link { font-size: 13px; font-weight: 600; text-decoration: none; padding: 4px 12px; border-radius: var(--radius-sm); transition: background 0.15s; }
.model-link--blue { color: var(--plate-blue); background: var(--info-bg); }
.model-link--blue:hover { background: var(--plate-blue); color: #fff; text-decoration: none; }
.model-link--navy { color: var(--navy-900); background: var(--surface-sunken); }
.model-link--navy:hover { background: var(--navy-900); color: #fff; text-decoration: none; }

/* ---- Hover lift ---- */
.hover-lift { transition: transform 0.15s, box-shadow 0.15s; }
.hover-lift:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.15); }

/* ---- Responsive ---- */
@media (max-width: 640px) {
  /* Hero */
  .hero-headline { font-size: clamp(26px, 7.8vw, 34px); line-height: 1.18; }
  .hero-sub { font-size: 14px !important; line-height: 1.5 !important; }
  .hero-headline br { display: none; }
  .hero-wrap { gap: 40px !important; padding-top: 48px !important; padding-bottom: 48px !important; }
  .hero-content { gap: 24px !important; }
  .hero-preview { max-width: 100% !important; }

  /* Form */
  .reg-row { flex-direction: column; }
  .reg-row .plate-wrap { height: 74px; }
  .reg-row .btn-primary { width: 100%; height: 56px; font-size: 17px; }
  .plate-input { font-size: 28px; line-height: 74px; }
  .plate-band { width: 46px; font-size: 13px; align-items: center; padding-bottom: 0; }

  /* Terms */
  .terms-agree label { font-size: 13px; gap: 8px; }
  .terms-agree input[type="checkbox"] { width: 20px; height: 20px; }

  /* Source strip */
  .source-strip { font-size: 14px; }

  /* Sections */
  .section { padding-top: 40px; padding-bottom: 40px; }
  .section-head h2 { font-size: 22px; }

  /* Comparison table */
  .compare-table th[scope="row"] { padding: 12px 14px !important; font-size: 13px; }
  .compare-table th[scope="col"] { padding: 14px 10px !important; font-size: 12px; }
  .compare-table td { padding: 12px 8px !important; }

  /* Cards */
  .card { padding: 20px; }
  .card-price { font-size: 22px; }

  /* FAQ */
  .faq-list details { padding: 16px 18px; }
  .faq-list summary { font-size: 16px; }

  /* How it works */
  .how-steps { grid-template-columns: 1fr; gap: 28px; max-width: 320px; margin: 0 auto; }

  /* Link cards */
  .link-card { padding: 14px 16px; }
  .link-card-title { font-size: 15px; }
  .link-card-meta { font-size: 12px; }

  /* Popular models */
  .model-grid { grid-template-columns: 1fr; }
  .model-row { padding: 10px 14px; flex-wrap: wrap; gap: 4px 12px; }
  .model-name { font-size: 14px; }
  .model-link { font-size: 12px; padding: 4px 10px; }

  /* Footer */
  .footer-grid { gap: 32px 40px; }
}

/* ---- Utility ---- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.dark { background: var(--navy-900); color: var(--on-dark); }
.sunken { background: var(--surface-sunken); }
.text-muted { color: var(--ink-muted); }
.text-subtle { color: var(--ink-subtle); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-coral { color: var(--coral-400); }
.no-max { max-width: none; }

/* ---- Cookie banner ---- */
.cookie-banner { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999; background: var(--navy-950); border-top: 1px solid rgba(255,255,255,0.1); padding: 16px 24px; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; box-shadow: 0 -4px 24px rgba(0,0,0,0.4); padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
.cookie-text { color: var(--on-dark-muted); font-size: 13px; line-height: 1.5; margin: 0; max-width: 600px; }
.cookie-link { color: rgba(255,255,255,0.9); text-decoration: underline; }
.cookie-actions { display: flex; gap: 10px; flex-shrink: 0; }
.cookie-btn { padding: 8px 20px; border-radius: var(--radius-md); font-size: 13px; font-weight: 600; cursor: pointer; font-family: var(--font-sans); min-height: var(--touch-min); min-width: var(--touch-min); }
.cookie-btn-reject { background: transparent; border: 1px solid rgba(255,255,255,0.2); color: rgba(255,255,255,0.5); }
.cookie-btn-accept { background: var(--coral-600); border: none; color: #fff; }
@media (max-width: 640px) {
  .cookie-banner { flex-direction: column; gap: 12px; text-align: center; }
  .cookie-actions { justify-content: center; }
}
