/* ------------------------------------------------------------------
   Dealer sites — shared stylesheet (provider pages + the neutral home)
   Colour tokens (--accent, --hero-bg, …) are injected per page by
   build.py into <style id="theme">: each provider page carries its
   carrier's palette, the home page a neutral one. Everything structural
   lives here. Mobile-first throughout.
   ------------------------------------------------------------------ */

:root {
  --paper:      #FFFFFF;
  --surface:    #F4F6F8;
  --surface-2:  #E9EDF1;
  --ink:        #111418;
  --ink-soft:   #363C44;
  --muted:      #5F6873;
  --line:       #DDE2E8;
  --shadow:     0 1px 2px rgba(17,20,24,.06), 0 8px 24px -12px rgba(17,20,24,.18);

  /* per-carrier defaults, overridden by #theme */
  --accent:       #0057B8;
  --accent-ink:   #00418F;
  --accent-wash:  #E6EFFA;
  --accent-solid: #0057B8;   /* build.py: accent if it reaches 4.5:1 under on-accent text, else accent-ink */
  --on-accent:    #FFFFFF;
  --hero-bg:      #003B80;
  --hero-ink:     #FFFFFF;
  --hero-sub-ink: #CFE0F7;
  --signal:       #F5A623;
  --btn-radius:   8px;

  --f-display: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --f-body:    "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --step--1: clamp(.84rem, .82rem + .10vw, .90rem);
  --step-0:  clamp(1rem, .97rem + .16vw, 1.08rem);
  --step-1:  clamp(1.15rem, 1.08rem + .36vw, 1.38rem);
  --step-2:  clamp(1.40rem, 1.24rem + .80vw, 1.90rem);
  --step-3:  clamp(1.80rem, 1.45rem + 1.75vw, 2.75rem);

  --gutter: 18px;
  --radius: 12px;
  --stick-h: 72px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:     #0E1216;
    --surface:   #161B21;
    --surface-2: #1F262E;
    --ink:       #EAEEF2;
    --ink-soft:  #C4CCD5;
    --muted:     #97A2AE;
    --line:      #29323C;
    --shadow:    0 1px 2px rgba(0,0,0,.4), 0 10px 28px -14px rgba(0,0,0,.7);
  }
}
:root[data-theme="dark"] {
  --paper:     #0E1216;
  --surface:   #161B21;
  --surface-2: #1F262E;
  --ink:       #EAEEF2;
  --ink-soft:  #C4CCD5;
  --muted:     #97A2AE;
  --line:      #29323C;
  --shadow:    0 1px 2px rgba(0,0,0,.4), 0 10px 28px -14px rgba(0,0,0,.7);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--stick-h) + env(safe-area-inset-bottom));
}
@media (min-width: 760px) { body { padding-bottom: 0; } }
a { color: var(--accent-ink); }
.wrap { width: 100%; max-width: 960px; margin-inline: auto; padding-inline: var(--gutter); }

h2 {
  font-family: var(--f-display); font-weight: 700; font-size: var(--step-2);
  line-height: 1.15; letter-spacing: -.015em; text-wrap: balance; margin: 0 0 14px;
}

/* --- top bar --- */
.idbar { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; }
.idbar .wrap { display: flex; align-items: center; gap: 8px; padding-block: 9px; }
.idbar .id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
@media (min-width: 560px) { .idbar .id { flex-direction: row; align-items: baseline; gap: 8px; } }
.idbar .brand {
  font-family: var(--f-display); font-weight: 800; font-size: 1.3rem; letter-spacing: -.02em;
  color: var(--accent-solid, var(--accent)); line-height: 1; white-space: nowrap;
}
.idbar .role {
  font-size: .68rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); white-space: nowrap; line-height: 1;
}
.idbar .idbar-call {
  margin-left: auto; font-family: var(--f-display); font-weight: 700; font-size: var(--step--1);
  color: var(--accent-ink); text-decoration: none; font-variant-numeric: tabular-nums; white-space: nowrap;
  border: 1.5px solid var(--accent); border-radius: var(--btn-radius); padding: 7px 12px;
}
/* "All providers" — places a provider page inside the multi-provider dealer site.
   Under the brand on phones (next to "Authorized Dealer"), same row on ≥560px. */
.idbar .id-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 8px; min-width: 0; }
.idbar .idbar-all {                       /* 24px tall hit area, no extra bar height */
  display: inline-flex; align-items: center; min-height: 24px; margin-block: -6px; font-size: .74rem; font-weight: 600;
  color: var(--accent-ink); text-underline-offset: 2px; white-space: nowrap; line-height: 1;
}
.idbar a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
/* ≤399px: keep the bar to two lines (brand / role + All providers) — the 1.3rem brand plus the phone button leave ~210px */
@media (max-width: 399px) {
  .idbar .brand { font-size: 1.12rem; }
  .idbar .role { font-size: .64rem; }
  .idbar .idbar-all { font-size: .7rem; }
  .idbar .id-sub { gap: 2px 6px; }
}

/* --- hero : carrier colour band --- */
.hero { background: var(--hero-bg); color: var(--hero-ink); }
.hero .wrap { padding-block: 26px 22px; }
.eyebrow {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--hero-ink); background: rgba(0,0,0,.2); border-radius: 999px; padding: 5px 11px; margin-bottom: 12px;
}
h1 {
  font-family: var(--f-display); font-weight: 800; font-size: var(--step-3); line-height: 1.06;
  letter-spacing: -.025em; text-wrap: balance; margin: 0 0 10px; max-width: 18ch; color: var(--hero-ink);
}
.lede { font-size: var(--step-0); line-height: 1.45; color: var(--hero-sub-ink); margin: 0 0 14px; max-width: 46ch; }
.addr {
  display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap;
  background: rgba(255,255,255,.12); border-left: 3px solid var(--hero-ink);
  border-radius: 0 10px 10px 0; padding: 10px 12px; margin-bottom: 14px; font-size: var(--step--1);
}
.addr .addr-label { font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .8; white-space: nowrap; }
.addr[hidden] { display: none !important; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  font-size: .8rem; font-weight: 600; color: var(--hero-ink);
  border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: 5px 11px; white-space: nowrap;
}

/* --- buttons --- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px; padding: 12px 18px; border-radius: var(--btn-radius);
  font-family: var(--f-display); font-weight: 700; font-size: var(--step-1); letter-spacing: -.01em;
  text-decoration: none; border: 1.5px solid transparent; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.btn-primary { background: var(--accent-solid, var(--accent)); color: var(--on-accent); box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--accent-ink); }
.btn-ghost { background: var(--paper); color: var(--accent-ink); border-color: var(--accent); font-size: var(--step-0); }
.btn-wide { width: 100%; max-width: 420px; margin-top: 18px; }

/* --- order form : first thing under the hero --- */
.order { background: var(--paper); }
.order .wrap { padding-block: 18px 26px; }
.order-form { max-width: 720px; display: grid; gap: 18px; }
.step { border: 0; margin: 0; padding: 0; display: grid; gap: 12px; min-width: 0; }
.step legend {
  font-family: var(--f-display); font-weight: 700; font-size: var(--step-1); letter-spacing: -.01em;
  display: flex; align-items: center; gap: 10px; margin-bottom: 4px; padding: 0;
}
.step-n {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-solid, var(--accent)); color: var(--on-accent); font-size: .9rem; font-weight: 800;
}
.step-sub { color: var(--muted); font-size: var(--step--1); margin: -6px 0 0; line-height: 1.45; }

.row-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.row-3 { display: grid; grid-template-columns: 1fr 1.6fr 1fr; gap: 12px; }
@media (max-width: 520px) { .row-3 { grid-template-columns: 1fr 1fr; } .row-3 .field:nth-child(2) { grid-column: 1 / -1; order: 3; } }
.field { display: grid; gap: 5px; min-width: 0; }
.field > span { font-size: var(--step--1); font-weight: 600; color: var(--ink-soft); }
.field > span b { color: var(--accent); font-weight: 700; }
.field input, .field select, .field textarea {
  font: inherit; font-size: 16px; color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 10px;
  padding: 12px 12px; min-height: 50px; width: 100%; -webkit-appearance: none; appearance: none;
}
.field select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.field textarea { min-height: 64px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.field input:user-invalid, .field select:user-invalid { border-color: #C62828; }

/* plan picker (radio cards) */
.plan-pick { display: grid; gap: 10px; }
@media (min-width: 640px) { .plan-pick { grid-template-columns: repeat(2, 1fr); } .plan-pick .pp-help { grid-column: 1 / -1; } }
.pp { position: relative; display: block; cursor: pointer; min-width: 0; }
.pp input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pp-body {
  display: grid; gap: 3px; padding: 14px 14px 12px 44px; border: 1.5px solid var(--line);
  border-radius: var(--radius); background: var(--paper); transition: border-color .12s, box-shadow .12s;
}
.pp-body::before {
  content: ""; position: absolute; left: 14px; top: 17px; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--muted); background: var(--paper); transition: all .12s;
}
.pp input:checked + .pp-body { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-wash) inset, var(--shadow); }
.pp input:checked + .pp-body::before { border-color: var(--accent); border-width: 6px; }
.pp input:focus-visible + .pp-body { outline: 3px solid var(--accent); outline-offset: 2px; }
.pp.popular .pp-body { border-color: var(--accent); }
.pp-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pp-name { font-family: var(--f-display); font-weight: 700; font-size: var(--step-0); }
.pp-badge {
  font-style: normal; font-family: var(--f-display); font-weight: 700; font-size: .66rem; letter-spacing: .08em;
  text-transform: uppercase; background: var(--accent-ink); color: var(--on-accent); padding: 3px 8px; border-radius: 999px;
}
.pp-speed { color: var(--muted); font-size: var(--step--1); }
.pp-price { font-family: var(--f-display); font-weight: 800; font-size: 1.7rem; line-height: 1.1; letter-spacing: -.02em; color: var(--ink); display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.pp-price small { font-size: .9rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.pp-term { font-family: var(--f-body); font-size: var(--step--1); font-weight: 600; color: var(--accent-ink); letter-spacing: 0; }
.pp-feats { font-size: .82rem; color: var(--ink-soft); line-height: 1.4; margin-top: 3px; }
.pp-help .pp-body { padding-block: 14px; background: var(--surface); }
.pp-help .pp-name { font-weight: 600; font-family: var(--f-body); font-size: var(--step--1); }

.consent { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; font-size: .82rem; color: var(--muted); line-height: 1.45; }
.consent input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--accent); }
.btn-submit { width: 100%; min-height: 58px; }
.btn-submit:disabled { opacity: .6; cursor: wait; }
.form-err { color: #C62828; font-weight: 600; font-size: var(--step--1); margin: 0; }
.form-fine { color: var(--muted); font-size: .78rem; margin: 0; line-height: 1.45; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.order-done { max-width: 720px; background: var(--accent-wash); border: 1px solid var(--accent); border-radius: var(--radius); padding: 20px; }
.order-done h3 { font-family: var(--f-display); font-size: var(--step-2); margin: 0 0 8px; color: var(--accent-ink); }
.order-done p { margin: 0 0 8px; color: var(--ink-soft); }
.order-done a { color: var(--accent-ink); font-weight: 700; }

/* --- promos --- */
.promos { background: var(--surface); border-top: 1px solid var(--line); }
.promos .wrap { padding-block: 26px; }
.promo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.promo { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); padding: 14px; }
.promo .val { font-family: var(--f-display); font-weight: 800; font-size: var(--step-1); color: var(--accent-solid, var(--accent)); letter-spacing: -.01em; line-height: 1.15; }
.promo h3 { font-family: var(--f-display); font-size: var(--step--1); font-weight: 700; margin: 4px 0 4px; }
.promo p { margin: 0; color: var(--ink-soft); font-size: .8rem; line-height: 1.45; }

/* --- why --- */
.why .wrap { padding-block: 26px 30px; }
.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 22px; }
.why-item h3 { font-family: var(--f-display); font-size: var(--step-0); font-weight: 700; margin: 0 0 2px; }
.why-item h3::before { content: "✓ "; color: var(--accent); }
.why-item p { margin: 0; color: var(--ink-soft); font-size: var(--step--1); line-height: 1.5; }

/* --- footer --- */
.foot { border-top: 1px solid var(--line); background: var(--surface); }
.foot .wrap { padding-block: 22px 28px; }
.foot p { font-size: .8rem; color: var(--muted); line-height: 1.55; margin: 0 0 8px; max-width: 70ch; }
.foot p:last-child { margin-bottom: 0; }
.foot strong { color: var(--ink-soft); }

/* --- sticky mobile bar --- */
.stick {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; gap: 8px; padding: 8px var(--gutter) calc(8px + env(safe-area-inset-bottom));
  background: var(--paper); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px -12px rgba(0,0,0,.25);
  transition: transform .2s ease;
}
.stick .btn { flex: 1; min-height: 50px; font-size: clamp(.82rem, 3.7vw, .98rem); padding-inline: 8px; white-space: nowrap; letter-spacing: -.01em; }
.stick .btn-ghost { flex: 1.15; }
.stick.hide { transform: translateY(120%); }
@media (min-width: 760px) { .stick { display: none; } }

/* ==================================================================
   Home — the neutral "pick your provider" page (templates/home.html.tmpl).
   Same tokens and type; its neutral palette comes from its own #theme
   block. Carrier colour appears only inside each provider card: the top
   border (--pc) and its buttons (--pc-ink / --pc-on), set per card in #theme.
   ================================================================== */
body.home { padding-bottom: env(safe-area-inset-bottom); }
.home .idbar .wrap { padding-block: 10px; }
.home .idbar .id { flex-direction: column; align-items: flex-start; gap: 4px; }
.home .idbar .brand { white-space: normal; font-size: 1.2rem; line-height: 1.1; }
.home .idbar .role { white-space: normal; line-height: 1.35; }
.home .idbar .role span { white-space: nowrap; }
.home .hero .wrap { padding-block: 28px 26px; }
.home h1 { max-width: 20ch; }
.home .lede { margin-bottom: 0; }
.home .addr { margin: 16px 0 0; }

.providers .wrap { padding-block: 24px 28px; }
.pc-grid { display: grid; gap: 14px; }
@media (min-width: 760px) { .pc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pcard {
  display: flex; flex-direction: column; gap: 6px; min-width: 0;
  background: var(--paper); border: 1px solid var(--line); border-top: 4px solid var(--pc, var(--accent));
  border-radius: var(--radius); padding: 16px 16px 18px; box-shadow: var(--shadow);
}
.pc-tag { font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.pc-name { font-family: var(--f-display); font-weight: 800; font-size: var(--step-2); letter-spacing: -.02em; line-height: 1.1; margin: 0; }
.pc-chips { margin: 0; font-size: var(--step--1); color: var(--ink-soft); line-height: 1.45; }
.pc-price { margin: 4px 0 0; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 5px; }
.pc-from { font-size: var(--step--1); font-weight: 600; color: var(--muted); }
.pc-amt { font-family: var(--f-display); font-weight: 800; font-size: 1.7rem; line-height: 1.1; letter-spacing: -.02em; }
.pc-mo { font-size: .9rem; font-weight: 600; color: var(--muted); margin-left: -3px; }
.pc-term { flex-basis: 100%; font-size: .8rem; color: var(--muted); }
.pc-acts { display: grid; gap: 8px; margin-top: auto; padding-top: 10px; }
.pc-acts[hidden], .pc-na[hidden] { display: none !important; }
.pc-order { background: var(--pc-ink, var(--accent-ink)); color: var(--pc-on, var(--on-accent)); box-shadow: var(--shadow); min-height: 52px; }
.pc-call { background: var(--paper); color: var(--pc-ink, var(--accent-ink)); border-color: var(--line); font-size: var(--step-0); min-height: 48px; }
.pc-call:hover { border-color: var(--pc-ink, var(--accent-ink)); }
.pc-na { margin: auto 0 0; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); color: var(--ink-soft); font-size: var(--step--1); font-weight: 600; }
.pcard.is-na { background: var(--surface); border-top-color: var(--line); box-shadow: none; }
.pcard.is-na .pc-name, .pcard.is-na .pc-amt { color: var(--ink-soft); }
.pc-note { margin: 14px 0 0; font-size: .8rem; color: var(--muted); line-height: 1.5; max-width: 70ch; }

.how { background: var(--surface); border-top: 1px solid var(--line); }
.how .wrap { padding-block: 26px; }
.how-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
@media (min-width: 760px) { .how-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; } }
.how-steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; }
.how-steps h3 { font-family: var(--f-display); font-size: var(--step-0); font-weight: 700; margin: 2px 0; }
.how-steps p { margin: 0; color: var(--ink-soft); font-size: var(--step--1); line-height: 1.5; }

.unsure { border-top: 1px solid var(--line); }
.unsure .wrap { padding-block: 26px 30px; }
.unsure p { margin: 0 0 14px; color: var(--ink-soft); max-width: 62ch; }
.unsure-phones { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-width: 420px; }
.unsure-phones a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px;
  padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none;
}
.unsure-phones a:hover { border-color: var(--accent-ink); }
.unsure-phones a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.up-name { font-weight: 700; }
.up-num { font-family: var(--f-display); font-weight: 700; color: var(--accent-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }
