/* ============================================================
   cmn_2026 funnel form stylesheet — pure vanilla CSS.
   Scoped to the funnel form (#funnel-view); the homepage uses home.css.
   Brand tokens (--brand / --brand-accent) are set per-site via an inline
   <style> in 1.tpl (from siteConfig); style.css can override them.
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100% }
body { margin: 0; font-family: var(--font); font-size: 1rem; line-height: 1.5; font-weight: 300;
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased }
h1, h2, h3, h4, p, ul, figure { margin: 0 }
h1, h2, h3, h4 { font-weight: 400 }
img { max-width: 100%; height: auto; display: block }
a { color: var(--brand); text-decoration: none }
a:hover { text-decoration: underline }
button { font: inherit; cursor: pointer; border: 0; background: none }
input, select, textarea { font: inherit }
ul { list-style: none; padding: 0 }
[hidden] { display: none !important }

/* ---------- Design tokens ---------- */
:root {
  --brand: #1f7a5a;
  --brand-accent: #155c43;
  --brand-soft: rgba(31, 122, 90, 0.08);
  --success: #2e9e5b;
  --danger: #c0392b;
  --text: #1c2530;
  --text-muted: #6b7783;
  --bg: #ffffff;
  --surface: #ffffff;
  --border: #d9e0e6;
  --border-strong: #b7c2cc;
  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 0.75rem;
  --radius-sm: 0.5rem;
  --shadow-sm: 0 0.0625rem 0.125rem rgba(16, 30, 45, 0.08);
  --field-h: 3.25rem;
  --wrap: 34rem;
}

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 1rem }

/* ---------- Header ---------- */
.funnel-header { background: var(--surface); border-bottom: 1px solid var(--border) }
.funnel-header__logo { padding: 0.6rem 0; text-align: center }
.funnel-header__logo img { display: inline-block; max-height: 2rem }

/* ---------- Funnel shell ---------- */
.funnel-main { padding: 1.5rem 0 }
@media (min-width: 48rem) { .funnel-main { padding-top: 2.5rem } }
.step { display: none }
.step.is-active { display: block; animation: step-in .25s ease }
@keyframes step-in { from { opacity: 0; transform: translateY(0.5rem) } to { opacity: 1; transform: none } }
.step__title { font-size: 1.25rem; font-weight: 700; text-align: center; margin-bottom: 1rem }
.step__title small { display: block; font-size: 0.95rem; font-weight: 500;
  color: var(--text-muted); margin-top: 0.35rem }
.step__body { padding: 0.5rem 0 0 }

/* ---------- Progress meter ---------- */
.progress { max-width: 32%; margin: 0 auto 1.5rem }
.progress__track { height: 0.3rem; background: var(--border); border-radius: 999px; overflow: hidden }
.progress__bar { display: block; height: 100%; width: 0; background: var(--brand);
  border-radius: 999px; transition: width .3s ease }

/* ---------- Hint callout ---------- */
.hint { margin: 0 0 1rem; font-size: 0.9rem; color: var(--text-muted); font-style: italic;
  text-align: center }

/* ---------- Fields ---------- */
.field { margin-bottom: 1rem }
.field__label { display: block; margin-bottom: 0.375rem; font-weight: 400; font-size: 0.85rem; color: var(--text-muted) }
.input, .select { width: 100%; height: var(--field-h); padding: 0 0.875rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm); outline: none; transition: border-color .15s, box-shadow .15s }
.select { appearance: none; padding-right: 2.25rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 1.1rem) center, calc(100% - 0.75rem) center;
  background-size: 0.35rem 0.35rem, 0.35rem 0.35rem; background-repeat: no-repeat }
.input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft) }
.field.is-invalid .input, .field.is-invalid .select { border-color: var(--danger) }
.field__error { display: block; margin-top: 0.375rem; font-size: 0.85rem; color: var(--danger) }
.choices .field__error, .choices--two .field__error { grid-column: 1 / -1; margin-top: 0 }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem }
.field-row .field { margin-bottom: 1rem }

/* ---------- Choice cards (radios) ---------- */
.choices { display: flex; flex-direction: column; gap: 0.625rem; margin: 1rem 0 }
.choices--two { display: grid; grid-template-columns: 1fr 1fr; gap: 0.625rem }
.choice { position: relative; display: block; cursor: pointer }
.choice input[type="radio"] { position: absolute; opacity: 0; inset: 0; margin: 0 }
.choice__label { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  min-height: var(--field-h); padding: 0.85rem 1.15rem; font-weight: 600; background: #f2f4f6;
  border: 0; border-radius: var(--radius); transition: background .15s, color .15s }
.choice__label small { font-weight: 500; color: var(--text-muted) }
.choice:hover .choice__label { background: #e8ebee }
.choice input[type="radio"]:checked + .choice__label { background: var(--brand-soft);
  color: var(--brand-accent) }
.choice input[type="radio"]:focus-visible + .choice__label { outline: 2px solid var(--brand);
  outline-offset: 2px }

/* ---------- Buttons + nav ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%; min-height: var(--field-h); padding: 0 1.25rem; border-radius: var(--radius-sm);
  font-weight: 700; line-height: 1.1; text-align: center; transition: background .15s, transform .05s }
.btn:hover { text-decoration: none }
.btn:active { transform: translateY(1px) }
.btn--primary { background: var(--brand); color: #fff }
.btn--primary:hover { background: var(--brand-accent); color: #fff }
.btn--back { background: #eef1f4; color: var(--text-muted); border: 0; padding: 0 }
.btn--back:hover { background: #e3e7eb; color: var(--text) }
.nav { display: flex; gap: 1.25rem; margin-top: 2.25rem }
.nav .btn { min-height: 3.75rem }
.nav [data-nav="back"] { flex: 0 0 20% }
.nav [data-nav="next"] { flex: 1 1 auto }

/* ---------- Consent / disclosure text ---------- */
.consent { margin-top: 0.75rem; font-size: 0.8rem; color: var(--text-muted) }
.consent a { text-decoration: underline }
.consent.text-center { margin-top: 2rem; font-size: 0.68rem; line-height: 1.45; color: var(--text-muted); opacity: .85 }

/* ---------- Short footer (legal links) ---------- */
.funnel-foot { padding: 4.5rem 1rem 3rem; text-align: center }
.funnel-foot__logo { display: block; height: 1.4rem; width: auto; margin: 0 auto 1rem;
  filter: brightness(0); opacity: 0.3 }
.funnel-foot__links { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; justify-content: center;
  max-width: var(--wrap); margin-inline: auto }
.funnel-foot__links a { color: var(--text-muted); font-size: 0.72rem; text-decoration: none }
.funnel-foot__links a:hover { color: var(--text-muted); text-decoration: underline }
.funnel-foot__legal { max-width: 44rem; margin: 0 auto 2rem }

/* ---------- Result page (r.tpl) ---------- */
.container { width: 100%; max-width: 40rem; margin-inline: auto; padding-inline: 1rem }
.redirecting-wrapper { text-align: center; padding: 2rem 0 }
.decline-main { max-width: 40rem; margin: 2rem auto; text-align: center }
.decline-eyebrow { margin: 0 0 0.75rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--brand) }
.decline-title { margin: 2rem 0; font-size: clamp(1.5rem, 4vw, 2.1rem); font-weight: 700; line-height: 1.12 }
.decline-lead { margin: 0 0 1rem; font-size: 1.05rem; color: var(--text) }
.decline-note { margin: 0 0 1.5rem; font-size: 0.9rem; color: var(--text-muted) }
.btn-decline { width: auto; display: inline-flex; padding: 0 2rem; margin: 1.75rem 0 }
.decline-links { display: grid; gap: 1.5rem; margin-top: 2.5rem; text-align: center }
.decline-links h2 { margin: 0 0 0.25rem; font-size: 0.95rem; font-weight: 700 }
.decline-links p { margin: 0; font-size: 0.9rem; color: var(--text-muted) }
.decline-links a { color: var(--brand); text-decoration: underline }
.funnel-foot__legal p { margin-bottom: 0.75rem; color: var(--text-muted); font-size: 0.68rem; line-height: 1.5; text-align: left }
.funnel-foot__legal p:last-child { text-align: center }

/* ---------- Processing overlay ---------- */
.processing-overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center;
  justify-content: center; text-align: center; padding: 2rem;
  background: color-mix(in srgb, var(--surface) 96%, transparent) }
.processing__spinner { width: 3rem; height: 3rem; margin: 0 auto 1.25rem; border-radius: 50%;
  border: 4px solid var(--border); border-top-color: var(--brand); animation: spin .8s linear infinite }
@keyframes spin { to { transform: rotate(360deg) } }
.processing__title { font-size: 1.15rem; font-weight: 700; color: var(--text) }
.processing__sub { margin-top: 0.4rem; font-size: 0.85rem; color: var(--text-muted) }

/* ---------- Utilities ---------- */
.text-center { text-align: center }
.muted { color: var(--text-muted) }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0 }
