/* Tokens. The three cue colours come from stage management:
   green = go, amber = wrap up, red = time is up. */
:root {
  --floor: #e9edf2;
  --surface: #ffffff;
  --surface-2: #f4f6f9;
  --ink: #1c2433;
  --muted: #5e687a;
  --line: #cfd6e0;
  --line-strong: #aeb8c6;
  --go: #1e9a55;
  --go-ink: #ffffff;
  --wrap: #e3a11a;
  --stop: #d2403a;
  --stage: #0f1a2e;
  --stage-ink: #f3f6fa;
  --focus: #2f6fd6;

  --font: "IBM Plex Sans Hebrew", "Segoe UI", "Arial Hebrew", Arial, sans-serif;
  --digits: "Barlow Condensed", "Arial Narrow", var(--font);

  --r-panel: 12px;
  --r-control: 8px;
  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.5625rem;
  --step-3: 2.4414rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.55;
  color: var(--ink);
  background: var(--floor);
}
h1, h2, h3 { line-height: 1.2; margin: 0; font-weight: 600; }
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* -------------------------------------------------------------- controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  min-height: 2.5rem; padding: .45rem 1rem;
  font: inherit; font-weight: 500; line-height: 1.2; text-decoration: none; white-space: nowrap;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r-control);
  cursor: pointer;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { color: #fff; background: var(--ink); border-color: var(--ink); }
.btn-primary:hover { background: #2c3850; }
.btn-go { color: var(--go-ink); background: var(--go); border-color: var(--go); }
.btn-go:hover { background: #188448; }
.btn-quiet { border-color: transparent; background: transparent; }
.btn-quiet:hover { background: rgba(28, 36, 51, .06); }
.btn-danger { color: var(--stop); }
.btn-danger.is-armed { color: #fff; background: var(--stop); border-color: var(--stop); }
.btn-icon { min-width: 2.5rem; padding-inline: .5rem; }
.btn svg { width: 1.15em; height: 1.15em; flex: none; }

.field { display: grid; gap: .3rem; }
.field > span { font-size: var(--step--1); font-weight: 500; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="time"], textarea, select {
  width: 100%; min-height: 2.5rem; padding: .45rem .7rem;
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r-control);
}
input[type="number"], input[type="time"] { direction: ltr; text-align: center; }
textarea { min-height: 8rem; resize: vertical; line-height: 1.5; }
select { cursor: pointer; }
input::placeholder, textarea::placeholder { color: #8c95a5; }

.check { display: flex; align-items: center; gap: .55rem; cursor: pointer; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--ink); }

/* ------------------------------------------------------------------ toast */
.toast-host {
  position: fixed; inset-inline: 0; bottom: 1.25rem; z-index: 50;
  display: grid; justify-items: center; gap: .5rem; pointer-events: none;
}
.toast {
  max-width: min(32rem, calc(100vw - 2rem)); padding: .7rem 1.1rem;
  color: #fff; background: var(--ink); border-radius: var(--r-control);
  box-shadow: 0 6px 24px rgba(15, 26, 46, .25);
}
.toast.is-error { background: #8f2621; }

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