/* ============================================
   tokens.css — Design tokens and theme variables
   ============================================ */
:root {
  --ease-glide: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-settle: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-press: cubic-bezier(0.2, 0, 0.2, 1);
  --red: #c62828;
  --red-bright: #ed292f;
  /* The third stop of the primary-button gradient and the hover fill. Named
     because it was written as a literal in seven rules across three apps. */
  --red-dark: #a9171f;
  --accent-text: var(--red);
  --ink: #17191c;
  --paper: #f6f6f4;
  --surface: #fafafa;
  --surface-soft: #f4f4f2;
  --surface-header: rgba(250, 250, 250, .97);
  --surface-form: var(--surface);
  --surface-input: #f5f5f3;
  /* Muted ramp. #7a7c7f measured 3.60-4.01:1 on every light surface and failed
     AA (needs 4.5:1) for the section intros, service-card copy, footer text,
     the OPTIONAL badge and the POPIA consent copy. #62646a measures
     5.09-5.77:1. Dark mode already passes and is untouched below. */
  --text-muted: #62646a;
  --text-subtle: var(--text-muted);
  --text-form: #4a4c4f;
  --text-placeholder: #62646a;
  --border: #e0e0dd;
  /* Card outlines. A step darker than --border because a card has to read as a
     separate surface: --border on the glass fill is 1.27:1, which is invisible
     as a shape. --border-strong (3.55:1) is reserved for control boundaries,
     where WCAG 1.4.11 demands it, and is too heavy for a decorative outline. */
  --border-card: #c9c9c4;
  /* Control boundaries need 3:1 (WCAG 1.4.11). The old #e5e5e2 sat at 1.16:1
     against the composited glass field, so form inputs and icon buttons had no
     visible edge at all. Verified 3.55-3.61:1. Dark counterpart is set in both
     dark blocks below. */
  --border-strong: #838587;
  --header-border: rgba(23, 25, 28, .06);
  --hero-background: radial-gradient(ellipse at 76% 48%, rgba(198, 40, 40, .06), transparent 36%), linear-gradient(115deg, #eeeeec 5%, #f5f5f3 72%, #f0f0ee);
  --hero-text: #2a2c2f;
  --hero-muted: #6a6c6f;
  --hero-grid-lines: rgba(23, 25, 28, .07);
  --hero-ring: rgba(23, 25, 28, .09);
  --hero-orbit-shadow: 0 0 0 60px rgba(23, 25, 28, .018), 0 0 0 120px rgba(23, 25, 28, .01);
  --surface-contrast: #fafafa;
  --surface-contrast-soft: #eeeeec;
  --surface-contrast-text: #17191c;
  --surface-contrast-muted: #55595d;
  --surface-contrast-border: rgba(23, 25, 28, .5);
  --status-success-bg: #e8f4ed;
  --status-success-text: #23603c;
  --status-error-bg: #fff0f0;
  --status-error-text: #a32025;
  --status-warning-bg: #fff7e0;
  --status-warning-text: #7a5a00;
  --status-info-bg: #e7f1fb;
  --status-info-text: #1a4a7a;
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Arial Narrow", "Roboto Condensed", "Liberation Sans Narrow", Arial, sans-serif;
  /* Verification codes and the 2FA secret box. Named so no app has to guess a
     stack, and so the fallback chain is in one place. */
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --container: 1200px;

  /* Type scale. This replaces a scatter of ad-hoc 8/9/10/11/12/13px values
     that had no scale behind them, which is why primary button labels had
     ended up at 10px while body copy sat at 12px.
     --text-xs is decorative captions only and must never be used on anything
     interactive. --text-lead doubles as the minimum control font size: below
     16px iOS Safari zooms the viewport on focus, so inputs and textareas
     never go under it. */
  --text-xs: 11px;
  --text-sm: 12px;
  --text-md: 13px;
  --text-base: 14px;
  --text-lead: 16px;
  /* Heading steps. `calc(var(--text-lead) * N)` stood in for these in the
     admin and training apps, which is how one scale produced thirty sizes. */
  --text-lg: 18px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 28px;
  /* Display scale for page titles. Three steps; admin and training page titles
     (h1) converge on --text-display-md. */
  --text-display-sm: 24px;
  --text-display-md: 40px;
  --text-display-lg: 56px;

  /* Spacing scale — generous whitespace. The 8px ladder is too coarse for
     control internals, so its two sub-steps are named here rather than written
     as `calc(var(--space-xs) / 2)` arithmetic at every call site. */
  --space-3xs: 2px;
  --space-2xs: 4px;
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 28px;
  --space-lg: 44px;
  --space-xl: 64px;
  --space-2xl: 88px;
  --space-3xl: 128px;
  --space-4xl: 140px;

  /* Corner radii. One scale for every rounded surface in every app: cards and
     panels take --radius-lg, form controls and compact surfaces --radius-md,
     small chrome controls --radius-sm, hairline details --radius-xs, and status
     chips --radius-pill. A circle stays a literal 50%; that is a shape, not a
     step on the scale. */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* Form control minimum height (WCAG 2.5.8). */
  --control-min-height: 46px;
  /* The console's modal scrim: always a dark veil, in both themes. */
  --scrim: rgba(23, 25, 28, 0.36);
  /* A lifted surface (command palette, confirm dialog) has to detach from the
     page without the landing's glass vocabulary. Light lifts with a soft
     ambient shadow; dark needs a deeper one because the page is already dark. */
  --overlay-shadow: 0 24px 70px -18px rgba(23, 25, 28, .35), 0 2px 12px rgba(23, 25, 28, .12);

  /* Glass vocabulary (shared across all three apps). Definitions promoted from
     the landing's glass.css so every app reads one set of names. */
  --glass-bg: rgba(255, 255, 255, 0.50);
  --glass-bg-hover: rgba(255, 255, 255, 0.55);
  --glass-bg-strong: rgba(255, 255, 255, 0.90);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.10), 0 2px 8px rgba(0, 0, 0, 0.06);
  --glass-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.05);
  --glass-inset-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  --glass-blur: blur(16px) saturate(150%);
  --glass-blur-medium: blur(14px) saturate(145%);
  --glass-red-glow: rgba(198, 40, 40, 0.25);
  --glass-red-glow-hover: rgba(198, 40, 40, 0.35);
  --glass-bg-solid: #f6f6f4;
  --glass-bg-strong-solid: #ffffff;

  color-scheme: light;

  /* Animation durations — fixed values that work well across devices */
  --duration-fast: 0.25s;
  --duration-medium: 0.4s;
  --duration-slow: 0.6s;
  --duration-entrance: 0.5s;

  /* Infinite animation durations */
  --duration-infinite-medium: 6s;
  --duration-infinite-slow: 40s;
  /* ── Material: one glass, described in four parts ─────────────────────
     A translucent surface is not one value. It is what is inside it (tint),
     what bends the light behind it (blur), what catches the light on its edge
     (refraction), and how far it sits above the page (shadow). Naming them
     apart is what lets a control be clear where the page should show through
     and frosted where text has to stay readable. */
  --glass-band: rgba(255, 255, 255, 0.70);
  --glass-tint-clear: rgba(255, 255, 255, 0.34);
  --glass-tint-frost: rgba(252, 249, 246, 0.72);
  --glass-refraction: linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0) 46%);
  --glass-reflection: linear-gradient(0deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0));
  --glass-thickness: rgba(15, 18, 20, 0.10);
  --glass-shadow-raise: 0 2px 6px rgba(16, 20, 24, 0.10), 0 14px 36px rgba(16, 20, 24, 0.14);
  --glass-shadow-float: 0 6px 16px rgba(16, 20, 24, 0.14), 0 28px 64px rgba(16, 20, 24, 0.20);
  --glass-press: scale(0.985);
  --glass-lift: translateY(-1px);
  /* Glass needs something behind it. A translucent panel over a flat white page
     has nothing to bend, which is why it reads as "white card with a faint
     border" no matter how much blur is spent on it. The wash is a barely-there
     field of colour under the whole page: not decoration, the thing the material
     is made of. */
  --page-wash:
      radial-gradient(120% 90% at 8% -10%, rgba(198, 40, 40, 0.14), transparent 58%),
      radial-gradient(90% 70% at 96% 4%, rgba(23, 92, 82, 0.11), transparent 55%),
      radial-gradient(70% 60% at 50% 110%, rgba(198, 40, 40, 0.06), transparent 60%);
  /* A hairline that exists on a pale page: the inset highlight catches light on
     the top edge, this closes the shape on the other three. */
  --glass-edge-line: rgba(15, 18, 20, 0.14);
}
:root[data-theme="dark"] {
  --accent-text: #ff777b;
  --ink: #f1f2f0;
  --paper: #151719;
  --surface: #1d2023;
  --surface-soft: #191c1f;
  --surface-header: rgba(25, 27, 30, .97);
  --surface-form: #202327;
  --surface-input: #171a1d;
  --text-muted: #c0c3c6;
  --text-subtle: #b3b6b9;
  --text-form: #e2e4e5;
  --text-placeholder: #aeb2b6;
  --border: #3c4044;
  --border-card: #4a4f54;
  --border-strong: #6a7076;
  --header-border: rgba(255, 255, 255, .13);
  --hero-background: radial-gradient(ellipse at 76% 48%, rgba(198, 40, 40, .22), transparent 36%), linear-gradient(115deg, #151719 5%, #202226 72%, #191a1d);
  --hero-text: #fff;
  --hero-muted: #c3c6c9;
  --hero-grid-lines: rgba(255, 255, 255, .11);
  --hero-ring: rgba(255, 255, 255, .1);
  --hero-orbit-shadow: 0 0 0 60px rgba(255, 255, 255, .018), 0 0 0 120px rgba(255, 255, 255, .014);
  --surface-contrast: #151719;
  --surface-contrast-soft: #202327;
  --surface-contrast-text: #f1f2f0;
  --surface-contrast-muted: #c0c3c6;
  --surface-contrast-border: rgba(255, 255, 255, .4);
  --status-success-bg: #163523;
  --status-success-text: #b7ebc8;
  --status-error-bg: #421d20;
  --status-error-text: #ffc2c3;
  --status-warning-bg: #3a2e0a;
  --status-warning-text: #f0d87a;
  --status-info-bg: #0f2a4a;
  --status-info-text: #a8d0f0;
  --glass-bg: rgba(38, 42, 46, 0.58);
  --glass-bg-hover: rgba(0, 0, 0, 0.55);
  --glass-bg-strong: rgba(29, 32, 35, 0.92);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
  --glass-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.25);
  --glass-inset-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  --glass-red-glow: rgba(198, 40, 40, 0.35);
  --glass-red-glow-hover: rgba(198, 40, 40, 0.45);
  --glass-bg-solid: #151719;
  --glass-bg-strong-solid: #1d2023;
  --overlay-shadow: 0 24px 80px -16px rgba(0, 0, 0, .72), 0 3px 14px rgba(0, 0, 0, .45);
  color-scheme: dark;
  --glass-band: rgba(24, 27, 30, 0.66);
  --glass-tint-clear: rgba(18, 21, 24, 0.44);
  --glass-tint-frost: rgba(34, 38, 42, 0.78);
  --glass-refraction: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 44%);
  --glass-reflection: linear-gradient(0deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0));
  --glass-thickness: rgba(0, 0, 0, 0.45);
  --glass-shadow-raise: 0 2px 8px rgba(0, 0, 0, 0.34), 0 16px 40px rgba(0, 0, 0, 0.44);
  --glass-shadow-float: 0 6px 18px rgba(0, 0, 0, 0.44), 0 30px 70px rgba(0, 0, 0, 0.54);
  --glass-press: scale(0.985);
  --glass-lift: translateY(-1px);
  --page-wash:
      radial-gradient(110% 85% at 6% -12%, rgba(214, 64, 58, 0.16), transparent 56%),
      radial-gradient(80% 65% at 98% 2%, rgba(38, 120, 140, 0.12), transparent 52%),
      radial-gradient(70% 55% at 50% 108%, rgba(214, 64, 58, 0.10), transparent 60%);
  --glass-edge-line: rgba(255, 255, 255, 0.14);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --accent-text: #ff777b;
    --ink: #f1f2f0;
    --paper: #151719;
    --surface: #1d2023;
    --surface-soft: #191c1f;
    --surface-header: rgba(25, 27, 30, .97);
    --surface-form: #202327;
    --surface-input: #171a1d;
    --text-muted: #c0c3c6;
    --text-subtle: #b3b6b9;
    --text-form: #e2e4e5;
    --text-placeholder: #aeb2b6;
    --border: #3c4044;
    --border-card: #4a4f54;
    --border-strong: #6a7076;
    --header-border: rgba(255, 255, 255, .13);
    --hero-background: radial-gradient(ellipse at 76% 48%, rgba(198, 40, 40, .22), transparent 36%), linear-gradient(115deg, #151719 5%, #202226 72%, #191a1d);
    --hero-text: #fff;
    --hero-muted: #c3c6c9;
    --hero-grid-lines: rgba(255, 255, 255, .11);
    --hero-ring: rgba(255, 255, 255, .1);
    --hero-orbit-shadow: 0 0 0 60px rgba(255, 255, 255, .018), 0 0 0 120px rgba(255, 255, 255, .014);
    --surface-contrast: #151719;
    --surface-contrast-soft: #202327;
    --surface-contrast-text: #f1f2f0;
    --surface-contrast-muted: #c0c3c6;
    --surface-contrast-border: rgba(255, 255, 255, .4);
    --status-success-bg: #163523;
    --status-success-text: #b7ebc8;
    --status-error-bg: #421d20;
    --status-error-text: #ffc2c3;
    --status-warning-bg: #3a2e0a;
    --status-warning-text: #f0d87a;
    --status-info-bg: #0f2a4a;
    --status-info-text: #a8d0f0;
    --glass-bg: rgba(38, 42, 46, 0.58);
    --glass-bg-hover: rgba(0, 0, 0, 0.55);
    --glass-bg-strong: rgba(29, 32, 35, 0.92);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
    --glass-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.25);
    --glass-inset-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.16);
    --glass-red-glow: rgba(198, 40, 40, 0.35);
    --glass-red-glow-hover: rgba(198, 40, 40, 0.45);
    --glass-bg-solid: #151719;
    --glass-bg-strong-solid: #1d2023;
    --overlay-shadow: 0 24px 80px -16px rgba(0, 0, 0, .72), 0 3px 14px rgba(0, 0, 0, .45);
    color-scheme: dark;
  --glass-band: rgba(24, 27, 30, 0.66);
  --glass-tint-clear: rgba(18, 21, 24, 0.44);
  --glass-tint-frost: rgba(34, 38, 42, 0.78);
  --glass-refraction: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 44%);
  --glass-reflection: linear-gradient(0deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0));
  --glass-thickness: rgba(0, 0, 0, 0.45);
  --glass-shadow-raise: 0 2px 8px rgba(0, 0, 0, 0.34), 0 16px 40px rgba(0, 0, 0, 0.44);
  --glass-shadow-float: 0 6px 18px rgba(0, 0, 0, 0.44), 0 30px 70px rgba(0, 0, 0, 0.54);
  --glass-press: scale(0.985);
  --glass-lift: translateY(-1px);
  --page-wash:
      radial-gradient(110% 85% at 6% -12%, rgba(214, 64, 58, 0.16), transparent 56%),
      radial-gradient(80% 65% at 98% 2%, rgba(38, 120, 140, 0.12), transparent 52%),
      radial-gradient(70% 55% at 50% 108%, rgba(214, 64, 58, 0.10), transparent 60%);
  --glass-edge-line: rgba(255, 255, 255, 0.14);
  }
}

/* The watermark drawn over video. Declared once, outside the two theme blocks:
   it sits over picture rather than over the interface, so it is white in both
   themes and has no light/dark counterpart to keep in step. */
:root {
    --video-mark: #ffffff;
}
