/* funnel.css — the proven SNS funnel look, generalized.
   Brand colors arrive via --fp (primary) / --fa (accent) / --fgood.

   THIS SHEET IS NOW LOADED ON ORDINARY SITE PAGES TOO. public/js/pdx-form.js
   injects it when `[[form:key]]` embeds a form into a page, post or module
   footer, so every rule here has to be harmless on a page it was not written
   for. That is why the reset and the link colour below are SCOPED TO
   `body.funnel` rather than being the bare `*` and `a` selectors they were: an
   unscoped `*{margin:0;padding:0}` pulled onto a content page flattens the
   article it was meant to sit inside.
     - THE RESET'S `:where()` IS LOAD-BEARING. `body.funnel *` matches what `*`
       matches here, but not with `*`'s specificity: (0,1,1) beats every
       single-class rule in this file, so the reset won `margin` and `padding`
       over `.f-hero`, `.f-stat` and `.f-wrap` while properties it does not set
       (border-radius, background, colour) still applied — the player rendered
       in the right palette and type with every container flush left and
       unpadded, which looks like a failed stylesheet rather than a cascade
       bug. `:where()` matches without adding specificity. Do not unwrap it.
     - Everything else is either `.f-*` (player-only markup) or `.pdx-form ...`
       (the embed), so it matches nothing on a page without a form.
   Keep it that way: a new bare element selector here restyles every site page
   that carries a form. */
:where(body.funnel),:where(body.funnel) *{box-sizing:border-box;margin:0;padding:0}
/* Type and page colour now DEFER to the site tokens, falling back to what
   this file always hardcoded. The player emits the --site-* block, so a
   funnel picks up the install's typeface instead of Segoe UI — the single
   most visible reason a funnel looked like a different website. The
   fallbacks keep an install with no theme tokens exactly as it was. */
body.funnel{font-family:var(--site-font,"Segoe UI",system-ui,-apple-system,Arial,sans-serif);background:var(--site-paper,#F7F6F2);color:var(--site-ink,#22304A);line-height:1.6;font-size:var(--site-font-size,17px)}
/* SCOPED TO #app, NOT THE WHOLE BODY. A funnel that inherits its owning
   module's chrome renders that module's <header>/<footer> as SIBLINGS of
   <main id="app">, and `body.funnel a` (0,1,1) outranks the design system's
   bare `a{color:var(--text-link)}` (0,0,1) whichever stylesheet loads last --
   so the unscoped rule repainted the site's own nav in the funnel's "good"
   green on every funnel wearing real chrome. The player renders the funnel
   itself into #app, so #app is the exact boundary: funnel content keeps the
   green, inherited chrome keeps the module's colours.
   Deliberately NOT `body.funnel > header a`, which would also outrank
   `.f-head a{color:#fff}` (0,1,1) and wreck the dark fallback header used by
   funnels that have no module chrome to inherit. */
body.funnel #app a{color:var(--fgood)}

/* A FUNNEL INHERITS ITS OWNING MODULE'S ACCENT, so --fa can be any of the
   brand's secondaries and they are not interchangeable: one of them is 1.34:1
   on this paper and white on it is 1.53:1. The raw accent is for fills and
   geometry, never small text; anything sitting ON an accent fill takes --fon.

     --fa-shade  accent darkened toward ink -- accent AS TEXT on the light body
     --fa-tint   accent lightened -- accent as text/outline on the dark hero */
.f-head{background:var(--fp);color:#fff;position:sticky;top:0;z-index:50;display:flex;align-items:center;justify-content:space-between;padding:14px 20px;box-shadow:0 2px 10px rgba(0,0,0,.25)}
.f-brand{font-weight:700;letter-spacing:.3px}
.f-phone{color:#fff;text-decoration:none;font-weight:600;background:rgba(255,255,255,.12);padding:6px 14px;border-radius:999px}
.f-panel{display:none;animation:ffade .35s ease}
.f-panel.active{display:block}
@keyframes ffade{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){.f-panel{animation:none}}
.f-wrap{max-width:960px;margin:0 auto;padding:0 20px}
.f-narrow{max-width:640px;margin:0 auto;padding:0 20px}
.f-btn{display:inline-block;border:0;cursor:pointer;font-family:inherit;font-size:1.05rem;font-weight:700;border-radius:10px;padding:15px 30px;text-decoration:none;text-align:center}
.f-btn:focus-visible{outline:3px solid var(--fa-shade,var(--fa));outline-offset:2px}
.f-hero .f-btn:focus-visible{outline-color:var(--fa-tint,var(--fa))}
.f-btn-go{background:var(--fa);color:var(--fon,#fff);box-shadow:0 4px 14px rgba(0,0,0,.2)}
.f-btn-ghost{background:transparent;color:#5F6B80;font-weight:600}
.f-btn-shield{background:var(--fgood);color:#fff;font-size:1.15rem;padding:17px 40px}
.f-btn-block{width:100%}
/* A multi-choice Continue stays disabled until something is ticked, so it
   must LOOK unavailable -- an unstyled disabled button reads as broken.
   Kept above 3:1 against the card so it is still legible, not invisible. */
.f-btn:disabled{opacity:.45;cursor:not-allowed;box-shadow:none}
/* THE `hidden` ATTRIBUTE DOES NOT HIDE ANYTHING THIS SHEET GIVES A `display` TO,
   and the failure was not cosmetic. `[hidden]{display:none}` is a UA rule, and
   ANY author `display` beats a UA one whatever the specificity -- so
   `.f-btn{display:inline-block}` left `<button id="qnext" hidden>Continue →</button>`
   on screen and CLICKABLE on every single-choice question, advancing the quiz
   with no answer recorded and stranding the visitor on the last question.
   Two more were leaking the same way and were merely ugly: #doneBtn on a funnel
   with no completion URL, and #doneCoupon on one with no coupon -- an empty
   dashed box. `.f-err` and `.f-field` set no display, which is why they were
   fine and why this cannot be left to whoever adds the next rule.
   Scoped INSIDE #app rather than a bare `[hidden]` because pdx-form.js injects
   this sheet onto ordinary pages, where a global !important is not ours to
   impose. */
#app [hidden]{display:none!important}
/* Honeypot container. Off-canvas rather than display:none or visibility:hidden
   -- a bot that skips non-rendered fields would skip this one, and finding it
   is the entire point. Nothing here is reachable by pointer, tab or reader. */
.f-trap{position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden}
.f-hero{background:linear-gradient(180deg,var(--fp),color-mix(in srgb,var(--fp) 82%,#fff 18%));color:#fff;padding:64px 20px 72px;text-align:center}
.f-eyebrow{display:inline-block;background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.4);padding:6px 16px;border-radius:999px;font-size:.85rem;font-weight:700;letter-spacing:.6px;text-transform:uppercase;margin-bottom:22px}
/* COLOUR IS SET ON THE DESCENDANTS, NOT LEFT TO INHERIT.
   `.f-hero` and `.f-head` sit on a dark field and set color:#fff, which
   USED to be enough. It is not once an owning module's stylesheet loads
   after this file — the player now renders that module's chrome, so it
   does. A site design system almost always carries a bare
   `h1,h2,h3,h4{color:...}`, and a DIRECT rule beats an INHERITED value at
   any specificity, so the hero headline turned dark-on-dark and unreadable
   while the paragraph beside it stayed white. Naming the descendants gives
   these class specificity, which a bare element selector cannot outrank. */
.f-hero h1,.f-hero h2,.f-hero p,.f-hero .f-sub{color:#fff}
.f-head,.f-head .f-brand,.f-head a{color:#fff}
.f-hero h1{font-size:clamp(1.9rem,4.6vw,3rem);line-height:1.15;font-weight:800;max-width:760px;margin:0 auto 18px}
.f-sub{font-size:1.15rem;opacity:.85;max-width:620px;margin:0 auto 32px}
.f-fine{margin-top:16px;font-size:.9rem;opacity:.7}
.f-band{background:#fff;border-bottom:1px solid #E3E1D9;padding:44px 20px;text-align:center}
.f-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:18px;max-width:960px;margin:0 auto}
.f-stat{background:#F7F6F2;border:1px solid #E3E1D9;border-radius:14px;padding:22px;text-align:left}
.f-stat b{display:block;font-size:1.35rem;color:var(--fa-shade,var(--fa));margin-bottom:4px}
.f-stat span{font-size:.95rem;color:#5F6B80}
.f-band-cta{margin-top:30px}
.f-progress{margin:48px 0 26px}
.f-ptext{display:flex;justify-content:space-between;font-size:.85rem;color:#5F6B80;margin-bottom:8px;font-weight:600}
.f-pbar{height:8px;background:#E3E1D9;border-radius:99px;overflow:hidden}
.f-pbar i{display:block;height:100%;width:0;background:var(--fgood);border-radius:99px;transition:width .3s ease}
.f-qcard{background:#fff;border:1px solid #E3E1D9;border-radius:14px;padding:34px 30px;box-shadow:0 6px 24px rgba(0,0,0,.06);margin-bottom:64px}
.f-qcard h2{font-size:1.35rem;line-height:1.35;margin-bottom:6px}
.f-qsub{color:#5F6B80;font-size:.95rem;margin-bottom:22px}
.f-opts{display:grid;gap:12px}
.f-opt{display:flex;align-items:center;gap:14px;border:2px solid #E3E1D9;border-radius:12px;padding:16px 18px;cursor:pointer;background:#fff;font-size:1.02rem;font-weight:600;text-align:left;font-family:inherit;color:#22304A}
.f-opt:hover{border-color:var(--fgood)}
.f-opt:focus-visible{outline:3px solid var(--fa-shade,var(--fa));outline-offset:2px}
.f-dot{width:22px;height:22px;border:2px solid #E3E1D9;border-radius:50%;flex:none;display:grid;place-items:center}
.f-opt.sel{border-color:var(--fgood);background:color-mix(in srgb,var(--fgood) 10%,#fff)}
/* The dropdown form of a single-choice question. Sized and bordered like the
   option buttons it stands in for, so a funnel mixing the two does not look
   like two different forms. */
.f-select{width:100%;font-family:inherit;font-size:1.02rem;font-weight:600;padding:16px 18px;
  border:2px solid #E3E1D9;border-radius:12px;background:#fff;color:#22304A;cursor:pointer}
.f-select:focus-visible{outline:3px solid var(--fa-shade,var(--fa));outline-offset:2px}
.f-opt.sel .f-dot{border-color:var(--fgood)}
.f-opt.sel .f-dot::after{content:"";width:11px;height:11px;border-radius:50%;background:var(--fgood)}
.f-qnav{display:flex;justify-content:space-between;margin-top:26px}
.f-meter{margin:48px auto 30px;max-width:430px;text-align:center}
.f-gauge{max-width:340px;margin:0 auto}
.f-gauge svg{width:100%;height:auto;display:block}
#needle{transform-origin:170px 170px;transition:transform 1s cubic-bezier(.3,1.4,.5,1)}
.f-riskword{font-size:2rem;font-weight:800;margin-top:-8px}
.risk-low .f-riskword,.risk-fit .f-riskword{color:var(--fgood)}
.risk-med .f-riskword,.risk-nurture .f-riskword{color:#BA7517}
.risk-high .f-riskword{color:var(--fa-shade,var(--fa))}
.f-riskcap{color:#5F6B80;font-size:.95rem}
#p-results h2{text-align:center;font-size:clamp(1.6rem,3.6vw,2.2rem);margin-bottom:8px}
.f-lead{text-align:center;color:#5F6B80;max-width:560px;margin:0 auto 34px}
.f-findings{display:grid;gap:14px;margin:0 0 34px}
.f-finding{display:flex;gap:14px;background:#fff;border:1px solid #E3E1D9;border-left:5px solid #BA7517;border-radius:12px;padding:18px 20px}
.f-finding.bad{border-left-color:var(--fa-shade,var(--fa))}
.f-finding.good{border-left-color:var(--fgood)}
.f-fi{font-size:1.3rem;line-height:1}
.f-finding b{display:block;margin-bottom:2px}
.f-finding span{font-size:.95rem;color:#5F6B80}
.f-ctawide{text-align:center;padding-bottom:64px}
.f-fcard{background:#fff;border:1px solid #E3E1D9;border-radius:14px;padding:34px 30px;box-shadow:0 6px 24px rgba(0,0,0,.06);margin:48px 0 64px}
.f-fcard h2{font-size:1.5rem;margin-bottom:6px}
.f-fsub{color:#5F6B80;margin-bottom:26px;font-size:.98rem}
.f-field{margin-bottom:18px}
.f-frow{display:grid;grid-template-columns:1fr 1fr;gap:14px}
@media(max-width:520px){.f-frow{grid-template-columns:1fr}}
.f-field label{display:block;font-weight:700;font-size:.92rem;margin-bottom:6px}
.f-field input{width:100%;font-family:inherit;font-size:1.02rem;padding:13px 14px;border:2px solid #E3E1D9;border-radius:10px;background:#fff;color:#22304A}
.f-field input:focus-visible{outline:none;border-color:var(--fgood)}
.f-consent{display:flex;gap:10px;align-items:flex-start;font-size:.88rem;color:#5F6B80;margin:8px 0 22px}
.f-consent input{margin-top:4px;width:18px;height:18px;accent-color:var(--fgood)}
.f-err{color:#B3261E;font-weight:600;margin-bottom:14px}
.f-lock{display:flex;align-items:center;justify-content:center;gap:8px;color:#5F6B80;font-size:.85rem;margin-top:16px}
.f-handoff{padding:56px 0 80px;text-align:center}
.f-hcard{background:#fff;border:1px solid #E3E1D9;border-radius:14px;padding:40px 30px;box-shadow:0 6px 24px rgba(0,0,0,.06)}
.f-bigtick{width:64px;height:64px;border-radius:50%;background:color-mix(in srgb,var(--fgood) 15%,#fff);color:var(--fgood);display:grid;place-items:center;font-size:2rem;font-weight:800;margin:0 auto 18px}
.f-hcard h2{font-size:1.6rem;margin-bottom:10px}
.f-hcard p{color:#5F6B80;max-width:480px;margin:0 auto 8px}
.f-coupon{display:inline-block;background:#FAEEDA;border:2px dashed #BA7517;color:#633806;font-weight:800;letter-spacing:1px;padding:10px 22px;border-radius:10px;margin:18px 0 26px;font-size:1.05rem}
.f-summary{margin:26px auto 0;max-width:420px;text-align:left;background:#F7F6F2;border:1px solid #E3E1D9;border-radius:12px;padding:18px 20px;font-size:.93rem}
.f-summary div{display:flex;justify-content:space-between;padding:4px 0}
.f-summary span:last-child{font-weight:700}
.f-altways{margin-top:26px;font-size:.95rem;color:#5F6B80}
.f-foot{background:var(--fp);color:rgba(255,255,255,.6);padding:34px 20px;text-align:center;font-size:.88rem}

/* ---------------------------------------------------------------- forms ----
   `[[form:key]]` and the standalone /f/<key> page for a funnel of kind 'form'.
   Everything is scoped under `.pdx-form`, because this sheet is injected onto
   ordinary site pages — see the note at the top.

   COLOURS COME FROM WHICHEVER PALETTE IS PRESENT. On a site page the
   --site-* tokens are set by the theme; on the standalone player page they are
   not, and --fp/--fa/--fgood are. Hence the nested fallbacks, ending in a
   literal so a form is never invisible: a var() that resolves to nothing makes
   the whole declaration invalid, which is how a form ends up with no border and
   white-on-white text. */
.pdx-form{
  --pdxf-ink: var(--site-ink, #22304A);
  --pdxf-muted: var(--site-muted, #5F6B80);
  --pdxf-line: var(--rule, #d7dce3);
  --pdxf-key: var(--site-primary, var(--fgood, #12325C));
  --pdxf-cta: var(--site-accent, var(--fa, #C2492B));
  /* TEXT SITTING ON THOSE TWO FILLS, and neither may be a hardcoded #fff.
     Both were, and on a light palette the result is unreadable: an embedded
     form on a site whose accent is #FF7EA0 rendered its submit label at 2.40:1
     against 6.78:1 for the theme's own on-accent colour. That is the exact
     failure --site-on-accent was introduced to site.css to fix — "the
     hardcoded #fff it replaced made three of the seven accents unusable as a
     button" — and the fix never reached this file.

     --pdxf-on-key follows site.css's own convention for text on the PRIMARY
     fill, which is --site-paper (see `.sec-dark .card h3`), not on-accent:
     on-accent pairs with the accent, and the tick is filled with the primary.

     The literal fallbacks are what keep the standalone /f/<key> player
     unchanged — that page links this stylesheet and nothing else, so no
     --site-* token is defined there and both resolve to #fff exactly as
     before. They are also required, not tidiness: a var() that resolves to
     nothing invalidates the whole declaration, which is how a form ends up
     with white-on-white text. */
  --pdxf-on-cta: var(--site-on-accent, #fff);
  --pdxf-on-key: var(--site-paper, #fff);
  color: var(--pdxf-ink);
  margin: 1.6rem 0;
  text-align: left;
}
.pdxf-form{display:grid;gap:1rem}
.pdxf-title{font-size:1.35rem;line-height:1.25;margin:0}
.pdxf-sub{color:var(--pdxf-muted);font-size:.98rem;margin:0}
.pdxf-field{display:grid;gap:6px;border:0;padding:0;margin:0}
.pdxf-field > label,.pdxf-field > legend{font-weight:700;font-size:.92rem;padding:0}
.pdxf-help{color:var(--pdxf-muted);font-size:.86rem}
.pdxf-field input[type=text],
.pdxf-field input[type=email],
.pdxf-field input[type=tel],
.pdxf-field select,
.pdxf-field textarea{
  width:100%;font-family:inherit;font-size:1rem;padding:12px 13px;
  border:2px solid var(--pdxf-line);border-radius:10px;background:#fff;color:var(--pdxf-ink);
}
.pdxf-field textarea{resize:vertical;min-height:6.5em}
.pdxf-field input:focus-visible,.pdxf-field select:focus-visible,.pdxf-field textarea:focus-visible{outline:none;border-color:var(--pdxf-key)}
.pdxf-choice{display:grid;gap:8px}
.pdxf-option{display:flex;align-items:flex-start;gap:9px;font-weight:400;font-size:.98rem;cursor:pointer}
.pdxf-option input{margin-top:5px;accent-color:var(--pdxf-key);flex:none}
.pdxf-consent{display:flex;align-items:flex-start;gap:9px;font-size:.86rem;color:var(--pdxf-muted)}
.pdxf-consent input{margin-top:4px;width:17px;height:17px;accent-color:var(--pdxf-key);flex:none}
.pdxf-consent label{cursor:pointer}
.pdxf-err{color:var(--pdxf-cta);font-weight:600;font-size:.94rem;margin:0}
.pdxf-btn{
  display:inline-block;border:0;cursor:pointer;font-family:inherit;font-size:1rem;font-weight:700;
  border-radius:10px;padding:13px 26px;background:var(--pdxf-cta);color:var(--pdxf-on-cta);
  text-decoration:none;text-align:center;justify-self:start;
}
.pdxf-btn:disabled{opacity:.6;cursor:default}
.pdxf-btn:focus-visible{outline:3px solid var(--pdxf-key);outline-offset:2px}
.pdxf-done{display:grid;gap:12px;justify-items:start}
.pdxf-done:focus{outline:none}
.pdxf-done p{margin:0;color:var(--pdxf-ink)}
.pdxf-tick{
  width:44px;height:44px;border-radius:50%;display:grid;place-items:center;
  font-size:1.4rem;font-weight:800;color:var(--pdxf-on-key);background:var(--pdxf-key);
}
/* The standalone form page reuses the player's card, whose h1 and eyebrow were
   written for a coloured hero. On a white card they need the ink colour. */
.f-eyebrow-ink{background:#F0EFE9;border-color:#DCD9CF;color:#5F6B80;margin-bottom:14px}
