/* High-contrast, large-format theme for low-vision / elderly patients.
   Brand: Neurolutions navy + azure accent. */
:root {
  --bg: #ffffff;
  --ink: #11151c;
  --muted: #4a5462;
  --brand: #0d3c63;        /* Neurolutions navy — primary actions/headers */
  --accent: #0d3c63;       /* primary buttons use the brand navy */
  --azure: #1e90d0;        /* bright accent (logo dot) — highlights/timer/progress */
  --accent-ink: #ffffff;
  --ok: #0a7d52;
  --rec: #c81e1e;
  --line: #c9d1dc;
  --panel: #f1f6fb;
  --figure: #0d3c63;
}
* { box-sizing: border-box; }

/* brand header */
.brand-header { padding: 8px 0 18px; border-bottom: 2px solid var(--line); margin-bottom: 22px; }
.brand-logo { height: 38px; width: auto; display: block; }
body {
  margin: 0;
  font: 20px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
#app { max-width: 1000px; margin: 0 auto; padding: 24px 20px 80px; }
h1 { font-size: 2.4rem; margin: 0 0 10px; }
h2 { font-size: 2rem; margin: 0 0 10px; }
.lead { font-size: 1.5rem; color: var(--ink); margin: 0 0 18px; }
.card {
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 26px;
  margin-bottom: 18px;
}
.hidden { display: none !important; }
.steps { padding-left: 26px; margin: 0 0 22px; font-size: 1.4rem; }
.steps li { margin-bottom: 14px; }

.field { display: block; margin: 18px 0; font-size: 1.3rem; font-weight: 600; }
.field select, .field input[type="text"] {
  display: block; margin-top: 8px; width: 100%; padding: 16px;
  background: #fff; color: var(--ink); border: 2px solid var(--line);
  border-radius: 10px; font-size: 1.4rem;
}
.toggle { display: flex; align-items: center; gap: 12px; font-size: 1.3rem;
  margin: 18px 0; font-weight: 600; }
.toggle input { width: 28px; height: 28px; }

/* big arm-choice buttons (replaces a dropdown for low-vision/elderly users) */
.side-choice { display: flex; gap: 14px; margin-top: 10px; flex-wrap: wrap; }
.side-choice .choice {
  flex: 1 1 180px; min-height: 84px; font-size: 1.4rem; font-weight: 700;
  background: #fff; color: var(--ink); border: 3px solid var(--line);
  border-radius: 14px; cursor: pointer; padding: 16px;
}
.side-choice .choice:hover { border-color: var(--accent); }
.side-choice .choice.selected {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
}

button {
  font: inherit; cursor: pointer; border-radius: 12px; padding: 14px 22px;
  border: 2px solid var(--line); background: #fff; color: var(--ink);
}
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.primary:disabled { background: #9bb0d8; border-color: #9bb0d8; cursor: default; }
button.big { font-size: 1.6rem; padding: 18px 34px; }
.controls { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 20px; }
.status { color: var(--muted); font-size: 1.2rem; min-height: 1.3em; }
.hint { color: var(--muted); font-size: 1rem; }

/* capture layout */
.prompt-wrap { display: flex; align-items: center; gap: 16px; margin-bottom: 18px;
  background: var(--panel); border-radius: 14px; padding: 14px 18px; }
.step-timer {
  flex: 0 0 auto; min-width: 72px; height: 72px; border-radius: 50%;
  display: grid; place-items: center; font-size: 2rem; font-weight: 800;
  color: var(--accent-ink); background: var(--azure);
}
.step-timer.low { background: var(--rec); }   /* last few seconds */

/* progress through the movement sequence */
.progress { margin: 0 0 16px; }
.progress-label { font-size: 1rem; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.progress-track { height: 10px; background: var(--line); border-radius: 6px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: var(--azure); transition: width .3s ease; }
.prompt-big {
  flex: 1; font-size: 2.1rem; font-weight: 800; line-height: 1.25; text-align: left;
  min-height: 2.4em; display: flex; align-items: center;
}
.guide-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .guide-grid { grid-template-columns: 1fr; } }
.panel-label { font-size: 1.2rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; text-align: center; }
.demo-panel svg { width: 100%; height: auto; max-height: 420px; background: var(--panel);
  border-radius: 14px; }
.demo3d { width: 100%; height: 420px; background: var(--panel); border-radius: 14px;
  overflow: hidden; }
.demo3d canvas { display: block; }
#demo line { stroke: var(--figure); stroke-width: 9; stroke-linecap: round; }
#demo #head { fill: var(--figure); }
#demo #lHand, #demo #rHand { fill: var(--figure); }
#demo #neck, #demo #torso, #demo #hips, #demo #shoulders,
#demo #lLeg, #demo #rLeg { stroke: #98a6bd; }

.stage { position: relative; width: 100%; aspect-ratio: 4/3; background: #000;
  border-radius: 14px; overflow: hidden; }
#video, #overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
#video { object-fit: cover; transform: scaleX(-1); }
#overlay { transform: scaleX(-1); }
.countdown { position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 7rem; font-weight: 900; color: #fff; text-shadow: 0 2px 16px #000; }
.rec { color: var(--rec); font-weight: 800; font-size: 1.4rem; letter-spacing: .03em; }

.scorebox { display: flex; gap: 24px; align-items: center; margin: 20px 0;
  padding: 24px; background: var(--panel); border-radius: 14px; }
.score-num { font-size: 4rem; font-weight: 900; color: var(--ok); line-height: 1; }
.score-num small { font-size: 1.3rem; color: var(--muted); font-weight: 600; }
.score-cap { font-size: 1.1rem; color: var(--muted); font-weight: 600; }
.score-label { font-weight: 700; font-size: 1.5rem; margin-bottom: 8px; }
.probs { display: flex; gap: 18px; color: var(--muted); font-size: 1.1rem; flex-wrap: wrap; }
.disclaimer { color: var(--muted); font-size: 1rem; border-top: 2px solid var(--line);
  padding-top: 14px; margin-top: 12px; }
.advanced summary { cursor: pointer; color: var(--muted); font-size: 1.1rem; }
