/* Author: Ricky Patel
 * ZOVI LEAF /intake — the multi-step pre-consultation form. Builds on site.css's form components (.form-card,
 * .form-grid, label, input, .err, .check, .btn) and tokens; only the step, option, consent and signature pieces live
 * here, loaded by the intake page alone. */
/* site.css gives .btn display:inline-flex, which beats the hidden attribute; steps and buttons rely on hidden. */
#intakeForm [hidden] { display: none !important; }
/* The shell's sticky "Start Assessment" bar covered form fields at 390 px (coordinator, 2026-12-01). The patient is
   already in the assessment here, so the bar is hidden on this page only (this file loads on /intake alone). */
.sticky-cta { display: none !important; }
.ik-head { margin-bottom: 22px; }
.ik-kicker { margin: 0 0 6px; font-size: .82rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--moss); }
.ik-title { font-size: clamp(1.5rem, 2.6vw, 2.1rem); margin: 0 0 8px; }
.ik-progress { margin: 0 0 26px; }
.ik-progress-label { margin: 0 0 8px; font-weight: 600; font-size: .95rem; color: var(--forest); }
.ik-bar { height: 8px; border-radius: 99px; background: var(--sage-2); overflow: hidden; }
.ik-bar span { display: block; height: 100%; width: 11%; border-radius: inherit; background: linear-gradient(90deg, var(--terra), var(--terra-2)); transition: width .35s ease; }
.ik-loading { color: var(--muted); }
.ik-step-title { font-size: 1.45rem; margin: 0 0 18px; outline: none; }
.ik-q { margin: 0 0 24px; min-width: 0; }
.ik-q legend, .ik-q > label { font: 600 1rem/1.4 var(--text); margin-bottom: 10px; display: block; }
.ik-q .hint { margin: -4px 0 10px; }
.n { color: var(--terra); font-weight: 700; }
.ik-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.ik-opt { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px 14px; border: 1.5px solid #d6ddd0; border-radius: 14px; background: var(--paper); font-weight: 500; font-size: .95rem; cursor: pointer; transition: border-color .2s, background-color .2s; }
.ik-opt input { width: 20px; height: 20px; min-height: 20px; margin: 2px 0 0; padding: 0; flex: none; accent-color: var(--terra); }
.ik-opt:has(input:checked) { border-color: var(--terra); background: #fbf1ec; }
.ik-opt:has(input:focus-visible) { outline: 3px solid var(--honey); outline-offset: 2px; }
[aria-invalid="true"] .ik-opt { border-color: var(--red); }
.ik-follow { margin-top: 14px; padding: 14px 16px; border-left: 3px solid var(--terra); background: var(--mist); border-radius: 0 14px 14px 0; }
.ik-follow > * + * { margin-top: 10px; }
.ik-follow-legend { margin: 0 0 8px; font-weight: 600; }
.ik-scale { display: flex; align-items: center; gap: 14px; }
.ik-scale input[type="range"] { flex: 1; min-height: 32px; padding: 0; border: 0; background: none; accent-color: var(--terra); }
.ik-scale output { font: 600 1.5rem var(--display); min-width: 3ch; text-align: center; color: var(--terra); }
.ik-scale-ends { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); }
.ik-pick { display: inline-flex; width: auto; margin: 4px 0 12px; }
.ik-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ik-file-input:focus-visible + .ik-pick { outline: 3px solid var(--honey); outline-offset: 3px; }
.ik-files { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ik-files li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.ik-files .fname { font-weight: 600; overflow-wrap: anywhere; }
.ik-files .fmeta { grid-column: 1 / -1; font-size: .85rem; color: var(--muted); }
.ik-files .fmeta.bad { color: var(--red); } .ik-files .fmeta.ok { color: #1f6b33; }
.ik-files progress { grid-column: 1 / -1; width: 100%; height: 6px; accent-color: var(--terra); }
.ik-files button { min-height: 36px; padding: .4em .9em; font-size: .9rem; }
.ik-consent { max-height: 420px; overflow-y: auto; padding: 20px 22px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--mist); font-size: .94rem; line-height: 1.6; }
.ik-consent h4 { font: 700 1rem/1.35 var(--text); margin: 16px 0 6px; letter-spacing: 0; }
.ik-consent h4:first-child { margin-top: 0; }
.ik-consent p { margin: 0 0 10px; color: #39443b; }
.ik-consent ul { margin: 0 0 10px; padding-left: 1.2em; color: #39443b; }
.ik-consent li { margin-bottom: 6px; }
.ik-agree { margin-top: 6px; font-weight: 600; }
.check + .err { margin-bottom: 10px; }
.ik-sig { margin-top: 18px; }
.ik-tabs { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.ik-tabs .ik-opt { padding: 10px 16px; }
#sigCanvas { display: block; width: 100%; height: auto; aspect-ratio: 10 / 3; border: 1.5px dashed #b9c4ad; border-radius: 14px; background: #fff; touch-action: none; cursor: crosshair; }
.ik-clear { margin-top: 10px; min-height: 40px; }
.ik-typed { margin-top: 10px; min-height: 76px; padding: 10px 16px; border: 1.5px dashed #b9c4ad; border-radius: 14px; background: #fff; font: italic 2.4rem/1.4 'Segoe Script', 'Brush Script MT', 'Snell Roundhand', cursive; color: #1d2a4a; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ik-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.ik-nav #nextBtn, .ik-nav #submitBtn { margin-left: auto; }
.ik-nav .btn { border-width: 1.5px; }
.ik-aside { position: sticky; top: 110px; }
@media (max-width: 1100px) { .ik-aside { position: static; } }
@media (max-width: 720px) {
  .ik-opts { grid-template-columns: 1fr; }
  .ik-consent { max-height: 360px; padding: 16px; }
  .ik-nav .btn { flex: 1; padding-inline: .9em; }
  .ik-typed { font-size: 1.9rem; }
}
