/* /intake — the new-client intake form (partial appended by server/site.js).
   Tokens come from /theme.css, so dark mode is inherited; this file is layout
   and form components only, scoped under .intake / .page-intake. */

/* ---- page hooks --------------------------------------------------------- */
.page-intake .prose { max-width: 58rem; }
body.page-intake { padding-bottom: 6.5rem; }          /* clearance for the fixed action bar */
.intake [hidden] { display: none !important; }
.intake .mt { margin-top: 1.15rem; }
.intake .mt-l { margin-top: 1.6rem; }
.intake .mt-s { margin-top: 0.7rem; }

/* ---- cards + section heads --------------------------------------------- */
.intake .card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.1rem, 3vw, 1.9rem); box-shadow: var(--shadow); margin-top: 1.25rem;
}
.intake .section-head { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.4rem; }
.intake .sec-num {
  display: inline-grid; place-items: center; flex: none;
  width: 1.9rem; height: 1.9rem; border-radius: 999px;
  background: var(--moss); color: var(--on-moss);
  font-family: var(--font-ui); font-weight: 600; font-size: 0.85rem;
}
/* the prose fern tick on headings doesn't belong inside the form */
.prose .intake h2, .prose .intake h3 { padding-left: 0; margin: 0; }
.prose .intake h2::before, .prose .intake h3::before { display: none; }
.intake .section-head h2 { font-size: clamp(1.15rem, 2.5vw, 1.45rem); font-weight: 540; letter-spacing: 0.005em; }
.intake .section-note { color: var(--muted); font-size: 0.93rem; margin: 0.15rem 0 1.25rem; max-width: 44rem; }
.intake .prose-block p { margin: 0 0 0.85rem; }
.intake .prose-block p:last-child { margin-bottom: 0; }

/* ---- fields ------------------------------------------------------------- */
.intake fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.intake legend { padding: 0; }
.intake .grid { display: grid; gap: 1rem 1.15rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); }
.intake .grid.wide { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.intake .grid-3 { display: grid; gap: 1rem 1.15rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.intake .grid-2 { display: grid; gap: 1rem 1.15rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.intake .rows { display: grid; gap: 1.15rem; }
@media (max-width: 700px) { .intake .grid-3, .intake .grid-2 { grid-template-columns: 1fr; } }
.intake .field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.intake .field.full { grid-column: 1 / -1; }
.intake .lbl {
  font-family: var(--font-ui); font-weight: 600; font-size: 0.86rem; letter-spacing: 0.01em;
  color: var(--moss); line-height: 1.35; margin: 0;
}
.intake .lbl-note { font-weight: 500; color: var(--muted); }
.intake .legend-text { display: block; margin-bottom: 0.55rem; }
.intake .hint { font-size: 0.82rem; color: var(--muted); line-height: 1.45; margin: 0; }
.intake input, .intake textarea { padding: 0.62rem 0.8rem; }
.intake textarea { min-height: 6.25rem; line-height: 1.55; }
.intake textarea.tall { min-height: 8.5rem; }
.intake ::placeholder { color: var(--muted); opacity: 0.75; }
.intake input[type="password"] { letter-spacing: 0.18em; }

/* ---- repeat groups ------------------------------------------------------ */
.intake .repeat-group { margin-top: 0.35rem; }
.intake .repeat-row { margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px dashed var(--line); }
.intake .repeat-row:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.intake .row-top { display: grid; grid-template-columns: 1fr auto; gap: 0.55rem; align-items: center; }
.intake .row-details { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; margin-top: 0.55rem; }
.intake .row-details input { font-size: 0.97rem; }
.intake .remove-row {
  width: 2.75rem; height: 2.75rem; min-height: 0; padding: 0;
  border-radius: 50%; border: 1px solid var(--line);
  background: transparent; color: var(--muted);
  font-size: 1.25rem; line-height: 1;
}
.intake .remove-row:hover { border-color: var(--rose); color: var(--rose); background: var(--card); }
.intake .add-row {
  margin-top: 0.85rem; min-height: 0;
  font-size: 0.82rem; padding: 0.45rem 0.95rem;
  border: 1px dashed var(--line); background: transparent; color: var(--fern);
}
.intake .add-row:hover { border-color: var(--fern); background: var(--lichen); }
@media (max-width: 560px) { .intake .row-details { grid-template-columns: 1fr; } }

/* ---- choice chips ------------------------------------------------------- */
.intake .choices {
  display: grid; gap: 0.5rem; margin-top: 0.15rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17.5rem), 1fr));
}
.intake .choices.stack { grid-template-columns: 1fr; }
.intake .choice {
  display: flex; align-items: flex-start; gap: 0.65rem;
  padding: 0.62rem 0.78rem; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); cursor: pointer;
  font-family: var(--font-body); font-weight: 400; font-size: 0.97rem; line-height: 1.45;
}
.intake .choice:hover { border-color: var(--fern); background: var(--lichen); }
.intake .choice input {
  flex: none; width: 1.05rem; height: 1.05rem; min-height: 0;
  margin: 0.22rem 0 0; padding: 0; accent-color: var(--moss);
}
.intake .choice:has(input:checked), .intake .choice.checked {
  border-color: var(--moss); background: var(--lichen); box-shadow: inset 0 0 0 1px var(--moss);
}
.intake .choice:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }

/* ---- panels & callouts -------------------------------------------------- */
.intake .subpanel {
  margin-top: 1.3rem; padding: 1rem 1.1rem 1.15rem;
  border: 1px dashed var(--lichen-2); border-radius: 12px; background: var(--paper-2);
}
.intake .subpanel-title {
  font-family: var(--font-ui); font-weight: 600; font-size: 0.8rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--fern); margin: 0 0 0.85rem;
}
.intake .callout {
  margin: 1.15rem 0 0; padding: 0.9rem 1.05rem;
  border-radius: 12px; background: var(--paper-2); border-left: 4px solid var(--fern);
  font-size: 0.93rem; color: var(--ink);
}
.intake .callout p { margin: 0; }
.intake .callout p + p { margin-top: 0.6rem; }
.intake .callout strong { color: var(--moss); }

/* ---- action bar --------------------------------------------------------- */
.intake .action-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: center; gap: 0.7rem 1rem; flex-wrap: wrap; justify-content: space-between;
  padding: 0.7rem clamp(0.9rem, 4vw, 2rem);
  background: color-mix(in srgb, var(--card) 94%, transparent); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 24px rgba(32, 52, 31, 0.07);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-family: var(--font-ui);
}
.intake .action-status {
  flex-basis: 100%; margin: 0; padding: 0.55rem 0.9rem; border-radius: 10px;
  border-left: 4px solid var(--pink); background: color-mix(in srgb, var(--pink) 12%, transparent);
  color: var(--pink); font-size: 0.92rem; font-weight: 600;
}
.intake .action-status.is-note {   /* "Saved…": the same line, as news */
  border-left-color: var(--fern); background: color-mix(in srgb, var(--fern) 12%, transparent);
  color: var(--ink); font-weight: 500;
}
.intake .progress { display: flex; align-items: center; gap: 0.65rem; flex: 1 1 15rem; min-width: 12rem; max-width: 26rem; }
.intake .progress-track {
  position: relative; flex: 1; height: 8px; border-radius: 999px; overflow: hidden;
  background: var(--paper-2); border: 1px solid var(--line);
}
.intake .progress-fill {
  position: absolute; top: 0; bottom: 0; left: 0; width: 0%;
  background: linear-gradient(90deg, var(--fern), var(--moss));
  border-radius: 999px; transition: width 0.3s ease;
}
.intake .progress-label { font-size: 0.78rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.intake .draft-status { font-size: 0.76rem; color: var(--muted); white-space: nowrap; }
.intake .action-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.intake .action-buttons .btn { min-height: 0; padding: 0.58rem 1.15rem; font-size: 0.94rem; }
.intake .cta-row { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 1.4rem; }
/* phones: two compact rows (progress + draft status, then Clear / Save / Send) so the
   fixed bar doesn't eat a quarter of the screen; printing waits for a bigger screen */
@media (max-width: 40rem) {
  .intake .action-bar { gap: 0.45rem 0.6rem; padding: 0.55rem 0.8rem; }
  .intake .progress { flex: 1 1 auto; min-width: 0; max-width: none; }
  .intake .draft-status { flex: none; }
  .intake .action-buttons { flex-basis: 100%; justify-content: space-between; flex-wrap: nowrap; gap: 0.4rem; }
  .intake .action-buttons .btn { flex: 1 1 auto; padding: 0.58rem 0.7rem; font-size: 0.9rem; white-space: nowrap; }   /* Clear / Save / Send: one row */
  .intake #printBtn { display: none; }
  body.page-intake { padding-bottom: 7.5rem; }
}

/* ---- confirmation ------------------------------------------------------- */
.intake .eyebrow-fern { color: var(--fern); }
.intake .confirm-title { font-family: var(--font-display); font-weight: 540; font-size: clamp(1.5rem, 3.4vw, 2rem); margin: 0.2rem 0 0.6rem; }
.intake #confirmSummary h3 { font-size: 1.1rem; margin: 1.4rem 0 0.4rem; }
.intake .signed-in-note { margin-top: 1.15rem; }

/* ---- print -------------------------------------------------------------- */
@media print {
  @page { size: Letter; margin: 1.4cm 1.2cm; }
  body.page-intake {
    --paper: #fff; --paper-2: #f4f4f4; --card: #fff; --ink: #000; --muted: #444; --line: #999;
    --moss: #000; --fern: #333; --lichen: #eaeaea; --on-moss: #fff; --shadow: none;
    padding-bottom: 0; font-size: 10pt;
  }
  .intake .action-bar, .intake .no-print, .intake .remove-row, .intake .add-row { display: none !important; }
  .page-intake .prose { max-width: none; padding: 0; }
  .intake .card { border: 1px solid #aaa; border-radius: 3px; margin-top: 0.55rem; padding: 0.6rem 0.7rem 0.7rem; break-inside: auto; }
  .intake .section-head { break-after: avoid; margin-bottom: 0.15rem; }
  .intake .sec-num { background: #333; color: #fff; width: 1.35rem; height: 1.35rem; font-size: 8pt; }
  .intake .field, .intake .subpanel, .intake .callout, .intake .choice, .intake .repeat-row { break-inside: avoid; }
  .intake .row-top { grid-template-columns: 1fr; }
  .intake input, .intake textarea {
    border: none; border-bottom: 1px solid #888; border-radius: 0; background: transparent;
    padding: 0.08rem 0; min-height: 0; font-size: 10pt; color: #000;
  }
  .intake textarea { resize: none; overflow: hidden; line-height: 1.35; }
  .intake .choice { border: 1px solid #bbb; background: #fff; box-shadow: none; padding: 0.22rem 0.4rem; font-size: 9.5pt; gap: 0.45rem; }
  .intake .choice:has(input:checked), .intake .choice.checked { background: #eaeaea; }
  .intake .subpanel { border: 1px dashed #aaa; padding: 0.5rem 0.6rem 0.6rem; margin-top: 0.7rem; }
  .intake .callout { border-left: 3px solid #666; padding: 0.5rem 0.7rem; font-size: 9pt; margin-top: 0.6rem; }
}
@media (prefers-reduced-motion: reduce) { .intake .progress-fill { transition: none; } }
