/* ============================================================
   Jordan Law — Case Review Intake v2
   Visual system transcribed from the Claude Design source
   ("Case Review Intake v2.dc.html"). Tokens first, then layout.
   ============================================================ */

:root {
  --navy:        #0a2540;
  --blue:        #1378b8;
  --blue-hover:  #165f99;
  --blue-deep:   #133f73;
  --blue-soft:   #6fb3db;
  --blue-tint:   #f0f6fb;
  --gold:        #b8863a;

  --ink:         #1a1d21;
  --ink-2:       #2a2f36;
  --ink-3:       #3f4651;
  --ink-4:       #5a626e;
  --ink-5:       #7b8390;
  --ink-6:       #9ba3ae;

  --border:      #c2c7cf;
  --rule:        #e0e3e8;
  --track:       #eff1f4;
  --danger:      #b23b3b;

  --on-navy:     rgba(255, 255, 255, 0.72);
  --on-navy-str: rgba(255, 255, 255, 0.88);

  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans:  Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --panel-w: 380px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-deep); text-decoration: underline; }

input::placeholder,
textarea::placeholder { color: var(--ink-6); }

@keyframes stepIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

/* ── Split shell ─────────────────────────────────────────── */

.split {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: stretch;
}

.panel {
  width: var(--panel-w);
  flex: none;
  background: var(--navy);
  color: #fff;
  padding: 44px 40px;
  display: flex;
  flex-direction: column;
}

.panel-logo-link { align-self: flex-start; }
.panel-logo-link:hover { text-decoration: none; }
.panel-logo { height: 44px; width: auto; display: block; }

.panel-mid {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.panel-rule { height: 2px; width: 48px; background: var(--gold); margin-bottom: 20px; }

.panel-h {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 34px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0;
}

/* Quiet trust line — deliberately understated against the headline.
   A wrapping flex row so phrases never break mid-item and no
   separator is ever stranded at the end of a line. */
.panel-trust {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 20px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--on-navy);
  margin: 22px 0 0;
  padding: 0;
}

.panel-trust li { white-space: nowrap; }

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
}

/* ── Header, progress, footer ────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 14px 28px;
  border-bottom: 1px solid var(--rule);
  min-height: 49px;
}

.call-link { font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
.call-link strong { font-weight: 700; color: var(--navy); }
.call-link:hover { color: var(--ink-2); }

.progress { height: 3px; background: var(--track); }
.progress-fill { height: 3px; width: 0; background: var(--blue); transition: width 360ms var(--ease); }

.foot {
  border-top: 1px solid var(--rule);
  padding: 16px 24px;
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: var(--ink-5);
}

/* ── Stage ───────────────────────────────────────────────── */

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 32px 64px;
}

.step { animation: stepIn 360ms var(--ease); }

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 14px;
}

.q-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(26px, 3.4vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink-2);
  margin: 0 0 10px;
}
.q-title:focus { outline: none; }

.q-sub { font-size: 15px; color: var(--ink-4); margin: 0 0 6px; }

.q-enc {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-5);
  margin: 0 0 28px;
}

.q-spacer { height: 22px; }

/* ── Single-choice list ──────────────────────────────────── */

.picks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.pick {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  padding: 16px 18px;
  border-radius: 4px;
  background: #fff;
  border: 1px solid var(--border);
  transition: background 160ms, border-color 160ms, box-shadow 160ms;
}
.pick:hover { border-color: var(--blue); background: var(--blue-tint); }
.pick[aria-pressed="true"] {
  background: var(--blue-tint);
  border-color: var(--blue);
  box-shadow: inset 0 0 0 0.5px var(--blue);   /* = the 1.5px selected border, without reflow */
}

.key {
  flex: none;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  border-radius: 3px;
  background: #fff;
  color: var(--ink-4);
  border: 1px solid var(--border);
  transition: background 160ms, color 160ms;
}
.pick[aria-pressed="true"] .key { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ── Multi-select chips ──────────────────────────────────── */

.chips { display: flex; flex-wrap: wrap; gap: 10px; }

.chip {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  padding: 12px 18px;
  border-radius: 4px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--ink-3);
  transition: background 160ms, border-color 160ms, color 160ms, box-shadow 160ms;
}
.chip:hover { border-color: var(--blue); }
.chip[aria-pressed="true"] {
  background: var(--blue-tint);
  color: var(--blue-deep);
  border-color: var(--blue);
  box-shadow: inset 0 0 0 0.5px var(--blue);
}
.chip .tick { font-weight: 700; }

/* ── Fields ──────────────────────────────────────────────── */

.field { display: flex; flex-direction: column; gap: 6px; }
.field-date { max-width: 280px; }
.field-text { max-width: 420px; }

.label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.req { color: var(--danger); }

.input, .textarea {
  font-family: var(--sans);
  font-size: 16px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--ink);
  background: #fff;
  width: 100%;
  transition: border-color 160ms, box-shadow 160ms;
}
.textarea { padding: 16px; line-height: 1.6; resize: vertical; }

.input:focus, .textarea:focus {
  outline: 0;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(19, 120, 184, 0.15);
}
.input[aria-invalid="true"] { border-color: var(--danger); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(178, 59, 59, 0.15); }

.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.contact-grid .span-all { grid-column: 1 / -1; }

/* ── SMS consent ─────────────────────────────────────────── */

.consent {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 22px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--blue-tint);
  cursor: pointer;
}

.consent-box {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--blue);
  cursor: pointer;
}

.consent-text {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-3);
  text-wrap: pretty;
}

.consent-box[aria-invalid="true"] { outline: 2px solid var(--danger); outline-offset: 2px; }

.err { font-size: 12.5px; color: var(--danger); margin: 0; min-height: 1em; }
.fine { font-size: 13px; color: var(--ink-5); margin: 16px 0 0; }

/* ── Actions ─────────────────────────────────────────────── */

.actions { display: flex; align-items: center; gap: 16px; margin-top: 32px; flex-wrap: wrap; }

.btn {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  border: 0;
  cursor: pointer;
  padding: 14px 26px;
  border-radius: 4px;
  background: var(--blue);
  color: #fff;
  white-space: nowrap;
  transition: background 200ms;
}
.btn:hover { background: var(--blue-hover); }
.btn[aria-disabled="true"] { background: var(--ink-6); cursor: not-allowed; }
.btn[aria-disabled="true"]:hover { background: var(--ink-6); }
.btn .arrow { margin-left: 6px; }
.btn[data-busy="true"] { opacity: 0.75; pointer-events: none; }

.btn-quiet {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-4);
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 12px 4px;
}
.btn-quiet:hover { color: var(--blue); }
.btn-skip { color: var(--blue); }
.btn-skip:hover { color: var(--blue-deep); }

.hint { font-size: 12.5px; color: var(--ink-5); margin: 14px 0 0; }
.hint kbd {
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  border: 1px solid var(--border); border-radius: 3px;
  padding: 1px 5px; color: var(--ink-4); background: #fff;
}

:where(button, a, input, textarea):focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* ── Confirmation card ───────────────────────────────────── */

.done {
  animation: stepIn 360ms var(--ease);
  background: var(--navy);
  border-radius: 6px;
  padding: clamp(32px, 5vw, 56px);
  color: #fff;
  box-shadow: 0 16px 40px rgba(10, 37, 64, 0.12);
}

.done-mark { height: 36px; width: auto; display: block; margin-bottom: 24px; }
.done-eyebrow { color: var(--blue-soft); }

.done-h {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(26px, 3.4vw, 34px);
  line-height: 1.2;
  color: #fff;
  margin: 14px 0 12px;
}

.done-p {
  font-size: 16px;
  line-height: 1.65;
  color: var(--on-navy);
  margin: 0 0 32px;
  max-width: 52ch;
}

.done-steps { display: flex; flex-direction: column; gap: 18px; margin-bottom: 36px; }
.done-step { display: flex; gap: 14px; align-items: baseline; }
.done-n { font-family: var(--serif); font-size: 20px; color: var(--gold); flex: none; width: 24px; }
.done-t { font-size: 15.5px; line-height: 1.55; color: var(--on-navy-str); }

.done-cta {
  display: inline-block;
  font-weight: 600;
  font-size: 15px;
  padding: 14px 26px;
  border-radius: 4px;
  background: var(--blue);
  color: #fff;
}
.done-cta:hover { background: var(--blue-hover); color: #fff; text-decoration: none; }

.done-note { font-size: 12.5px; color: var(--on-navy); margin: 20px 0 0; }

/* Quiet exit — deliberately subordinate to the call CTA above it. */
.done-back {
  /* block + fit-content puts it on its own line below the CTA while
     keeping the underline tight to the text, not the full column. */
  display: block;
  width: fit-content;
  margin-top: 24px;
  font-size: 13.5px;
  color: var(--on-navy);
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
  padding-bottom: 2px;
  transition: color 160ms, border-color 160ms;
}
.done-back:hover {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 860px) {
  .split       { flex-direction: column; }
  .panel       { width: auto; min-height: 0; padding: 18px 22px 20px; }
  .panel-mid   { justify-content: flex-start; }
  .panel-rule  { display: none; }
  .panel-h     { font-size: 19px; margin-top: 12px; }
  .panel-trust { font-size: 10.5px; margin-top: 8px; gap: 4px 14px; }
  .panel-logo  { height: 26px; }
}

@media (max-width: 620px) {
  .stage        { padding: 32px 20px 48px; }
  .picks        { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .btn          { flex: 1 1 auto; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .step, .done { animation: none; }
  .progress-fill { transition: none; }
  * { scroll-behavior: auto !important; }
}
