/* App-specific additions to the kiosk shell (kiosk.css) and desk shell
   (desk.css): the QR display, identity-flow cards, and the doctor visit list.
   Loaded after tokens.css / components.css / kiosk.css / desk.css. */

/* ---------- kiosk QR display (kiosk.html) ---------- */
/* Start button and QR code as one matched pair, not two mismatched sizes
   loosely centered against each other - both sit in a 220px square so their
   edges actually line up, with an "or" divider standing in for the empty
   gap that used to sit between them. */
.start-options { display: flex; align-items: center; justify-content: center; gap: var(--s-6); flex-wrap: wrap; margin-top: var(--s-6); }
.start-option { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-3); }
.start-option-caption { margin: 0; font-size: var(--t-sm); color: var(--c-ink-3); }
.start-btn {
  width: auto; white-space: nowrap; text-align: center;
  padding: var(--s-5) var(--s-6); border-radius: var(--r-pill);
}

/* Stretches to match whichever side is taller (the QR card, in practice) so
   the two dividing lines run its full height instead of a fixed guess. */
.start-divider {
  align-self: stretch; display: flex; flex-direction: column; align-items: center;
  color: var(--c-ink-3); font-size: var(--t-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
}
.start-divider::before, .start-divider::after { content: ""; flex: 1; width: 1px; background: var(--c-line); }
.start-divider span { margin: var(--s-2) 0; }
@media (max-width: 560px) {
  .start-divider { flex-direction: row; align-self: stretch; width: 100%; }
  .start-divider::before, .start-divider::after { height: 1px; }
  .start-divider span { margin: 0 var(--s-2); }
}

.qr-frame {
  background: #fff; padding: var(--s-4); border-radius: var(--r-lg); box-shadow: var(--shadow-1);
  border: 1px solid var(--c-line-soft); line-height: 0; display: inline-block;
}
.qr-frame img { width: 260px; height: 260px; display: block; }
.qr-url { font-family: var(--font-mono); font-size: var(--t-sm); color: var(--c-ink-3); }
.qr-refresh { font-size: var(--t-xs); color: var(--c-ink-3); }

/* ---------- token slip print (patient.html #step-slip) ---------- */
@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  body * { visibility: hidden; }
  #step-slip, #step-slip * { visibility: visible; }
  #step-slip { position: absolute; top: 0; left: 0; width: 100%; }
  .no-print { display: none !important; }
  /* Neither the on-screen instruction ("Thank you, please take your
     slip") nor the printer illustration belong on the physical receipt -
     a real printer doesn't draw a heading or a picture of itself onto
     the paper it feeds out. Only the slip prints, at receipt width. */
  #step-slip > h1 { display: none !important; }
  .printer { display: none !important; }
  .paper-track { width: 320px !important; max-width: none !important; margin: 0 auto !important; }
  .paper {
    box-shadow: none !important; clip-path: none !important;
    animation: none !important; transform: none !important;
  }
  .paper::before, .paper::after, .paper-curl { display: none !important; }
}

/* ---------- identity / registration screens (patient.html) ---------- */
.identity-step { display: none; }
.identity-step.active { display: grid; gap: var(--s-4); }

.big-choice { display: grid; gap: var(--s-3); }

/* .opt-chip carries .k-chip for the base look; this only adjusts sizing so
   three gender chips read as one row rather than the wider kiosk chip. */
.opt-chip { padding: var(--s-2) var(--s-4); font-size: var(--t-base); }

.masked-card { display: flex; flex-direction: column; gap: 3px; align-items: center; padding: var(--s-4); }
.masked-card .label { font-size: var(--t-sm); color: var(--c-ink-3); }
.masked-card .name { font-family: var(--font-mono); font-size: var(--t-lg); letter-spacing: .1em; }

.confirm-card { display: flex; flex-direction: column; gap: var(--s-4); }
.confirm-who { display: flex; align-items: center; gap: var(--s-4); }
.confirm-avatar {
  flex: none; width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(155deg, var(--c-brand-dark), var(--c-brand)); color: #fff;
  font-weight: 700; font-size: var(--t-lg); letter-spacing: .02em;
}
.confirm-who-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.confirm-who-text strong { font-size: var(--t-lg); }
.confirm-who-text span { font-size: var(--t-sm); color: var(--c-ink-2); text-transform: capitalize; }
.confirm-hsid {
  display: inline-block; margin-top: 4px; width: fit-content;
  font-size: var(--t-xs); letter-spacing: .04em; text-transform: none;
  color: var(--c-ink-3); background: var(--c-surface-2); border-radius: var(--r-sm); padding: 2px 8px;
}
.confirm-history {
  margin: 0; padding: var(--s-3) var(--s-4); border-radius: var(--r-md);
  background: var(--c-brand-soft); color: var(--c-brand-dark); font-size: var(--t-sm); font-weight: 550;
}
/* Written by a doctor, addressed to the patient - see app/prescriptions.py.
   A left accent bar (not the solid brand-soft fill .confirm-history uses)
   so it doesn't read as the same kind of message as the aggregate line
   above it - this one is a doctor's own words, not a computed summary. */
.confirm-prescription {
  padding: var(--s-3) var(--s-4); border-left: 3px solid var(--c-brand);
  background: var(--c-surface-2); border-radius: 0 var(--r-md) var(--r-md) 0;
}
.confirm-prescription-label {
  font-size: 9px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--c-brand); font-weight: 700; margin-bottom: 2px;
}
.confirm-prescription-date { font-size: var(--t-xs); color: var(--c-ink-3); margin-bottom: var(--s-2); }
.confirm-prescription-text { margin: 0; font-size: var(--t-sm); color: var(--c-ink); white-space: pre-wrap; }

.phone-row { gap: var(--s-2); align-items: stretch; }
.phone-row .country-code { flex: 0 0 auto; width: auto; max-width: 108px; }
.phone-row input { flex: 1 1 auto; min-width: 0; }

/* .identity-actions itself needs no layout rule: a lone .k-btn is already
   block-level and full width, and a two-button row carries .k-btn-row
   (kiosk.css) for the side-by-side grid. */
.identity-hint { font-size: var(--t-sm); color: var(--c-ink-3); margin: 0; }

/* ---------- doctor page (doctor.html) ---------- */
.doctor-list { display: grid; gap: var(--s-3); }
.visit-row {
  display: grid; grid-template-columns: 96px 1fr auto auto; gap: var(--s-4); align-items: center;
  background: var(--c-surface); border: 1px solid var(--c-line-soft); border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4); cursor: pointer; text-align: left; width: 100%; font: inherit; color: inherit;
}
.visit-row:hover { border-color: var(--c-brand); }
.visit-row .who { display: flex; flex-direction: column; gap: 2px; }
.visit-row .who strong { font-size: var(--t-base); }
.visit-row .who span { font-size: var(--t-xs); color: var(--c-ink-3); }
.visit-row .complaint { font-size: var(--t-sm); color: var(--c-ink-2); }
.visit-row .when { font-size: var(--t-xs); color: var(--c-ink-3); white-space: nowrap; }
.triage-pill { font-size: var(--t-xs); font-weight: 700; letter-spacing: .05em; padding: 4px 10px; border-radius: var(--r-pill); text-align: center; }
.triage-pill.EMERGENCY { color: #fff; background: var(--c-red); }
.triage-pill.URGENT { color: var(--c-orange); background: var(--c-orange-bg); }
.triage-pill.ROUTINE { color: var(--c-blue); background: var(--c-blue-bg); }
.triage-pill.SELF_CARE { color: var(--c-green); background: var(--c-green-bg); }
.triage-pill.incomplete, .triage-pill.none { color: var(--c-ink-3); background: var(--c-bg); border: 1px solid var(--c-line); }

.doctor-detail { display: none; }
.doctor-detail.active { display: grid; gap: var(--s-5); }
.doctor-back { align-self: start; }
.transcript-view { display: flex; flex-direction: column; gap: var(--s-3); max-height: 46vh; overflow-y: auto; }

@media (max-width: 640px) {
  .visit-row { grid-template-columns: 1fr auto; grid-template-areas: "who pill" "complaint complaint" "when when"; }
  .visit-row .who { grid-area: who; }
  .visit-row .triage-pill { grid-area: pill; }
  .visit-row .complaint { grid-area: complaint; }
  .visit-row .when { grid-area: when; }
}
