/*
 * The look of the records request demo: black on white, as the wireframes.
 * Every page under /demo/ loads this file. A page's own styles go in its own
 * <style> or in a css file in its own folder.
 *
 * The wireframes name Inter, Space Grotesk and JetBrains Mono. The demo loads
 * no font from another host, so the system fonts stand in.
 */
:root {
  --ink: #111413;
  --muted: #5F6764;
  --line: #D5D9D7;
  --paper: #FFFFFF;
  --soft: #F7F8F7;
  --chip: #F3F4F3;
  --nav: #ECEEED;
  --backdrop: #7C8381;
  --backdrop-ink: #E9ECEA;
  --wait-bg: #FFF6E3;
  --wait-line: #B98A3A;
  --accent: #111413;            /* the consumer's one color; the patient flow sets it from the state */
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.35; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn:focus-visible { outline-offset: 3px; }

/* The one line on every page, outside the screen. state.js puts it there. */
.demo-line { margin: 0; padding: 8px 16px; background: var(--soft); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 16px; text-align: center; }
.demo-line a { margin-left: 8px; color: var(--muted); }

/* A page's own demo controls ([data-demo-box], the records desk): demo chrome, dashed, not a product screen. */
.demo-box { width: fit-content; max-width: calc(100% - 32px); margin: 12px auto 0 auto; padding: 8px 14px; border: 1px dashed var(--muted); border-radius: 8px; background: var(--soft); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 13px; line-height: 18px; }
.demo-tag { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* Words */
.brand { font-family: var(--display); font-weight: 700; letter-spacing: 0.04em; }
.h1 { font-family: var(--display); font-size: 26px; line-height: 1.2; font-weight: 700; }
.h2 { font-size: 16px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.grow { flex-grow: 1; }

/* Buttons: .btn is the black one, .btn-line the outline one. .btn-lg is the 56px button of the patient flow. */
.btn, .btn-line { display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 18px; border-radius: 8px; font-weight: 600; text-decoration: none; text-align: center; }
.btn { background: var(--ink); color: #FFFFFF; border: 1px solid var(--ink); }
.btn-line { background: var(--paper); color: var(--ink); border: 1px solid var(--muted); }
.btn-lg { height: 56px; font-size: 17px; }
.btn-md { height: 50px; }
.btn-block { display: flex; width: 100%; flex: none; }
.btn[disabled], .btn[aria-disabled="true"] { background: var(--line); border-color: var(--line); color: var(--muted); cursor: not-allowed; }
.btn-line[disabled] { color: var(--muted); border-color: var(--line); cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; color: var(--ink); font-weight: 600; text-decoration: underline; }

/* Fields */
.field { display: flex; flex-direction: column; gap: 4px; }
.field > label, .field > .label { font-size: 13px; color: var(--muted); }
.input { height: 44px; width: 100%; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); }
.input-lg { height: 48px; padding: 0 14px; }
/* One date is a month and a year, side by side (/demo/month-field.js) */
.month-row { display: flex; gap: 8px; }
.month-row .input { min-width: 0; padding: 0 8px; }
.month-row .input:first-child { flex: 3 1 0; }
.month-row .input:last-child { flex: 2 1 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.4; }
.check input, input.box { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--ink); }

/* Card, pill, chips, rows */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
a.card { text-decoration: none; color: var(--ink); }
.pill { display: inline-block; font-size: 12px; font-weight: 600; background: var(--chip); border: 1px solid var(--ink); border-radius: 10px; padding: 2px 10px; white-space: nowrap; }
.pill-wait { background: var(--wait-bg); border-color: var(--wait-line); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); font-size: 14px; }
.chip[aria-pressed="true"], .chip[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: #FFFFFF; font-weight: 600; }
.rows > * { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.rows > * > :first-child { color: var(--muted); }
.rows > * > :last-child { text-align: right; }
.code { margin: 0; padding: 14px; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; font-family: var(--mono); font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Tables of the consumer and the producer */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 13px; font-weight: 500; color: var(--muted); padding: 12px 16px; background: var(--soft); white-space: nowrap; }
.table td { padding: 14px 16px; border-top: 1px solid var(--line); }
.table a { font-weight: 600; }
.stats { display: flex; flex-wrap: wrap; gap: 12px; }
.stat { flex: 1 1 140px; border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.stat b { display: block; font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }

/* The desk layout of the consumer and the producer: a side column and the main part. */
.app { min-height: calc(100vh - 33px); display: flex; flex-wrap: wrap; }
.side { flex: 1 1 200px; border-right: 1px solid var(--line); padding: 24px 20px; display: flex; flex-direction: column; gap: 6px; }
.side .who { font-size: 13px; color: var(--muted); padding-bottom: 14px; }
.side a { padding: 12px; border-radius: 8px; text-decoration: none; }
.side a[aria-current="page"] { background: var(--nav); font-weight: 600; }
.main { flex: 999 1 560px; min-width: 0; padding: 32px; display: flex; flex-direction: column; gap: 20px; }
.cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.cols > * { flex: 1 1 360px; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 20px; }

/* The phone layout of the patient portal and the link page: one column, 390px on a wide screen. */
.phone { width: 100%; max-width: 390px; min-height: calc(100vh - 33px); margin: 0 auto; display: flex; flex-direction: column; background: var(--paper); }
@media (min-width: 480px) { .phone { min-height: 844px; margin: 24px auto; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; } }
.phone-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.phone-body { flex-grow: 1; min-height: 0; padding: 24px 20px; display: flex; flex-direction: column; gap: 16px; }
.tabs { display: flex; border-top: 1px solid var(--line); }
.tabs a { flex: 1 1 0; height: 56px; display: flex; align-items: center; justify-content: center; text-decoration: none; font-size: 14px; font-weight: 600; color: var(--muted); border-top: 3px solid transparent; }
.tabs a[aria-current="page"] { color: var(--ink); border-top-color: var(--ink); }

/* The panel of the patient flow: a white sheet on top of the consumer's page. */
.backdrop { background: var(--backdrop); color: var(--backdrop-ink); }
.panel { background: var(--paper); color: var(--ink); border-radius: 16px 16px 0 0; padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; font-size: 15px; line-height: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; }
.panel-head .brand { letter-spacing: 0.06em; font-size: 14px; }
.icon-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: none; border: 0; padding: 0; border-radius: 8px; font-size: 20px; color: var(--ink); text-decoration: none; }
.progress { display: flex; gap: 6px; height: 4px; }
.progress > * { flex: 1 1 0; height: 4px; border-radius: 2px; background: var(--line); }
.progress > .on { background: var(--accent); }
.panel h1 { font-size: 20px; line-height: 26px; font-weight: 600; text-align: center; padding-top: 12px; }
.panel .field > label { font-size: 12px; }
.panel .btn { background: var(--accent); border-color: var(--accent); }
.panel .btn[disabled], .panel .btn[aria-disabled="true"] { background: var(--line); border-color: var(--line); }
.legal { font-size: 12px; line-height: 16px; color: var(--muted); text-align: center; }

@media (max-width: 640px) {
  .main { padding: 20px 16px; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); padding: 16px; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .side .brand, .side .who { padding-bottom: 0; }
  .side .who { flex: 1 1 auto; }
  .side a { padding: 10px 12px; }
  .app { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
