/* FormsPal funnel — quiz shell styles.
   Standalone page (no site header/footer). Tokens imported via <link> in quiz.html. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.quiz-body {
  margin: 0;
  font-family: var(--fp-font);
  font-size: var(--fp-body);
  color: var(--fp-text);
  background: var(--fp-white);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { color: var(--fp-ink); line-height: 1.15; margin: 0 0 .4em; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 1em; color: var(--fp-muted); }
a { color: var(--fp-green); text-decoration: none; }

/* ── Page layout ─────────────────────────────────────────────────────── */
.quiz-page {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* ── Header ──────────────────────────────────────────────────────────── */
.quiz-header {
  position: sticky;
  top: 0; z-index: 20;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--fp-line);
}
.quiz-header__inner {
  display: flex;
  align-items: center;
  height: 56px;
  padding-inline: clamp(14px, 3vw, 32px);
  gap: 14px;
}
.quiz-back {
  width: 36px; height: 36px;
  border: 1.5px solid var(--fp-line);
  border-radius: 50%;
  background: none; cursor: pointer;
  font-size: 18px; color: var(--fp-ink);
  display: none; align-items: center; justify-content: center;
  transition: border-color .15s;
}
.quiz-back.visible { display: flex; }
.quiz-back:hover { border-color: var(--fp-ink); }
/* height/width MUST be set here — the img carries intrinsic 1961×462 attrs for CLS, and
   without CSS the width attribute wins (the giant-logo regression, 2026-07-11). */
.quiz-logo img { display: block; height: 22px; width: auto; }
.quiz-progress-label {
  margin-left: auto;
  font-size: 13px; font-weight: 600; color: var(--fp-muted);
}
.quiz-progress-track {
  height: 3px;
  background: var(--fp-line);
}
.quiz-progress-fill {
  height: 100%;
  background: var(--fp-green);
  transition: width .3s ease;
  width: 0%;
}

/* ── Step content ────────────────────────────────────────────────────── */
.quiz-main {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: clamp(28px, 5vw, 60px) clamp(16px, 4vw, 40px) 100px;
}
.quiz-step {
  width: 100%;
  max-width: 540px;
}
.quiz-step h2 {
  font-size: clamp(20px, 3.5vw, 28px);
  margin-bottom: 8px;
}
.step-sub { color: var(--fp-muted); margin-bottom: 20px; }

/* ── Action bar (sticky bottom) ──────────────────────────────────────── */
.quiz-action {
  position: sticky;
  bottom: 0;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(4px);
  border-top: 1px solid var(--fp-line);
  padding: 14px clamp(16px, 4vw, 40px);
  z-index: 10;
}
.quiz-action__inner {
  max-width: 540px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* Guardrail disclaimer — rides the sticky bar so it's visible on every step (P3). */
.quiz-disclaimer {
  max-width: 540px;
  margin: 8px auto 0;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--fp-muted);
}
/* Start-over affordance — link-styled, deliberately quiet (Maria QA 2026-07-17) */
.quiz-restart {
  background: none; border: 0; padding: 0; margin-left: 8px;
  font: inherit; color: var(--fp-muted);
  text-decoration: underline; cursor: pointer;
}
.quiz-restart:hover { color: var(--fp-ink); }

/* ── Shared button styles (quiz-scoped, mirrors base.css but self-contained) ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; cursor: pointer; font-weight: 600; font-size: 15px;
  padding: 12px 22px; border-radius: var(--fp-radius);
  border: 1.5px solid transparent; transition: filter .15s, background .15s;
  text-decoration: none; font-family: var(--fp-font);
}
.btn-primary {
  background: var(--fp-orange); color: #fff; border-color: var(--fp-orange);
}
.btn-primary:hover { background: var(--fp-orange-dark); border-color: var(--fp-orange-dark); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
/* Same look as :disabled, but the button stays focusable and clickable so the click
   still surfaces the "please agree" error. Used on the consent step. */
.btn-primary.is-inactive { opacity: .45; }
.btn-block { width: 100%; }

.skip-link {
  background: none; border: none; padding: 8px;
  font-size: 13.5px; color: var(--fp-muted); cursor: pointer;
  text-align: center; font-family: var(--fp-font);
}
.skip-link:hover { color: var(--fp-ink); }

/* ── Intro step ──────────────────────────────────────────────────────── */
.intro-steps { display: flex; flex-direction: column; gap: 18px; margin: 24px 0; }
.intro-step-row {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 16px; border: 1px solid var(--fp-line); border-radius: var(--fp-radius);
  background: var(--fp-cream);
}
.intro-step-row .n {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%; background: var(--fp-green); color: #fff;
  font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.intro-step-row h4 { font-size: 15px; margin: 0 0 4px; color: var(--fp-ink); }
.intro-step-row p { font-size: 13.5px; margin: 0; color: var(--fp-muted); }

/* ── Radio option cards ───────────────────────────────────────────────── */
.option-list { display: flex; flex-direction: column; gap: 10px; margin: 20px 0; }
.option-card {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border: 1.5px solid var(--fp-line); border-radius: var(--fp-radius);
  cursor: pointer; font-size: 15px; font-weight: 500; color: var(--fp-text);
  transition: border-color .15s, background .12s;
}
/* P25: the real radio input is visually hidden but stays keyboard-focusable; the card shows
   focus via :focus-within so Tab/arrow users can see where they are. */
.option-card .option-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.option-card:focus-within { border-color: var(--fp-green); box-shadow: 0 0 0 3px rgba(36,133,103,.28); }
.option-card:hover { border-color: var(--fp-green); }
.option-card.selected {
  border-color: var(--fp-green);
  background: var(--fp-green-light);
  color: var(--fp-ink);
}
.option-card .dot {
  width: 18px; height: 18px;
  border-radius: 50%; border: 1.5px solid var(--fp-line);
  flex-shrink: 0;
  background: #fff;
  transition: border-color .15s, background .12s;
}
.option-card.selected .dot { border-color: var(--fp-green); background: var(--fp-green); }

/* ── Chip grid (reason step) ─────────────────────────────────────────── */
.chip-list { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.chip {
  padding: 10px 18px;
  border: 1.5px solid var(--fp-line); border-radius: var(--fp-radius-pill);
  background: #fff; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--fp-text);
  transition: border-color .15s, background .12s;
  font-family: var(--fp-font);
}
.chip:hover { border-color: var(--fp-green); }
.chip.selected { border-color: var(--fp-green); background: var(--fp-green-light); color: var(--fp-ink); font-weight: 600; }

/* ── Form fields ─────────────────────────────────────────────────────── */
.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-field label { font-weight: 600; font-size: 14px; color: var(--fp-text); }
.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="password"],
.form-field input[type="tel"],
.form-field select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--fp-line); border-radius: var(--fp-radius);
  font-size: 15px; font-family: var(--fp-font); color: var(--fp-text); background: #fff;
  transition: border-color .15s;
}
.form-field input:focus,
.form-field select:focus { outline: none; border-color: var(--fp-green); }
.form-field .err { display: none; font-size: 12.5px; color: #d94040; }
.form-field.invalid input,
.form-field.invalid select { border-color: #d94040; }
.form-field.invalid .err { display: block; }

/* State dropdown */
.form-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7785' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}

/* County combobox */
.combo { position: relative; }
.combo-input {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--fp-line); border-radius: var(--fp-radius);
  font-size: 15px; font-family: var(--fp-font); color: var(--fp-text); background: #fff;
}
.combo-input:focus { outline: none; border-color: var(--fp-green); }
.combo-list {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  background: #fff; border: 1.5px solid var(--fp-line); border-radius: var(--fp-radius);
  max-height: 240px; overflow-y: auto; z-index: 50;
  box-shadow: var(--fp-shadow-lg);
}
.combo-opt {
  padding: 10px 14px; font-size: 14.5px; cursor: pointer; color: var(--fp-text);
}
.combo-opt:hover { background: var(--fp-green-light); }
.combo-empty { padding: 10px 14px; font-size: 14px; color: var(--fp-muted); }
.county-err { display: none; font-size: 12.5px; color: #d94040; margin-top: 4px; }
.county-err.show { display: block; }

/* ── Quiz tip ────────────────────────────────────────────────────────── */
.quiz-tip {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--fp-radius);
  background: var(--fp-green-light); border: 1px solid rgba(36,133,103,.2);
  font-size: 13.5px; color: var(--fp-text); margin-top: 20px;
}
.quiz-tip .i {
  flex-shrink: 0;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--fp-green); color: #fff;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ── Inline hard-gate warning ────────────────────────────────────────── */
/* Immediate honest warning, deferred verdict (2026-08-21): shown under the options the moment
   a disqualifying answer is picked. Same amber language as the congrats screen's .warn-card so
   it reads as the same system speaking, one step earlier. */
.gate-warn {
  margin-top: 20px; padding: 14px 16px; text-align: left;
  border: 1px solid #e07c30; border-radius: var(--fp-radius);
  background: #fff8ed;
}
.gate-warn__head {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; margin-bottom: 8px; color: var(--fp-text);
}
.gate-warn__i {
  flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%;
  background: #e07c30; color: #fff; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.gate-warn p { font-size: 13.5px; line-height: 1.6; color: var(--fp-text); margin: 0 0 8px; }
.gate-warn .gate-warn__foot { color: var(--fp-muted); }
.gate-warn .gate-note { margin: 6px 0 0; }

/* ── Qualify-to-preview transfer ─────────────────────────────────────── */
.transfer-spin {
  width: 34px; height: 34px; margin: 22px auto 14px;
  border: 3px solid var(--fp-green-light); border-top-color: var(--fp-green);
  border-radius: 50%;
  animation: fp-transfer-spin .9s linear infinite;
}
@keyframes fp-transfer-spin { to { transform: rotate(360deg); } }

/* ── Congrats / blocked ──────────────────────────────────────────────── */
.congrats { text-align: center; }
.badge {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--fp-green); color: #fff;
  font-size: 26px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}
.badge.warn { background: #e07c30; }
.congrats .card {
  border: 1px solid var(--fp-line); border-radius: var(--fp-radius);
  padding: 16px; margin: 18px 0; text-align: left;
  font-size: 15px; color: var(--fp-text);
}
.warn-card { background: #fff8ed; border-color: #e07c30 !important; }
.gate-note { font-size: 12.5px; color: var(--fp-muted); text-align: left; margin-top: 10px; }
.consent-row {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13.5px; color: var(--fp-text); cursor: pointer;
  margin: 16px 0 4px; text-align: left;
}
.consent-row a { color: var(--fp-green); }
.consent-err { display: none; font-size: 12.5px; color: #d94040; text-align: left; }
.consent-err.show { display: block; }
.notq .badge { background: #e07c30; }

/* ── Account step ─────────────────────────────────────────────────────── */
/* (reuses .form-field) */

/* ── Phone step ───────────────────────────────────────────────────────── */
/* (reuses .form-field + .consent-row) */

/* ── Summary ──────────────────────────────────────────────────────────── */
.summary-list { border: 1px solid var(--fp-line); border-radius: var(--fp-radius); overflow: hidden; margin-top: 20px; }
.summary-row { display: flex; padding: 11px 16px; border-bottom: 1px solid var(--fp-line); font-size: 14.5px; }
.summary-row:last-child { border-bottom: none; }
.summary-row .k { color: var(--fp-muted); min-width: 160px; flex-shrink: 0; }
.summary-row .v { color: var(--fp-ink); font-weight: 500; flex: 1; }
/* Inline editing on the review step: correct an answer in place instead of starting over. */
.summary-row .summary-edit {
  margin-left: auto; flex-shrink: 0; background: none; border: none; padding: 0 0 0 12px;
  color: var(--fp-green); font: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.summary-row .summary-edit:hover { color: var(--fp-green-dark); }
.summary-row.editing { flex-wrap: wrap; align-items: center; gap: 8px; }
.summary-input {
  font: inherit; font-size: 14px; padding: 7px 10px; border: 1px solid var(--fp-line);
  border-radius: 8px; min-width: 0; flex: 1 1 140px; max-width: 100%;
}
.summary-input:focus { outline: 2px solid var(--fp-green); outline-offset: 1px; }
.summary-save {
  background: var(--fp-green); color: #fff; border: none; border-radius: 999px;
  padding: 7px 16px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  flex-shrink: 0;
}
.summary-save:hover { background: var(--fp-green-dark); }
.summary-hint { color: var(--fp-muted); font-size: 13.5px; margin-top: 12px; text-align: center; }
@media (max-width: 560px) {
  .summary-row .k { min-width: 120px; }
  .summary-row.editing .summary-input { flex-basis: 100%; }
}

/* ── Nurture thanks (blocked lead) ───────────────────────────────────── */
/* reuses .congrats */

/* ── P39: iOS focus auto-zoom guard ──────────────────────────────────── */
/* Inputs under 16px make iOS Safari zoom-jump the viewport on focus — on the
   lead-capture (email/password/phone) steps that's the highest-stakes moment
   of the funnel. Never suppress zoom via maximum-scale; just meet the 16px bar. */
@media (max-width: 760px) {
  .form-field input[type="text"],
  .form-field input[type="email"],
  .form-field input[type="password"],
  .form-field input[type="tel"],
  .combo-input { font-size: 16px; }
}

/* P27: keyboard-highlighted combobox option (ArrowUp/Down + Enter). */
.combo-opt.is-active { background: var(--fp-green-light); color: var(--fp-green-dark); }
