/* Synaptek Sample Intake — Precision White (Orderful-led; mono labels from SST) */
:root {
  --canvas: #f5f5f5;
  --surface: #ffffff;
  --ink: #0a0a0a;
  --graphite: #4a5565;
  --whisper: #99a1af;
  --border: #d4d4d4;
  --accent: #1d4ed8;          /* Synaptek synapse blue: CTA, active step, focus, links only */
  --accent-ink: #ffffff;
  --accent-tint: rgba(29, 78, 216, 0.14);
  --ok: #117025;              /* status only */
  --warn: #b45309;            /* status only */
  --err: #b91c1c;             /* validation only */
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px -1px rgba(0,0,0,.1);
  --sans: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 400 16px/1.5 var(--sans); }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
h1, h2, h3 { margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: 30px; line-height: 1.2; font-weight: 600; letter-spacing: -0.025em; }
h2 { font-size: 20px; line-height: 1.4; font-weight: 600; }
p { margin: 0; text-wrap: pretty; }
.muted { color: var(--graphite); }
.small { font-size: 14px; line-height: 1.43; }
.mono { font-family: var(--mono); }
.label { font: 500 11px/1.5 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--graphite); }

/* Header */
.top { background: var(--surface); border-bottom: 1px solid var(--border); }
.top-in { max-width: 1120px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand svg { width: 26px; height: 26px; display: block; }
.brand b { font-weight: 700; letter-spacing: 0.02em; font-size: 16px; }
.brand span { font: 500 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--graphite); margin-left: 6px; padding-left: 10px; border-left: 1px solid var(--border); }
.top nav a { font-size: 14px; color: var(--graphite); text-decoration: none; margin-left: 20px; }
.top nav a[aria-current] { color: var(--ink); font-weight: 600; }

/* Page shell */
main { max-width: 640px; margin: 0 auto; padding: 32px 20px 64px; }
.wide { max-width: 1120px; }
.intro { margin-bottom: 24px; }
.intro p { margin-top: 8px; color: var(--graphite); }

/* Path chooser (landing) */
.paths { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 24px 0 8px; }
.path { display: block; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); }
.path[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.path .label { margin-bottom: 6px; }
.path strong { display: block; font-size: 17px; font-weight: 600; }
.path .small { color: var(--graphite); margin-top: 4px; }

/* Panel = the form container (interaction container, so a card is justified) */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
@media (min-width: 720px) { .panel { padding: 32px; } }

/* Progress */
.progress { display: flex; gap: 6px; margin-bottom: 20px; }
.progress i { flex: 1; height: 4px; border-radius: 2px; background: var(--border); }
.progress i.on { background: var(--accent); }
.stepmeta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 4px; }
.step-title { margin: 0 0 4px; }
.step-help { color: var(--graphite); margin-bottom: 20px; }

/* Fields */
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label, .field > .label { display: flex; justify-content: space-between; gap: 8px; }
.field label em { font-style: normal; text-transform: none; letter-spacing: 0; color: var(--whisper); }
input, textarea, select {
  width: 100%; margin: 0; padding: 12px 14px; font: 400 16px/1.4 var(--sans); color: var(--ink);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); appearance: none;
}
input::placeholder, textarea::placeholder { color: var(--whisper); }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--err); }
.hint { font-size: 13px; color: var(--graphite); }
.error { font-size: 13px; color: var(--err); display: none; }
.field.invalid .error { display: block; }
.row { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
@media (min-width: 560px) { .row { grid-template-columns: 1fr 1fr; } .row.r-3-1 { grid-template-columns: 2fr 1fr; } }
.section-title { margin: 24px 0 12px; padding-top: 20px; border-top: 1px solid var(--border); }
.section-title:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.mono-input { font-family: var(--mono); text-transform: uppercase; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 24px; border-radius: var(--radius); border: 1px solid transparent; font: 600 15px/1 var(--sans); cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #1a44bf; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--ink); }
.btn-ghost { background: transparent; color: var(--graphite); padding-left: 8px; padding-right: 8px; }
.btn:disabled { opacity: .55; cursor: progress; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.btn svg { width: 16px; height: 16px; }
.actions { display: flex; flex-direction: column-reverse; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.actions .btn { width: 100%; }
@media (min-width: 560px) { .actions { flex-direction: row; justify-content: space-between; } .actions .btn { width: auto; } .actions .btn-primary { min-width: 180px; margin-left: auto; } }

/* Review */
.review { border-top: 1px solid var(--border); }
.review section { padding: 16px 0; border-bottom: 1px solid var(--border); }
.review header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.review header a { font-size: 14px; }
.review dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; }
.review dt { font: 500 11px/1.6 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--whisper); }
.review dd { margin: 0; font-size: 15px; }

/* Specimen tag — the memorable move: looks like the printed label */
.tag { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 20px; border: 1.5px solid var(--ink); border-radius: var(--radius); background: var(--surface); margin: 8px 0 20px; }
.tag .label { margin-bottom: 6px; }
.tag .id { font: 600 clamp(20px, 5vw, 30px)/1.1 var(--mono); letter-spacing: 0.02em; white-space: nowrap; }
.tag .qr { width: 84px; height: 84px; border: 1px solid var(--border); border-radius: 4px; display: grid; place-items: center; background: var(--surface); }
.tag .qr img { width: 72px; height: 72px; display: block; }
@media (max-width: 479px) { .tag { grid-template-columns: 1fr; } .tag .qr { justify-self: start; } }
.tag .status { margin-top: 8px; }

/* Status pill (semantic, never the accent) */
.status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font: 500 12px/1.6 var(--mono); letter-spacing: .04em; text-transform: uppercase; background: var(--ink); color: #fff; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status[data-s="complete"] { background: var(--ok); }
.status[data-s="on_hold"] { background: transparent; color: var(--warn); border: 1px solid var(--warn); }

/* Steps list (confirmation instructions) */
.steps { list-style: none; margin: 16px 0 0; padding: 0; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.steps li::before { content: counter(s, decimal-leading-zero); font: 500 12px/1.9 var(--mono); color: var(--whisper); }

/* Timeline */
.timeline { list-style: none; margin: 8px 0 0; padding: 0; }
.timeline li { position: relative; display: grid; grid-template-columns: 1fr; gap: 2px; padding: 12px 0 12px 22px; border-top: 1px solid var(--border); }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 19px; width: 8px; height: 8px; border-radius: 50%; background: var(--whisper); }
.timeline li:first-child::before { background: var(--ink); }
.timeline .when { font: 400 12px/1.6 var(--mono); color: var(--graphite); }
.timeline .note { color: var(--graphite); font-size: 14px; }
@media (min-width: 560px) { .timeline li { grid-template-columns: 170px 1fr; } .timeline .note { grid-column: 2; } }

/* Messages */
.msg { margin-top: 16px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--canvas); font-size: 14px; }
.msg.err { border-color: var(--err); color: var(--err); background: #fff; }
.msg.ok { border-color: var(--ok); color: var(--ok); background: #fff; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Admin */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 16px 0; }
.kv dt { font: 500 11px/1.7 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--whisper); }
.kv dd { margin: 0; }
.act-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
@media (max-width: 559px) { .act-row .btn { width: 100%; } }

footer { max-width: 1120px; margin: 0 auto; padding: 24px 20px; color: var(--whisper); font: 400 12px/1.6 var(--mono); border-top: 1px solid var(--border); }
@media (prefers-reduced-motion: no-preference) { .progress i { transition: background .2s; } }
.mt-6 { margin-top: 6px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-28 { margin-top: 28px; } .h-done { margin: 4px 0 12px; }
.step-title:focus { outline: none; }
@media (max-width: 480px) { .brand span { display: none; } .top nav a { margin-left: 14px; } }
.review section:last-child { border-bottom: 0; padding-bottom: 4px; }

/* ---------- Journey (tracking) ---------- */
.journey { margin-top: 20px; }
.journey figure { margin: 0; position: relative; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--canvas); }
.journey img { display: block; width: 100%; height: auto; }
.journey figcaption { position: absolute; left: 12px; bottom: 12px; padding: 6px 10px; background: rgba(255,255,255,.92); border: 1px solid var(--border); border-radius: 6px; font: 500 12px/1.5 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--ink); }
.stage-map { aspect-ratio: 16 / 9; }
.stage-map .fit { position: absolute; inset: 0; }
.map { position: absolute; inset: 0; width: 100%; height: 100%; }
@media (max-width: 559px) { .stage-map { aspect-ratio: 4 / 3; } .stage-map .fit { transform: scale(1.75); transform-origin: 48% 26%; } .stage-map img { position: absolute; top: 50%; transform: translateY(-50%); } }
.map .route { fill: none; stroke: var(--accent); stroke-width: .45; stroke-dasharray: 1.2 1; opacity: .9; }
.map .route-bg { fill: none; stroke: var(--graphite); stroke-width: .35; stroke-dasharray: .6 1.2; opacity: .45; }
.map .hop { fill: var(--surface); stroke: var(--graphite); stroke-width: .5; }
.map .hop.done { fill: var(--ink); stroke: var(--ink); }
.map .hop.now { fill: var(--accent); stroke: var(--accent); }
.map .pulse { fill: none; stroke: var(--accent); stroke-width: .5; opacity: 0; transform-box: fill-box; transform-origin: center; }
.map .pkg { offset-path: path("M70 24 Q 48 1 26 23"); offset-rotate: 0deg; offset-distance: var(--to, 0%); }
.map .pkg.to-0 { --to: 0%; } .map .pkg.to-50 { --to: 50%; } .map .pkg.to-100 { --to: 100%; }
.map .pkg rect { fill: var(--surface); stroke: var(--ink); stroke-width: .5; }
.map .pkg path { stroke: var(--accent); stroke-width: .5; fill: none; }
@media (prefers-reduced-motion: no-preference) {
  .map .route { stroke-dashoffset: 60; animation: draw 1.6s ease-out forwards; }
  .map .pkg { animation: ride 1.6s cubic-bezier(.4,0,.2,1) forwards; }
  .map .pulse { animation: pulse 2.2s ease-out 1.6s infinite; }
  .journey figure img { animation: fade .5s ease-out; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes ride { from { offset-distance: 0%; } to { offset-distance: var(--to, 0%); } }
@keyframes pulse { 0% { opacity: .8; transform: scale(.6); } 100% { opacity: 0; transform: scale(2.2); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.rail { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.rail li { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rail i { display: block; height: 4px; border-radius: 2px; background: var(--border); }
.rail li.done i { background: var(--ink); }
.rail li.now i { background: var(--accent); }
.rail span { font: 500 10px/1.3 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--whisper); }
.rail li.done span { color: var(--graphite); }
.rail li.now span { color: var(--accent); }
@media (max-width: 559px) { .rail { gap: 3px; } .rail li:not(.now) span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .rail li.now span { white-space: nowrap; } }
