/* Fonts are bundled with the service (no outside requests): Fraunces for headings, Figtree for everything else. Both are SIL Open Font License. */
@font-face { font-family: "Fraunces"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/fraunces-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/figtree-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 500; font-style: normal; font-display: swap; src: url("/fonts/figtree-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/figtree-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/figtree-latin-700-normal.woff2") format("woff2"); }

:root {
  /* The page sets --accent (the clinic's colour), --accent-ink (text on it) and --accent-text (the accent darkened enough to read as text). */
  --accent: #0f5f6b;
  --accent-ink: #ffffff;
  --accent-text: #0f5f6b;
  --accent-soft: #eef5f6;
  --accent-line: #b9d3d7;
  --accent-strong: #0b4852;
  --ink: #14262b;
  --muted: #566870;
  --line: #dbe3e4;
  --control: #80959a; /* borders of things you can press or type in: at least 3:1 against white */
  --surface: #ffffff;
  --danger: #a4262c;
  --danger-soft: #fbeceb;
  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --body: "Figtree", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
}
@supports (color: color-mix(in srgb, red 10%, white)) {
  :root {
    --accent-soft: color-mix(in srgb, var(--accent) 8%, #ffffff);
    --accent-line: color-mix(in srgb, var(--accent) 32%, #ffffff);
    --accent-strong: color-mix(in srgb, var(--accent) 82%, #000000);
  }
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; padding: 16px; background: transparent; color: var(--ink); font: 16px/1.55 var(--body); -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }

.sheet {
  max-width: 46rem; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: clip;
  box-shadow: 0 1px 2px rgba(20, 38, 43, .06), 0 18px 40px -18px rgba(20, 38, 43, .22);
  border-top: 5px solid var(--accent);
}

/* ---------- clinic header ---------- */
.brand { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 20px 28px; border-bottom: 1px solid var(--line); }
.brand-text { flex: 1 1 14rem; min-width: 0; }
.brand-logo { display: block; height: 56px; width: auto; max-width: 200px; object-fit: contain; flex: none; }
.brand-mark { flex: none; width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 600 1.6rem/1 var(--display); }
.brand-name { margin: 0; font: 600 1.35rem/1.2 var(--display); letter-spacing: -.01em; }
.brand-meta { margin: 3px 0 0; color: var(--muted); font-size: .9rem; }
.brand-meta span + span::before { content: " \00b7  "; }
.brand-meta a { color: inherit; text-decoration: none; }
.brand-meta a:hover { text-decoration: underline; }

/* ---------- progress ---------- */
.steps-wrap { padding: 14px 28px 0; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.steps li { flex: 1; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .85rem; font-weight: 500; min-width: 0; }
.steps li::after { content: ""; flex: 1; height: 2px; background: var(--line); border-radius: 2px; margin-left: 4px; }
.steps li:last-child { flex: none; }
.steps li:last-child::after { display: none; }
.steps .num { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 700; background: #fff; border: 1.5px solid var(--line); color: var(--muted); }
.steps li.done { color: var(--accent-text); }
.steps li.done .num { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.steps li.done::after { background: var(--accent); }
.steps li[aria-current="step"] { color: var(--ink); font-weight: 700; }
.steps li[aria-current="step"] .num { border-color: var(--accent); color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-soft); }
@media (max-width: 560px) { .steps li:not([aria-current="step"]) .label { display: none; } .steps-wrap, .brand { padding-left: 18px; padding-right: 18px; } .brand-logo { height: 48px; max-width: min(100%, 220px); } .brand-meta span { display: block; } .brand-meta span + span::before { content: none; } }

/* ---------- content ---------- */
.panel { padding: 22px 28px 28px; }
@media (max-width: 560px) { .panel { padding: 18px 18px 24px; } body { padding: 10px; } }
@media (prefers-reduced-motion: no-preference) { .panel > * { animation: rise .28s ease both; } @keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } } }
h1 { margin: 0 0 4px; font: 600 1.65rem/1.2 var(--display); letter-spacing: -.012em; }
h1:focus { outline: none; }
h2 { margin: 1.4rem 0 .6rem; font-size: 1rem; font-weight: 700; }
p { margin: .5rem 0; max-width: 62ch; }
.lede { color: var(--muted); margin-top: 0; }
.note { color: var(--muted); }
a, .link { color: var(--accent-text); }

button { font: inherit; cursor: pointer; border-radius: 10px; min-height: 44px; color: inherit; }
:focus-visible { outline: 3px solid var(--accent-strong); outline-offset: 2px; }
.primary { background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); padding: .6rem 1.4rem; font-weight: 700; }
.primary:hover:not([disabled]) { background: var(--accent-strong); }
.primary[disabled] { background: #c9d3d5; border-color: #c9d3d5; color: #fff; cursor: not-allowed; }
.secondary { background: #fff; border: 1px solid var(--control); padding: .6rem 1.1rem; font-weight: 600; }
.secondary:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.link { background: none; border: none; text-decoration: underline; text-underline-offset: 3px; padding: .4rem 0; min-height: 0; font-weight: 600; }

/* step 1: services */
.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 12px; margin-top: 18px; }
.service { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; text-align: left; background: #fff; border: 1px solid var(--control); border-radius: var(--radius); padding: 16px 18px; min-height: 84px; transition: border-color .15s, box-shadow .15s, transform .15s; }
.service:hover { border-color: var(--accent); box-shadow: 0 6px 18px -10px rgba(20, 38, 43, .35); transform: translateY(-1px); }
.service-name { font: 600 1.12rem/1.25 var(--display); }
.service-meta { grid-column: 1; color: var(--muted); font-size: .9rem; }
.service-next { grid-column: 1; color: var(--accent-text); font-size: .85rem; font-weight: 600; margin-top: 4px; }
.service .chev { grid-column: 2; grid-row: 1 / span 3; color: var(--accent-text); }

/* step 2: provider, day, time */
.chosen { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 14px 0 4px; padding: 10px 14px; background: var(--accent-soft); border-radius: 12px; }
.chosen strong { font-weight: 700; }
.chosen .meta { color: var(--muted); font-size: .92rem; }
.chosen .link { margin-left: auto; }
.field-label { display: block; margin: 18px 0 8px; font-size: .85rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: #fff; border: 1px solid var(--control); border-radius: 999px; padding: .45rem 1rem; font-weight: 600; min-height: 40px; }
.chip:hover { border-color: var(--accent); }
.chip[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.with { color: var(--muted); margin: 14px 0 0; }
.field-row { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 8px; }
.field-row .field-label { margin: 0; }
.day-nav { display: flex; gap: 6px; }
.day-nav button { width: 36px; height: 36px; min-height: 0; padding: 0; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--control); background: #fff; color: var(--accent-text); }
.day-nav button:hover:not([disabled]) { border-color: var(--accent); background: var(--accent-soft); }
.day-nav button[disabled] { opacity: .35; cursor: default; }
.days { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: 0; scroll-snap-type: x proximity; scrollbar-width: thin; }
.day { flex: none; scroll-snap-align: start; width: 4.5rem; padding: 8px 4px; background: #fff; border: 1px solid var(--control); border-radius: 12px; display: grid; justify-items: center; line-height: 1.15; min-height: 0; }
.day .dow { font-size: .74rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.day .dom { font: 600 1.45rem/1.2 var(--display); }
.day .mon { font-size: .74rem; color: var(--muted); }
.day:hover { border-color: var(--accent); }
.day[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.day[aria-pressed="true"] .dow, .day[aria-pressed="true"] .mon { color: inherit; opacity: .85; }
.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.4rem, 1fr)); gap: 8px; }
.time { background: #fff; border: 1px solid var(--control); border-radius: 10px; padding: 8px 6px; font-weight: 700; color: var(--accent-text); display: grid; justify-items: center; line-height: 1.2; }
.time small { font-weight: 500; font-size: .74rem; color: var(--muted); }
.time:hover { background: var(--accent-soft); border-color: var(--accent); }
.time[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.time[aria-pressed="true"] small { color: inherit; opacity: .9; }
.tznote { color: var(--muted); font-size: .85rem; margin-top: 12px; }
.actionbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.actionbar .picked { color: var(--muted); font-size: .95rem; min-width: 0; flex: 1 1 14rem; }
.actionbar .picked strong { color: var(--ink); }
.actionbar .buttons { display: flex; gap: 10px; }
@media (max-width: 560px) { .actionbar .buttons { width: 100%; } .actionbar .buttons .primary { flex: 1; } }

/* step 3: details form */
.summary { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; margin: 14px 0 6px; padding: 12px 16px; background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: 0 12px 12px 0; }
.summary strong { display: block; font-weight: 700; }
.summary .s-sub { color: var(--muted); font-size: .92rem; }
label { display: block; font-weight: 600; margin: 16px 0 5px; font-size: .95rem; }
.hint { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=tel], input[type=date], textarea {
  width: 100%; font: inherit; color: inherit; background: #fff; border: 1px solid var(--control); border-radius: 10px; padding: .65rem .8rem; min-height: 46px;
}
input:focus, textarea:focus { border-color: var(--accent); outline: 3px solid var(--accent-soft); }
textarea { min-height: 4.8rem; resize: vertical; }
input.code { font: 600 1.7rem/1 var(--display); letter-spacing: .45em; text-align: center; max-width: 13rem; padding-left: .9em; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; gap: 0; } }
.check { display: flex; gap: .65rem; align-items: flex-start; font-weight: 400; margin: 16px 0 0; }
.check input { margin: .28rem 0 0; width: 1.2rem; height: 1.2rem; flex: none; accent-color: var(--accent); }
.error { background: var(--danger-soft); color: var(--danger); border-left: 4px solid var(--danger); padding: .7rem 1rem; border-radius: 0 10px 10px 0; margin: 14px 0; font-weight: 500; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* result */
.done-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin: 4px 0 14px; }
.facts { margin: 18px 0; padding: 4px 18px; border: 1px solid var(--line); border-radius: var(--radius); }
.facts div { display: grid; grid-template-columns: 7rem 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); font-weight: 500; }
.facts dd { margin: 0; font-weight: 600; }
@media (max-width: 560px) { .facts div { grid-template-columns: 5.2rem 1fr; gap: 8px; } }
.spinner { width: 1.1rem; height: 1.1rem; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; display: inline-block; vertical-align: -.2em; margin-right: .6rem; }
@media (prefers-reduced-motion: no-preference) { .spinner { animation: spin .9s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } } }

/* ---------- medical history form (form.html) ---------- */
.qsection { margin: 22px 0 0; padding: 0; border: 0; min-width: 0; }
.qsection > h2 { margin: 0 0 6px; font: 600 1.2rem/1.3 var(--display); }
.qrow { padding: 12px 0; border-bottom: 1px solid var(--line); }
.qrow:last-child { border-bottom: 0; }
.qrow.invalid { background: var(--danger-soft); border-radius: 10px; padding: 12px; border-bottom-color: transparent; }
.qrow legend, .qrow > label { padding: 0; margin: 0 0 8px; font-weight: 600; }
.qrow .qhint { margin: -4px 0 8px; color: var(--muted); font-size: .9rem; }
.yesno { display: flex; gap: 8px; }
.yesno label { margin: 0; display: block; }
.yesno input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.yesno span { display: grid; place-items: center; min-width: 4.5rem; min-height: 44px; padding: 0 1.1rem; border: 1px solid var(--control); border-radius: 999px; background: #fff; font-weight: 700; cursor: pointer; }
.yesno input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.yesno input:focus-visible + span { outline: 3px solid var(--accent-strong); outline-offset: 2px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 4px 16px; }
.checks .check { margin: 8px 0 0; }
.counts { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 0 14px; }
input[type=number] { width: 100%; font: inherit; color: inherit; background: #fff; border: 1px solid var(--control); border-radius: 10px; padding: .65rem .8rem; min-height: 46px; }
.dgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .dgrid { grid-template-columns: 1fr; } }
.sigbox { margin-top: 8px; border: 1px dashed var(--control); border-radius: 12px; background: #fff; }
.sigbox canvas { display: block; width: 100%; height: auto; aspect-ratio: 3 / 1; touch-action: none; cursor: crosshair; border-radius: 12px; }
.sigtools { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; color: var(--muted); font-size: .9rem; }
.declare { margin-top: 26px; padding: 16px 18px; background: var(--accent-soft); border-radius: var(--radius); }
.declare h2 { margin-top: 0; }
.privacy { margin-top: 18px; color: var(--muted); font-size: .88rem; }
.dob-row { max-width: 14rem; }
.qrow .qnote { margin: -4px 0 8px; color: var(--accent-text); font-size: .9rem; font-weight: 600; }
.onfile { margin: 8px 0 0; padding-left: 1.2rem; color: var(--ink); }

/* ---------- time list grouped by day ---------- */
.timelist { margin-top: 6px; }
.daygroup h2 { font: 600 1.05rem/1.3 var(--display); margin: 18px 0 8px; }
.timelist .more { margin-top: 18px; }
