/* Unique Health and Wellness Clinic - initial client record form (/intake).
   Built from the clinic's own paper "Initial Client Record Form". Tokens only,
   the two self-hosted faces only, no third-party request of any kind.

   Two rules shape this file:
   - This collects SPECIAL CATEGORY health data. The page says so, in plain
     words, above the first field - docs/DATA.md.
   - Nothing changes size because its own content changed state: the submit
     button reserves its label width while the spinner runs, and revealed
     blocks animate in without shifting what sits above them. */

.intake-page .page-head .lede { max-width: none; }
.intake-section { padding-top: var(--sp-5); }
/* The form spans the site's own column (.wrap, 1160px) - operator's call 2026-09-03;
   the field grid stays two-up, the conditions go four-up at the full width. */

/* ---------- the "where this goes" card. Deliberately the first thing read. ---------- */
.privacy-card {
  display: flex; gap: 14px; align-items: flex-start;
  background: #E4EAE7; border-left: 3px solid var(--ink-2);
  border-radius: 8px; padding: 18px 20px; margin-bottom: var(--sp-4);
}
.privacy-card .pc-ico { flex: none; color: var(--ink-2); margin-top: 2px; }
.privacy-card h2 { font-size: var(--step-1); margin-bottom: 4px; }
.privacy-card p { font-size: 15px; color: var(--ink-2); }

/* ---------- alerts ---------- */
.intake-alert {
  display: flex; gap: 12px; align-items: flex-start;
  border-radius: 8px; padding: 16px 18px; margin-bottom: var(--sp-4); font-size: 15px;
}
.intake-alert svg { flex: none; margin-top: 2px; }
.intake-alert-warn { background: #F6EDE7; border-left: 3px solid #8A5A3B; color: #6E4529; }
.intake-alert-warn a { color: #6E4529; font-weight: 700; }

.i-alert { border-radius: 8px; padding: 13px 16px; font-size: 15px; font-weight: 600; }
.i-alert-err { background: #F7E6E4; border-left: 3px solid var(--accent); color: #8A2620; margin-bottom: var(--sp-2); }

.req-key { font-size: 13.5px; color: var(--ink-3); margin-bottom: var(--sp-3); }
.req-star { color: var(--accent); font-weight: 700; }

/* ---------- sections ---------- */
.i-sec {
  border: 1px solid #E7E3DC; border-radius: 12px; background: #fff;
  padding: var(--sp-4); margin: 0 0 var(--sp-3);
}
.i-sec legend {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-display); font-weight: 700; font-size: var(--step-2);
  color: var(--ink); padding: 0 8px; margin-left: -8px;
}
.i-num {
  width: 38px; height: 38px; flex: none; border-radius: 10px;
  background: #E4EAE7; color: var(--ink-2); display: grid; place-items: center;
}

/* Sections fade up as they come into view. Enhancement only: without JS the
   .in class never lands, so the rule below keeps everything visible. */
html.js .i-sec { opacity: 0; transform: translateY(14px); }
html.js .i-sec.in { animation: sec-rise .5s cubic-bezier(.22,.61,.36,1) forwards; }
@keyframes sec-rise { to { opacity: 1; transform: none; } }

/* ---------- fields ---------- */
.i-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3) var(--sp-3); margin-top: var(--sp-3); }
.f-wide { grid-column: 1 / -1; }
.f { display: grid; gap: 6px; align-content: start; }
.f-lab { font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.f-hint { font-size: 13px; color: var(--ink-3); }

.intake-form input[type=text],
.intake-form input[type=tel],
.intake-form input[type=email],
.intake-form input[type=date],
.intake-form textarea {
  font-family: var(--font-body); font-size: 15px; padding: 12px;
  border: 1px solid #CFC9BF; border-radius: 6px; background: #fff; color: var(--body);
  width: 100%; -webkit-appearance: none; appearance: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.intake-form textarea { resize: vertical; min-height: 84px; line-height: 1.55; }
.intake-form input:hover, .intake-form textarea:hover { border-color: var(--ink-3); }
.intake-form input:focus-visible, .intake-form textarea:focus-visible {
  outline: none; border-color: var(--ink-2); box-shadow: 0 0 0 3px rgba(62,90,82,.18);
}
.intake-form input.err, .intake-form textarea.err {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(176,51,44,.14);
}
.sig-input { font-size: 18px; letter-spacing: .01em; }
.date-static {
  font-size: 15px; font-weight: 700; color: var(--ink); padding: 12px 0 0;
  font-variant-numeric: tabular-nums;
}

.f-err { font-size: 13px; font-weight: 700; color: var(--accent); display: flex; gap: 6px; align-items: center; }
html.js .f-err:not([hidden]) { animation: grow .22s ease; }
@keyframes grow { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- yes / no ---------- */
.q { padding: var(--sp-3) 0; border-top: 1px solid #EFECE6; }
.i-sec .q:first-of-type { border-top: 0; padding-top: var(--sp-3); }
.q-lab { font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.q-hint { font-size: 13.5px; color: var(--ink-3); margin-bottom: 12px; }
.yn { display: flex; gap: 10px; }
.yn-o { position: relative; }
.yn-o input { position: absolute; opacity: 0; width: 0; height: 0; }
.yn-o span {
  display: grid; place-items: center; min-width: 92px; min-height: 48px; padding: 0 20px;
  border: 1.5px solid #CFC9BF; border-radius: 8px; background: #fff;
  font-weight: 700; font-size: 15px; color: var(--ink-2); cursor: pointer;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}
.yn-o:hover span { border-color: var(--ink-3); }
.yn-o input:checked + span { border-color: var(--ink-2); background: var(--ink-2); color: #fff; }
.yn-o input:focus-visible + span { outline: 3px solid var(--ink-2); outline-offset: 2px; }
.yn.err span { border-color: var(--accent); }

/* ---------- conditions grid ---------- */
.cond-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin: var(--sp-3) 0 var(--sp-3);
}
.cond {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid #E7E3DC; border-radius: 8px; padding: 11px 12px;
  background: #FCFBF9; cursor: pointer; font-size: 14px; line-height: 1.35;
  color: var(--body); transition: border-color .16s ease, background .16s ease;
}
.cond:hover { border-color: var(--ink-3); background: #fff; }
.cond input { position: absolute; opacity: 0; width: 0; height: 0; }
.cond .chk-box { margin-top: 1px; }
.cond:has(input:checked) { border-color: var(--ink-2); background: #E9EFEC; }
.cond input:focus-visible ~ .cond-t { text-decoration: underline; }
.cond:has(input:focus-visible) { outline: 3px solid var(--ink-2); outline-offset: 2px; }

/* ---------- checkboxes ---------- */
.chk { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.chk > input { position: absolute; opacity: 0; width: 0; height: 0; }
.chk-box {
  flex: none; width: 22px; height: 22px; border-radius: 5px; margin-top: 1px;
  border: 1.5px solid #B9B2A6; background: #fff; display: grid; place-items: center;
  color: #fff; transition: background .16s ease, border-color .16s ease;
}
.chk-box svg { width: 14px; height: 14px; opacity: 0; transform: scale(.6); transition: opacity .16s ease, transform .16s cubic-bezier(.3,1.4,.5,1); }
.chk > input:checked + .chk-box, .cond input:checked + .chk-box { background: var(--ink-2); border-color: var(--ink-2); }
.chk > input:checked + .chk-box svg, .cond input:checked + .chk-box svg { opacity: 1; transform: none; }
.chk > input:focus-visible + .chk-box { outline: 3px solid var(--ink-2); outline-offset: 2px; }
.chk-t { font-size: 14.5px; line-height: 1.55; }
.chk-optout > input:checked + .chk-box { background: var(--accent); border-color: var(--accent); }

.cond-count { font-variant-numeric: tabular-nums; }

/* ---------- consent + declaration ---------- */
.consent-box, .declare-box {
  border-radius: 10px; padding: 18px 20px; margin-top: var(--sp-3);
}
.consent-box { background: #FAF7F3; border: 1px solid #E7E3DC; }
.consent-box > p { font-size: 14.5px; color: var(--ink-2); margin-bottom: 14px; }
.declare-box { background: #E4EAE7; }
.consent-note {
  display: flex; gap: 8px; align-items: flex-start; margin-top: 12px;
  font-size: 13.5px; color: #6E4529; background: #F6EDE7; border-radius: 6px; padding: 10px 12px;
}
.consent-note svg { flex: none; margin-top: 2px; }

/* revealed follow-ups */
.reveal { margin-top: var(--sp-2); }
html.js .reveal:not([hidden]) { animation: grow .26s ease; }

.sign-grid { align-items: start; }

/* ---------- honeypot ---------- */
.i-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- submit ---------- */
.i-submit { margin-top: var(--sp-4); }
.i-send { min-width: 232px; position: relative; }
/* The label keeps its box while the spinner runs - the button never resizes. */
.i-send .i-send-t { transition: opacity .14s ease; }
.i-send .i-spin {
  position: absolute; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff;
  opacity: 0; animation: i-spin 0.7s linear infinite;
}
.i-send.busy { pointer-events: none; }
.i-send.busy .i-send-t { opacity: 0; }
.i-send.busy .i-spin { opacity: 1; }
@keyframes i-spin { to { transform: rotate(360deg); } }
.i-submit-note { font-size: 13.5px; color: var(--ink-3); margin-top: 12px; }

/* ---------- done ---------- */
.intake-done { text-align: center; padding: var(--sp-6) var(--sp-3); }
.intake-done:focus { outline: none; }
.intake-done h2 { font-size: var(--step-3); margin-bottom: 12px; }
.intake-done p { margin: 0 auto; color: var(--ink-2); }
.done-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: var(--sp-4); }
.done-ring { width: 76px; height: 76px; margin: 0 auto var(--sp-3); }
.done-ring svg { width: 100%; height: 100%; fill: none; stroke: var(--ink-2); }
.dr-c { stroke-width: 2; stroke-dasharray: 151; stroke-dashoffset: 151; animation: dr-draw .5s ease forwards; }
.dr-t { stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke: var(--accent); stroke-dasharray: 36; stroke-dashoffset: 36; animation: dr-draw .3s ease .42s forwards; }
@keyframes dr-draw { to { stroke-dashoffset: 0; } }

/* ---------- mobile ---------- */
@media (max-width: 899.98px) {
  .intake-section { padding-top: var(--sp-4); }
  .i-sec { padding: var(--sp-3) var(--sp-3) var(--sp-4); border-radius: 10px; }
  .i-sec legend { font-size: var(--step-1); gap: 10px; }
  .i-num { width: 32px; height: 32px; border-radius: 8px; }
  .i-grid { grid-template-columns: 1fr; gap: var(--sp-3); }
  .cond-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  /* 16px stops iOS zooming the field on focus */
  .intake-form input[type=text],
  .intake-form input[type=tel],
  .intake-form input[type=email],
  .intake-form input[type=date],
  .intake-form textarea { font-size: 16px; padding: 13px; border-radius: 8px; }
  .i-send { width: 100%; }
  .yn-o span { min-width: 0; width: 100%; }
  .yn { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 479.98px) {
  .cond-grid { grid-template-columns: 1fr; }
}

/* ---------- reduced motion: state still changes, nothing moves ---------- */
@media (prefers-reduced-motion: reduce) {
  html.js .i-sec { opacity: 1; transform: none; animation: none; }
  html.js .f-err:not([hidden]), html.js .reveal:not([hidden]) { animation: none; }
  .chk-box svg { transition: none; }
  .i-send .i-spin { animation: none; }
  .dr-c, .dr-t { animation: none; stroke-dashoffset: 0; }
  .intake-form input, .intake-form textarea, .yn-o span, .cond { transition: none; }
}

/* ---------- print: the "bring it with you" fallback ---------- */
@media print {
  .util, header.main, .m-head, .m-menu, footer, .cta-band,
  .i-submit, .intake-done, .privacy-card, .intake-alert { display: none !important; }
  body { background: #fff; }
  .i-sec { break-inside: avoid; border-color: #999; box-shadow: none; }
  html.js .i-sec { opacity: 1; transform: none; animation: none; }
  .reveal[hidden] { display: block !important; }
  .cond-grid { grid-template-columns: repeat(3, 1fr); }
  .chk-box, .yn-o span { border-color: #444; }
}

/* ---------- prefilled and locked, when the form follows a booking ----------
   The fields they already filled in at booking are shown answered and locked,
   so the form reads as theirs rather than as a fresh generic questionnaire.
   readonly, not disabled: a disabled input leaves the tab order and stops being
   announced, and a locked answer is still an answer somebody may want to read. */
.prefill-note {
  display: flex; gap: 9px; align-items: flex-start;
  background: #E4EAE7; border-radius: 8px; padding: 12px 14px;
  font-size: 14px; color: var(--ink-2); margin-bottom: var(--sp-3);
}
.prefill-note svg { flex: none; margin-top: 2px; color: var(--ink-2); }
html.js .prefill-note:not([hidden]) { animation: grow .28s ease; }

.f-lock {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-3);
}
.f-lock svg { width: 11px; height: 11px; }
.intake-form input.is-locked {
  background: #F1EFEA; color: var(--ink-2); font-weight: 600;
  border-color: #DFD9CF; cursor: default;
}
.intake-form input.is-locked:hover { border-color: #DFD9CF; }
.intake-form input.is-locked:focus-visible { border-color: var(--ink-2); box-shadow: 0 0 0 3px rgba(62,90,82,.14); }
@media (prefers-reduced-motion: reduce) { html.js .prefill-note:not([hidden]) { animation: none; } }
