/* Phone first: one column, large tap targets, no horizontal scroll.
   Palette follows TherapyLink (Tailwind slate + blue). System fonts only. */
:root {
  --ink: #0f172a; --ink2: #475569; --muted: #64748b; --line: #e2e8f0; --paper: #f8fafc; --card: #ffffff;
  --blue: #1d4ed8; --blue-soft: #eff6ff; --ok: #15803d; --err: #b91c1c; --warn: #92400e;
  --tap: 48px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}
.top { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.top img { width: 44px; height: 44px; object-fit: contain; }
.brand { font-weight: 700; font-size: 17px; }
.progress { height: 6px; background: var(--line); }
.progress-fill { height: 100%; background: var(--blue); transition: width .2s; }
main { max-width: 640px; margin: 0 auto; padding: 16px; }
.step { margin: 0 0 8px; color: var(--muted); font-size: 15px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 16px; }
h1 { font-size: 24px; line-height: 1.25; margin: 0 0 8px; }
.intro { color: var(--ink2); margin: 0 0 16px; }
.note { color: var(--ink2); background: var(--blue-soft); border-radius: 8px; padding: 10px 12px; margin: 0 0 18px; font-size: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 18px; border: 0; padding: 0; min-width: 0; }
.field > label, legend { font-weight: 600; font-size: 16px; }
input[type=text], input[type=tel], input[type=email], input[type=date], input[type=number], input[type=password], select {
  width: 100%; min-height: var(--tap); padding: 10px 12px; font: inherit; color: var(--ink);
  background: #fff; border: 1.5px solid #94a3b8; border-radius: 8px;
}
input:focus, select:focus, button:focus-visible, a:focus-visible, .btn:focus-visible { outline: 3px solid #93c5fd; outline-offset: 1px; }
.group { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 0 0 18px; }
.group > legend { padding: 0 4px; }
.choice { display: flex; align-items: center; gap: 10px; min-height: var(--tap); font-weight: 400; }
.choice input { width: 24px; height: 24px; flex: none; margin: 0; }
.yesno { display: flex; gap: 20px; }
.check .choice { font-size: 16px; }
.upload input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
/* the file input is visually hidden behind its label button: show the focus there */
.upload:has(input[type=file]:focus-visible) label.btn { outline: 3px solid #93c5fd; outline-offset: 1px; }
h1:focus { outline: none; }
.upload-title { font-weight: 600; margin: 0; }
.field-status { margin: 0; min-height: 1.2em; font-size: 15px; }
.field-status.ok { color: var(--ok); }
.field-status.busy { color: var(--muted); }
.field-status.error, .error { color: var(--err); }
.notice { color: var(--warn); background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 10px 12px; }
.attest { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); padding: 10px 20px;
  font: inherit; font-weight: 600; color: #fff; background: var(--blue); border: 0; border-radius: 8px; cursor: pointer; text-decoration: none;
}
.btn.ghost { color: var(--blue); background: var(--blue-soft); }
.btn:disabled { opacity: .5; cursor: default; }
.nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; }
.nav .btn { flex: 1; }
.legal { max-height: none; color: var(--ink); }
.signature { font-family: "Segoe Script", "Brush Script MT", cursive; font-size: 20px; }
.missing { padding-left: 20px; }
.missing a { display: inline-block; min-height: var(--tap); line-height: var(--tap); color: var(--blue); }
.foot { max-width: 640px; margin: 0 auto; padding: 8px 16px 32px; color: var(--ink2); font-size: 15px; }
.foot a { color: var(--blue); }
.later { display: inline-block; min-height: var(--tap); line-height: var(--tap); font-weight: 600; }
.loading { color: var(--muted); }
