/* =====================================================================
   Intake flow — full-screen, focused, funnel on mobile
   ===================================================================== */

.intake-root {
  position: fixed; inset: 0; z-index: 200;
  background: var(--cream);
  display: flex; flex-direction: column;
  opacity: 0; pointer-events: none;
  transition: opacity .4s ease;
}
.intake-root.open { opacity: 1; pointer-events: auto; }

/* Top bar: brand + progress + close */
.intake-bar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem var(--gutter);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--cream) 86%, transparent);
  backdrop-filter: blur(8px);
}
.intake-bar .brand {
  font-family: var(--serif); font-size: 1.25rem; font-weight: 600;
  color: var(--ink); white-space: nowrap; letter-spacing: -0.01em;
}
.intake-bar .brand small {
  display: block; font-family: var(--sans); font-size: .58rem; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase; color: var(--accent-deep); margin-top: 2px;
}
.intake-progress { flex: 1; display: flex; flex-direction: column; gap: .4rem; max-width: 520px; margin: 0 auto; }
.intake-progress .track { height: 4px; border-radius: 999px; background: var(--sand); overflow: hidden; }
.intake-progress .fill { height: 100%; border-radius: 999px; background: var(--accent); transition: width .5s cubic-bezier(.2,.8,.2,1); }
.intake-progress .meta { display: flex; justify-content: space-between; font-size: .72rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.intake-close {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper); color: var(--muted);
  cursor: pointer; display: grid; place-items: center; transition: all .2s; font-size: 1.1rem;
}
.intake-close:hover { color: var(--ink); border-color: var(--ink); }

/* Scroll area */
.intake-scroll { flex: 1; overflow-y: auto; scroll-behavior: smooth; }
.intake-stage {
  max-width: 720px; margin: 0 auto;
  padding: clamp(36px, 7vw, 76px) var(--gutter) 140px;
  min-height: 100%;
}
.intake-stage.wide { max-width: 920px; }

/* Step header */
.step-eyebrow {
  font-size: .72rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
  color: var(--accent-deep); margin-bottom: .9rem; display: block;
}
.step-title { font-family: var(--serif); font-weight: 500; font-size: clamp(1.9rem, 4vw, 2.9rem); line-height: 1.08; margin: 0 0 .6rem; }
.step-hint { color: var(--muted); font-size: 1.04rem; line-height: 1.55; margin: 0 0 2rem; max-width: 56ch; }

/* Step transition — transform-only so content is never stuck invisible */
.step-anim { animation: stepIn .5s cubic-bezier(.2,.8,.2,1) both; }
@keyframes stepIn { from { transform: translateY(14px); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .step-anim { animation: none; } }

/* ---- Choice cards (service select) -------------------------------- */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.choice {
  text-align: left; background: var(--paper); border: 1.5px solid var(--line);
  border-radius: var(--r-lg); padding: 1.5rem 1.5rem; cursor: pointer;
  transition: all .22s cubic-bezier(.2,.8,.2,1); position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: .35rem; font-family: inherit; color: inherit;
}
.choice:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); transform: translateY(-3px); box-shadow: var(--sh-md); }
.choice.sel { border-color: var(--accent); background: var(--accent-tint); box-shadow: var(--sh-sm); }
.choice .c-name { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; line-height: 1.1; }
.choice .c-sub { font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-deep); }
.choice .c-blurb { font-size: .92rem; color: var(--muted); line-height: 1.5; margin-top: .3rem; }
.choice .c-check {
  position: absolute; top: 1.1rem; right: 1.1rem; width: 24px; height: 24px; border-radius: 999px;
  border: 1.5px solid var(--line); display: grid; place-items: center; color: #fff; transition: all .2s; opacity: 0;
}
.choice.sel .c-check { background: var(--accent); border-color: var(--accent); opacity: 1; }

/* ---- Multi-select option list ------------------------------------- */
.opt-list { display: grid; gap: .7rem; }
.opt-list.two-col { grid-template-columns: 1fr 1fr; }
.opt {
  display: flex; align-items: center; gap: .9rem; text-align: left;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r-md);
  padding: .95rem 1.1rem; cursor: pointer; transition: all .18s; font-family: inherit;
  color: var(--ink); font-size: 1rem; line-height: 1.35; width: 100%;
}
.opt:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-tint); }
.opt.sel { border-color: var(--accent); background: var(--accent-tint); }
.opt .box {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--line);
  display: grid; place-items: center; color: #fff; transition: all .18s; background: var(--paper);
}
.opt.sel .box { background: var(--accent); border-color: var(--accent); }
.opt.radio .box { border-radius: 999px; }

/* ---- Yes/No prior treatment rows ---------------------------------- */
.yn-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.yn-row:last-child { border-bottom: none; }
.yn-q { font-size: 1.02rem; color: var(--ink); max-width: 60%; line-height: 1.4; }
.yn-toggle { display: flex; gap: .5rem; flex: 0 0 auto; }
.yn-btn {
  border: 1.5px solid var(--line); background: var(--paper); color: var(--muted);
  font-family: inherit; font-weight: 700; font-size: .9rem; padding: .55rem 1.2rem;
  border-radius: 999px; cursor: pointer; transition: all .18s;
}
.yn-btn:hover { border-color: var(--ink); }
.yn-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.yn-detail { width: 100%; margin-top: .4rem; }

/* ---- Inputs -------------------------------------------------------- */
.field { margin-bottom: 1.2rem; }
.field label { display: block; font-size: .82rem; font-weight: 700; letter-spacing: .03em; color: var(--ink); margin-bottom: .45rem; }
.field label .req { color: var(--accent-deep); }
.field .help { font-size: .8rem; color: var(--muted); font-weight: 400; letter-spacing: 0; }
.inp, .ta, .sel {
  width: 100%; font-family: var(--sans); font-size: 1rem; color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r-md);
  padding: .9rem 1rem; transition: border-color .18s, box-shadow .18s; line-height: 1.4;
}
.inp:focus, .ta:focus, .sel:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}
.inp.err, .ta.err { border-color: #c0533f; box-shadow: 0 0 0 4px rgba(192,83,63,.12); }
.ta { resize: vertical; min-height: 120px; }
.err-msg { color: #b1492f; font-size: .8rem; font-weight: 600; margin-top: .4rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 1.1rem; }

/* Segmented control (sex etc.) */
.seg { display: inline-flex; background: var(--sand); border-radius: 999px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg button {
  border: none; background: transparent; font-family: inherit; font-weight: 700; font-size: .92rem;
  color: var(--muted); padding: .55rem 1.2rem; border-radius: 999px; cursor: pointer; transition: all .18s;
}
.seg button.on { background: var(--paper); color: var(--ink); box-shadow: var(--sh-sm); }

/* ---- Review of systems -------------------------------------------- */
.ros-group { padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.ros-group:last-of-type { border-bottom: none; }
.ros-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .8rem; }
.ros-head .g-name { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; }
.ros-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  border: 1.5px solid var(--line); background: var(--paper); color: var(--muted);
  font-family: inherit; font-size: .88rem; font-weight: 600; padding: .5rem .9rem;
  border-radius: 999px; cursor: pointer; transition: all .16s;
}
.chip:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.ros-none {
  font-size: .8rem; font-weight: 700; letter-spacing: .02em; color: var(--accent-deep);
  background: none; border: none; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}

/* ---- Photo upload -------------------------------------------------- */
.uploader {
  border: 2px dashed var(--line); border-radius: var(--r-lg); padding: 2.4rem 1.5rem;
  text-align: center; transition: all .2s; cursor: pointer; background: var(--paper);
}
.uploader:hover, .uploader.drag { border-color: var(--accent); background: var(--accent-tint); }
.uploader .u-icon { color: var(--accent-deep); margin-bottom: .8rem; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .7rem; margin-top: 1.2rem; }
.thumb { position: relative; aspect-ratio: 1; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 999px;
  background: rgba(20,39,28,.7); color: #fff; border: none; cursor: pointer; display: grid; place-items: center; font-size: .8rem;
}

/* ---- Review summary ------------------------------------------------ */
.summary { display: grid; gap: .2rem; }
.sum-row { display: flex; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.sum-row:last-child { border-bottom: none; }
.sum-k { flex: 0 0 38%; font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.sum-v { flex: 1; color: var(--ink); }
.sum-edit { background: none; border: none; color: var(--accent-deep); font-family: inherit; font-weight: 700; font-size: .82rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.consent { display: flex; gap: .8rem; align-items: flex-start; margin: 1.6rem 0; padding: 1.2rem; background: var(--cream-2); border-radius: var(--r-md); }
.consent input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--accent); flex: 0 0 auto; }
.consent label { font-size: .9rem; color: var(--muted); line-height: 1.5; }

/* ---- Footer nav (sticky) ------------------------------------------ */
.intake-foot {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem var(--gutter); border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--cream) 90%, transparent); backdrop-filter: blur(8px);
}
.back-btn { background: none; border: none; font-family: inherit; font-weight: 700; color: var(--muted); cursor: pointer; font-size: .95rem; padding: .6rem .4rem; display: inline-flex; align-items: center; gap: .4rem; transition: color .18s; }
.back-btn:hover { color: var(--ink); }
.back-btn:disabled { opacity: 0; pointer-events: none; }
.foot-hint { font-size: .8rem; color: var(--muted-light); display: none; }

/* ---- Confirmation -------------------------------------------------- */
.confirm { text-align: center; max-width: 560px; margin: 0 auto; padding-top: 4vh; }
.confirm .seal {
  width: 84px; height: 84px; border-radius: 999px; background: var(--accent-tint);
  border: 1.5px solid color-mix(in srgb, var(--accent) 35%, transparent);
  display: grid; place-items: center; margin: 0 auto 1.8rem; color: var(--accent-deep);
  animation: pop .5s cubic-bezier(.2,1.2,.4,1) both;
}
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.confirm-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.6rem; margin-top: 1.8rem; text-align: left; }
.confirm-card .cc-row { display: flex; gap: .7rem; align-items: center; padding: .5rem 0; color: var(--ink); }
.confirm-card .cc-row svg { color: var(--accent-deep); flex: 0 0 auto; }

@media (max-width: 720px) {
  .grid-2, .grid-3, .opt-list.two-col { grid-template-columns: 1fr; }
  .intake-bar .brand small { display: none; }
  .yn-q { max-width: 100%; }
  .yn-row { flex-direction: column; align-items: flex-start; gap: .7rem; }
  .foot-hint { display: none; }
}
@media (min-width: 900px) { .foot-hint { display: block; } }
