/* Allied Family Health funnel — neutral clinical look: white, soft blue, teal.
   Mobile-first; every tap target is at least 56px tall. System fonts only
   (no third-party font requests from the question pages). */

:root {
  color-scheme: light;
  --bg: #f3f8fb;
  --surface: #ffffff;
  --ink: #17262f;
  --ink-soft: #4d6270;
  --line: #d6e3ea;
  --teal: #0e7c86;        /* 4.9:1 on white */
  --teal-dark: #0a5f67;
  --teal-tint: #e6f4f5;
  --blue-tint: #eaf2fb;
  --error: #b42318;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.5 var(--font);
}
a { color: var(--teal-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, .lang-toggle:focus-visible {
  outline: 3px solid #5aa9e6;
  outline-offset: 2px;
}

.shell {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 16px max(24px, env(safe-area-inset-bottom));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* header ------------------------------------------------------------ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0 12px;
}
.logo {
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--teal-dark);
}
.lang-toggle {
  min-height: 44px;
  min-width: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--teal-dark);
  font: 600 15px/1 var(--font);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.lang-toggle:hover { background: var(--teal-tint); }

.progress {
  height: 6px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0;
  background: var(--teal);
  border-radius: 999px;
  transition: width 0.25s ease;
}
.step-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
}
.step-count { font-size: 14px; color: var(--ink-soft); }
.back {
  min-height: 44px;
  padding: 0 8px 0 0;
  border: 0;
  background: none;
  color: var(--teal-dark);
  font: 600 16px/1 var(--font);
  cursor: pointer;
}

/* card + screen ---------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px 20px;
  box-shadow: 0 1px 2px rgba(23, 38, 47, 0.04), 0 8px 24px rgba(23, 38, 47, 0.06);
}
.screen { display: flex; flex-direction: column; gap: 14px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 6px; }
.kicker {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--teal);
}
.q {
  margin: 0;
  font-size: clamp(23px, 6vw, 28px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.q:focus { outline: none; }
.help { margin: 4px 0 0; color: var(--ink-soft); font-size: 16px; }

/* choices --------------------------------------------------------------------- */
.choices { display: grid; gap: 10px; margin-top: 14px; }
.choices-dense { gap: 8px; }
@media (min-width: 480px) {
  .choices-dense { grid-template-columns: 1fr 1fr; }
}
.choice { position: relative; display: block; cursor: pointer; }
.choice input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.choice-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 60px;
  padding: 12px 16px 12px 48px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}
.choice-body::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  border: 2px solid #9fb3bf;
  border-radius: 50%;
  background: var(--surface);
}
.choice:hover .choice-body { border-color: #9fc9cd; background: var(--blue-tint); }
.choice input:checked + .choice-body {
  border-color: var(--teal);
  background: var(--teal-tint);
}
.choice input:checked + .choice-body::before {
  border-color: var(--teal);
  background: radial-gradient(circle, var(--teal) 0 5px, var(--surface) 6px);
}
.choice input:focus-visible + .choice-body { outline: 3px solid #5aa9e6; outline-offset: 2px; }
.choice-label { font-weight: 600; font-size: 17px; }
.choice-sub { font-size: 13.5px; color: var(--ink-soft); margin-top: 2px; }

/* fields ------------------------------------------------------------------------ */
.field-row { display: grid; gap: 14px; }
@media (min-width: 480px) { .field-row { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 15px; }
.field input {
  min-height: 56px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  font: 18px/1.2 var(--font);
  color: var(--ink);
  background: var(--surface);
  width: 100%;
}
.field input:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px rgba(14, 124, 134, 0.18); }
.field input[aria-invalid="true"] { border-color: var(--error); }

/* consent ---------------------------------------------------------------------------- */
.consent {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
  padding: 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}
.consent:has(input:checked) { border-color: var(--teal); background: var(--teal-tint); }
.consent input { width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--teal); cursor: pointer; }
.consent-text { font-size: 13.5px; line-height: 1.45; color: var(--ink-soft); cursor: pointer; overflow-wrap: anywhere; }
.consent-intro { margin-top: 8px; font-size: 15px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* buttons + errors -------------------------------------------------------------------- */
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  width: 100%;
  margin-top: 8px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius);
  background: var(--teal);
  color: #fff;
  font: 700 18px/1 var(--font);
  text-decoration: none;
  cursor: pointer;
}
.cta:hover { background: var(--teal-dark); }
.cta[disabled] { opacity: 0.7; cursor: progress; }
.cta-secondary { background: var(--surface); color: var(--teal-dark); border: 1.5px solid var(--teal); }
.cta-secondary:hover { background: var(--teal-tint); }
.error { margin: 0; color: var(--error); font-size: 15px; font-weight: 600; }
.error[hidden] { display: none; }

/* thank-you ---------------------------------------------------------------------------- */
.thanks { align-items: center; text-align: center; padding: 12px 0; }
.check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--teal-tint);
  color: var(--teal);
  font-size: 34px;
  display: grid;
  place-items: center;
}

/* footer ------------------------------------------------------------------------------------ */
.foot {
  margin-top: auto;
  padding: 24px 4px 8px;
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.foot p { margin: 4px 0; }
.emergency { font-weight: 600; color: var(--ink); }
.powered { margin-top: 10px !important; font-size: 12px; opacity: 0.8; }
.noscript { padding: 32px 0; font-size: 18px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* legal pages (/privacy/, /terms/, /es/privacidad/, /es/terminos/) ------------------------- */
.shell-legal { max-width: 760px; }
.legal { padding: 28px 22px; }
.legal h1 { margin: 0 0 6px; font-size: clamp(26px, 6vw, 32px); line-height: 1.2; letter-spacing: -0.01em; }
.legal h2 { margin: 30px 0 8px; font-size: 20px; line-height: 1.3; color: var(--teal-dark); }
.legal h3 { margin: 18px 0 6px; font-size: 17px; }
.legal p, .legal li { font-size: 16px; line-height: 1.6; }
.legal p { margin: 8px 0; }
.legal ul { margin: 8px 0; padding-left: 22px; }
.legal li { margin: 4px 0; }
.legal .meta { margin: 0 0 14px; color: var(--ink-soft); font-size: 15px; }
.legal .draft-note {
  margin: 0 0 18px;
  padding: 10px 14px;
  border: 1px dashed #c9a227;
  border-radius: 10px;
  background: #fff8e1;
  color: #5c4500;
  font-size: 14.5px;
}
.legal .callout {
  margin: 12px 0;
  padding: 12px 16px;
  border-left: 4px solid var(--teal);
  border-radius: 6px;
  background: var(--teal-tint);
  font-weight: 600;
}
.legal .temp { background: #fff1b8; padding: 0 3px; border-radius: 3px; font-weight: 600; }
.legal address { font-style: normal; line-height: 1.6; margin: 8px 0; }
.back-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: none; }
