/* public/styles.css — Lev Pediatrics intake
   Ported from design_handoff_intake/intake.html <style>. */

:root {
  --rose: #7A4842;
  --rose-deep: #5E332E;
  --rose-accent: #96605A;
  --rose-light: #DEB8B2;
  --rose-tint: #F0DAD4;
  --sage: #5E6A58;
  --sage-tint: #E8ECE3;
  --cream: #F7F3EF;
  --cream-warm: #F0EAE4;
  --cream-deep: #E8E0D8;
  --ink: #1F1814;
  --ink-soft: #3A2E28;
  --text-medium: #463A34;
  --text-light: #5C504A;
  --line: rgba(31,24,20,0.10);
  --line-soft: rgba(31,24,20,0.06);
  --line-strong: rgba(31,24,20,0.18);
  --danger: #8B2E2E;
  --success: #3F6B3F;
  --focus: #7A4842;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
/* Buttons don't inherit fonts from body by default; force it so nothing
   (modals, icon buttons, etc.) falls back to the browser's Helvetica/Arial. */
button { font: inherit; color: inherit; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  font-size: 17px;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }

/* ============================================
   LAYOUT SHELL
   ============================================ */
.intake-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px 160px;
  position: relative;
}
.intake-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 0 14px;
  border-bottom: 1px solid var(--line-soft);
  position: sticky; top: 0;
  background: var(--cream);
  z-index: 100;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.brand-mark {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.brand-mark svg { width: 100%; height: 100%; display: block; }
.brand-text {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.45rem; font-weight: 400;
  color: #2C2420;
  letter-spacing: -0.01em;
  line-height: 1;
}
.brand-text em {
  color: #8F5448;
  font-style: italic;
  font-weight: 400;
}
.autosave-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.78rem; color: var(--text-light);
  font-variant-numeric: tabular-nums;
}
.autosave-pill .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--sage); display: inline-block;
}
.autosave-pill.saving .dot {
  background: var(--rose-accent);
  animation: pulse 1.2s ease-in-out infinite;
}
.autosave-pill.error .dot { background: var(--danger); }
@keyframes pulse { 50% { opacity: 0.35; } }

.top-right { display: inline-flex; align-items: center; gap: 14px; }
.save-later-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent;
  color: var(--rose-deep);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 7px 14px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.save-later-btn:hover { background: var(--cream-warm); border-color: var(--rose-light); }
@media (max-width: 480px) {
  .save-later-btn { padding: 6px 10px; font-size: 0.76rem; }
  .save-later-btn svg { display: none; }
}

/* ============================================
   RESUME / SAVE-FOR-LATER MODAL
   ============================================ */
.resume-modal {
  position: fixed; inset: 0;
  background: rgba(31,24,20,0.48);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 100;
  animation: fadeIn 0.18s ease;
}
.resume-modal[hidden] { display: none; }
.resume-panel {
  background: #fff;
  border-radius: 16px;
  padding: 28px 26px 24px;
  max-width: 460px; width: 100%;
  position: relative;
  box-shadow: 0 20px 60px rgba(31,24,20,0.24);
}
.resume-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none;
  font-size: 1.6rem; line-height: 1;
  color: var(--text-light); cursor: pointer;
  padding: 4px 8px;
}
.resume-close:hover { color: var(--ink); }
.resume-panel h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.4rem; color: var(--ink);
  margin: 0 0 8px;
}
.resume-deck { font-size: 0.9rem; color: var(--text-medium); margin: 0 0 18px; }
.resume-url-row {
  display: flex; gap: 8px;
  margin-bottom: 12px;
}
.resume-url-row input {
  flex: 1; min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 0.82rem;
  font-family: ui-monospace, SFMono-Regular, monospace;
  background: var(--cream-warm);
  color: var(--text-medium);
}
.resume-copy {
  background: var(--ink); color: var(--cream);
  border: none; border-radius: 8px;
  padding: 10px 16px;
  font-family: inherit; font-size: 0.86rem; font-weight: 500;
  cursor: pointer; flex-shrink: 0;
  transition: background 0.15s ease;
}
.resume-copy:hover { background: var(--rose-deep); }
.resume-copy.copied { background: var(--sage); }
.resume-email-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--rose-deep); color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.92rem; font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease;
}
.resume-email-btn:hover { background: var(--ink); }
.resume-note {
  font-size: 0.78rem; color: var(--text-light);
  margin: 14px 0 0; text-align: center;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Progress bar */
.progress-wrap { padding: 14px 0 10px; }
.progress-meta {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 0.82rem; color: var(--text-light); margin-bottom: 8px;
}
.progress-meta strong { color: var(--ink); font-weight: 600; }
.progress-track {
  height: 4px; background: var(--cream-deep);
  border-radius: 999px; overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0%;
  background: var(--rose-accent);
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(.2,.8,.2,1);
}

/* ============================================
   WELCOME
   ============================================ */
.welcome {
  padding: 48px 0 36px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 32px;
}
.welcome .eyebrow {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--rose-deep); font-weight: 600; margin-bottom: 14px;
}
.welcome h1 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 500;
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  line-height: 1.15; letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 18px;
  text-wrap: pretty;
}
.welcome h1 em { font-style: italic; color: var(--rose-deep); font-weight: 500; }
.welcome p { color: var(--text-medium); font-size: 1.04rem; max-width: 56ch; }
.welcome-meta {
  display: flex; flex-wrap: wrap; gap: 24px;
  margin-top: 24px; padding-top: 20px;
  border-top: 1px solid var(--line-soft);
  font-size: 0.88rem; color: var(--text-medium);
}
.welcome-meta > div { display: flex; align-items: center; gap: 8px; }
.welcome-meta svg { color: var(--rose-accent); flex-shrink: 0; }

/* ============================================
   SECTIONS
   ============================================ */
.section {
  margin-bottom: 44px;
  scroll-margin-top: 100px;
}
.section-head {
  display: flex; align-items: baseline; gap: 14px;
  margin-bottom: 8px;
}
.section-num {
  font-size: 0.78rem; font-weight: 600;
  color: var(--rose-accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.section-head h2 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 500;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.section-deck {
  color: var(--text-medium);
  font-size: 0.95rem;
  margin-bottom: 24px;
  max-width: 58ch;
}

/* ============================================
   FORM CONTROLS
   ============================================ */
.field { margin-bottom: 20px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row.thirds { grid-template-columns: 2fr 1fr 1fr; }
@media (max-width: 560px) {
  .field-row, .field-row.thirds { grid-template-columns: 1fr; }
}
label {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
label .req { color: var(--rose-deep); margin-left: 2px; }
label .hint { color: var(--text-light); font-weight: 400; font-size: 0.82rem; margin-left: 6px; }

input[type="text"], input[type="email"], input[type="tel"],
input[type="date"], input[type="number"], select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(122, 72, 66, 0.15);
}
textarea {
  resize: vertical;
  min-height: 88px;
  line-height: 1.5;
  field-sizing: content;   /* auto-grow in Chromium 123+ / Safari 17.4+ */
  max-height: 320px;
}
select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M4 6l4 4 4-4' stroke='%235C504A' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}
/* Date inputs: match height of other fields + show a calendar affordance
   when empty. iOS Safari otherwise renders the empty state with no content,
   making the box look shorter than its siblings. */
input[type="date"] {
  min-height: 48px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A89E96' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='5' width='18' height='16' rx='2'/><path d='M3 10h18M8 3v4M16 3v4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px 18px;
  padding-right: 42px;
}
/* iOS collapses the date-edit content to zero width when no value is set.
   Reserve space so the field doesn't look squished. */
input[type="date"]::-webkit-date-and-time-value {
  min-height: 1.4em;
  text-align: left;
}
.field .help { font-size: 0.82rem; color: var(--text-light); margin-top: 6px; }
.field.error input, .field.error select, .field.error textarea {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(139, 46, 46, 0.12);
}
.field .err-msg {
  display: none;
  color: var(--danger);
  font-size: 0.82rem;
  margin-top: 6px;
}
.field.error .err-msg { display: block; }

/* Radio / checkbox pills */
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:hover { border-color: var(--rose-accent); }
.choice.selected {
  background: var(--ink); color: var(--cream);
  border-color: var(--ink);
}

/* Chip multi-select */
.chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 12px; background: #fff;
  border: 1px solid var(--line); border-radius: 10px;
  margin-bottom: 10px;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  background: var(--cream-warm);
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--rose-light); }
.chip.active {
  background: var(--rose-tint);
  color: var(--rose-deep);
  border-color: var(--rose-light);
  font-weight: 500;
}
.chip .x { display: none; font-size: 0.9rem; line-height: 1; }
.chip.active .x { display: inline; }

/* Repeatable blocks */
.repeat-list { display: flex; flex-direction: column; gap: 12px; }
.repeat-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  position: relative;
}
.repeat-item .rm {
  position: absolute; top: 10px; right: 10px;
  background: none; border: none; color: var(--text-light);
  cursor: pointer; padding: 6px; border-radius: 6px;
  line-height: 0;
}
.repeat-item .rm:hover { background: var(--cream-warm); color: var(--danger); }
.add-btn {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 12px;
  background: none;
  border: 1px dashed var(--line-strong);
  color: var(--rose-deep);
  font-family: inherit; font-size: 0.9rem; font-weight: 500;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.add-btn:hover { border-color: var(--rose-accent); background: var(--cream-warm); }

/* ============================================
   PHARMACY AUTOCOMPLETE
   ============================================ */
.pharmacy-field { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.pharmacy-search { position: relative; }
.pharmacy-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(31,24,20,0.10);
  max-height: 300px; overflow-y: auto;
  z-index: 30;
}
.pharmacy-results[hidden] { display: none; }
.pharmacy-result {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  font-size: 0.92rem;
}
.pharmacy-result:last-child { border-bottom: none; }
.pharmacy-result:hover, .pharmacy-result.active { background: var(--cream-warm); }
.pharmacy-result strong { color: var(--ink); display: block; }
.pharmacy-result .sub { font-size: 0.82rem; color: var(--text-light); margin-top: 2px; }
.pharmacy-result .empty { font-style: italic; color: var(--text-light); }
.pharmacy-selected[hidden] { display: none; }
.pharmacy-card {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 14px 16px;
  background: var(--sage-tint);
  border: 1px solid rgba(94,106,88,0.3);
  border-radius: 10px;
}
.pharmacy-card-body strong { color: var(--ink); font-size: 0.98rem; display: block; }
.pharmacy-sub { font-size: 0.85rem; color: var(--text-medium); margin-top: 2px; }
.pharmacy-clear {
  background: none; border: none;
  color: var(--rose-deep); font-family: inherit;
  font-size: 0.84rem; font-weight: 500;
  cursor: pointer; padding: 4px 8px;
  flex-shrink: 0;
}
.pharmacy-clear:hover { text-decoration: underline; }

/* ============================================
   ADDRESS AUTOCOMPLETE  (shares shape w/ pharmacy)
   ============================================ */
.address-search-field { margin-bottom: 18px; }
.address-search { position: relative; }
.address-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(31,24,20,0.10);
  max-height: 300px; overflow-y: auto;
  z-index: 30;
}
.address-results[hidden] { display: none; }
.address-result {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  font-size: 0.92rem;
}
.address-result:last-child { border-bottom: none; }
.address-result:hover, .address-result.active { background: var(--cream-warm); }
.address-result strong { color: var(--ink); display: block; }
.address-result .sub { font-size: 0.82rem; color: var(--text-light); margin-top: 2px; }
.address-result.empty { font-style: italic; color: var(--text-light); cursor: default; }

/* ============================================
   UPLOAD / PHOTO CARDS
   ============================================ */
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .upload-grid { grid-template-columns: 1fr; } }
.upload-card {
  border: 2px dashed var(--line-strong);
  border-radius: 12px;
  padding: 20px 16px;
  text-align: center;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 140px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
}
.upload-card:hover { border-color: var(--rose-accent); background: var(--cream-warm); }
.upload-card.filled {
  border-style: solid; border-color: var(--sage);
  background: var(--sage-tint);
}
.upload-card svg { color: var(--rose-accent); }
.upload-card.filled svg { color: var(--sage); }
.upload-card.needed {
  border-color: var(--rose-accent);
  background: var(--rose-tint);
  animation: nudgePulse 1.6s ease-in-out 1;
}
.upload-card.needed .sub { color: var(--rose-deep); font-weight: 500; }
@keyframes nudgePulse {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.02); }
}
.upload-card .label { font-weight: 500; font-size: 0.92rem; color: var(--ink); }
.upload-card .sub { font-size: 0.8rem; color: var(--text-light); }
.upload-card input { display: none; }
.upload-card .preview { font-size: 0.82rem; color: var(--sage); font-weight: 500; margin-top: 2px; }
.upload-thumbs {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
  margin-top: 10px; width: 100%;
}
.upload-thumb {
  width: 52px; height: 52px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  flex-shrink: 0;
}
.upload-thumb img { width: 100%; height: 100%; object-fit: cover; }
.upload-thumb.is-file { flex-direction: column; gap: 2px; color: var(--text-medium); }
.upload-thumb.is-file .ext {
  font-size: 0.62rem; font-weight: 600;
  color: var(--rose-deep); letter-spacing: 0.04em;
}

/* ============================================
   CONSENT BLOCKS & SIGNATURE
   ============================================ */
.consent-block {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 14px;
}
.consent-block h3 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 500; font-size: 1.08rem;
  color: var(--ink); margin-bottom: 8px;
}
.consent-scroll {
  max-height: 180px; overflow-y: auto;
  background: var(--cream); border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 14px;
  font-size: 0.86rem; color: var(--text-medium);
  line-height: 1.55;
  margin: 10px 0;
}
.consent-scroll p { margin-bottom: 10px; }
.consent-scroll p:last-child { margin-bottom: 0; }
.consent-ack {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0 0;
  border-top: 1px solid var(--line-soft);
  margin-top: 10px;
  font-size: 0.92rem; color: var(--ink-soft);
  cursor: pointer;
}
.consent-ack.error {
  color: var(--danger);
  background: rgba(139,46,46,0.05);
  border-radius: 6px;
  padding: 10px;
  margin: 0 -10px;
}
.consent-ack.error input { outline: 2px solid var(--danger); outline-offset: 2px; }
.consent-ack input {
  margin-top: 3px; width: 18px; height: 18px;
  accent-color: var(--rose-accent); flex-shrink: 0;
}

/* Consent disclosure accordions */
.consent-details {
  border-top: 1px solid var(--line-soft);
  padding: 12px 0;
}
.consent-details:first-of-type { border-top: none; padding-top: 4px; }
.consent-details summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--ink);
  font-size: 0.95rem;
  display: flex; align-items: center; gap: 10px;
  list-style: none;
  padding: 4px 0;
}
.consent-details summary::-webkit-details-marker { display: none; }
.consent-details summary::before {
  content: "";
  width: 10px; height: 10px;
  border-right: 1.5px solid var(--rose-accent);
  border-bottom: 1.5px solid var(--rose-accent);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.consent-details[open] summary::before { transform: rotate(45deg); }
.consent-details .consent-scroll { margin-top: 10px; max-height: 140px; }

/* Signature */
.sig-pad {
  display: block;
  width: 100%; height: 140px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  touch-action: none;
  cursor: crosshair;
  margin-top: 8px;
}
.sig-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 8px;
  font-size: 0.82rem; color: var(--text-light);
}
.sig-clear {
  background: none; border: none;
  color: var(--rose-deep);
  font-size: 0.82rem; font-family: inherit;
  cursor: pointer; text-decoration: underline;
  padding: 4px;
}

/* Skip button */
.skip-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--cream-warm);
  color: var(--rose-deep);
  border: 1px solid var(--line);
  font-family: inherit; font-size: 0.88rem; font-weight: 500;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  margin-bottom: 18px;
  transition: all 0.15s ease;
}
.skip-btn:hover { background: var(--rose-tint); border-color: var(--rose-light); }
.skip-btn.active {
  background: var(--sage-tint);
  color: var(--ink);
  border-color: var(--sage);
  box-shadow: inset 0 0 0 1px var(--sage);
  font-weight: 600;
}
.skip-btn.active svg {
  stroke: var(--sage);
  stroke-width: 3;
}

/* ============================================
   STICKY SUBMIT BAR
   ============================================ */
.submit-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 14px 20px;
  z-index: 200;
  box-shadow: 0 -8px 24px rgba(31,24,20,0.06);
}
.submit-inner {
  max-width: 720px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.submit-status { font-size: 0.86rem; color: var(--text-medium); }
.submit-status strong { color: var(--ink); }
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: var(--cream);
  border: none;
  padding: 14px 28px;
  border-radius: 999px;
  font-family: inherit; font-size: 1rem; font-weight: 500;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); background: var(--ink-soft); }
.btn-primary:disabled { opacity: 0.6; cursor: wait; }
/* Incomplete = form isn't ready but the button stays clickable; tapping
   scrolls to the first missing field so users aren't left guessing. */
.btn-primary.incomplete {
  background: var(--ink-soft);
  opacity: 0.85;
}
.btn-primary.incomplete:hover { background: var(--ink); opacity: 1; }
.btn-primary .btn-spin[hidden] { display: none; }

.submit-error {
  max-width: 720px;
  margin: 0 auto 20px;
  padding: 12px 16px;
  background: #FDF5F3;
  border: 1px solid var(--danger);
  border-radius: 10px;
  color: var(--danger);
  font-size: 0.9rem;
  display: none;
}
.submit-error.show { display: block; }

/* ============================================
   SUCCESS SCREEN
   ============================================ */
.success-screen {
  display: none;
  text-align: center;
  padding: 80px 20px;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.success-screen.show { display: block; }
.success-screen.show.visible { opacity: 1; transform: none; }
.success-icon {
  width: 72px; height: 72px;
  background: var(--sage-tint);
  color: var(--sage);
  border-radius: 50%;
  display: grid; place-items: center;
  margin: 0 auto 24px;
}
.success-screen h2 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 500; font-size: 2rem;
  margin-bottom: 12px;
}
.success-screen p {
  color: var(--text-medium);
  max-width: 42ch;
  margin: 0 auto 20px;
}
.success-sibling {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--line-soft);
  max-width: 42ch;
  margin-left: auto; margin-right: auto;
}
.success-sibling .sibling-ask {
  font-size: 1rem; color: var(--ink); margin: 0 0 12px;
  font-weight: 500;
}
.sibling-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--rose-deep); color: #fff;
  border: none;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 0.94rem; font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.sibling-btn:hover { background: var(--ink); transform: translateY(-1px); }
.success-sibling .sibling-note {
  font-size: 0.82rem; color: var(--text-light);
  margin: 12px auto 0;
}
/* ============================================
   ACCESSIBILITY
   ============================================ */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
button:focus-visible, .choice:focus-visible, .chip:focus-visible {
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
