/* ============================================================
   SmartCVI Design System — design tokens.
   Source of truth: the "SmartCVI Design System" claude.ai/design
   project (dark-mode-first). Values are lifted from the running
   product: Bootstrap 5.3 dark grays + the OHIF viewer theme patch
   (ohif/theme/patch-theme.mjs), so the learning app, the reporter,
   and the DICOM viewer read as one dark surface.

   Usage rules:
   - Reference the SEMANTIC aliases (--surface-card, --text-body,
     --accent, --sev-severe, ...), not raw hex.
   - The semantic surface/text/border aliases carry DARK values.
     They are safe anywhere the dark theme is guaranteed (the
     PUBLIC_SITE learning + marketing surfaces, [data-bs-theme=dark]
     scopes). In theme-flipping hospital CSS keep using Bootstrap's
     --bs-* variables for surfaces and use these tokens only for
     theme-invariant values (severity, radii, motion, spacing).
   ============================================================ */
:root {
  /* ── Gray ramp (Bootstrap grays — the neutral spine) ── */
  --gray-0:   #ffffff;
  --gray-50:  #f8f9fa; /* gray-100 */
  --gray-100: #e9ecef; /* gray-200 */
  --gray-200: #dee2e6; /* gray-300 */
  --gray-300: #ced4da; /* gray-400 */
  --gray-400: #adb5bd; /* gray-500 — muted text */
  --gray-500: #6c757d; /* gray-600 — secondary/placeholder */
  --gray-600: #495057; /* gray-700 — borders */
  --gray-700: #343a40; /* gray-800 — raised surface */
  --gray-800: #2b3035; /* between 800/900 — card/panel */
  --gray-900: #212529; /* gray-900 — app body */
  --gray-950: #16181b; /* below-body / deep chrome */
  --black:    #000000; /* image canvas only */

  /* ── Brand blue (accent — Bootstrap primary, matches viewer) ── */
  --blue-300: #6ea8fe; /* light / focus ring / links-on-dark */
  --blue-400: #3d8bfd;
  --blue-500: #0d6efd; /* PRIMARY accent */
  --blue-600: #0b5ed7; /* hover */
  --blue-700: #0a58ca; /* active */
  --blue-tint: rgba(13, 110, 253, 0.20); /* hover wash / selection */

  /* ── Learning green (progress, "correct", mastery) ── */
  --green-300: #4fd1a8;
  --green-400: #27b58c;
  --green-500: #1c8f6e;
  --green-600: #16805f;

  /* ── Semantic status hues (from the reporter) ── */
  --success:  #198754;
  --success-fg: #75b798;
  --warning:  #ffc107;
  --warning-deep: #e6a817;
  --danger:   #dc3545;
  --danger-fg: #ea868f;
  --info:     #6ea8fe;

  /* ── Clinical severity scale (range indicators) ── */
  --sev-normal:   var(--green-400);
  --sev-mild:     #e6a817; /* amber */
  --sev-moderate: #e67317; /* orange */
  --sev-severe:   #dc3545; /* red */

  /* ── Assessment stars ── */
  --star: #f2c94c;
  --star-deep: #e9a800;
  --star-empty: #495057;

  /* ─────────────────────────────────────────────────────────
     SEMANTIC ALIASES — reference these in product code.
     Dark theme is the default (:root).
     ───────────────────────────────────────────────────────── */
  /* Surfaces */
  --surface-canvas:  var(--black);    /* DICOM image area */
  --surface-app:     var(--gray-900); /* page background */
  --surface-sunken:  var(--gray-950);
  --surface-card:    var(--gray-800); /* cards, panels */
  --surface-raised:  var(--gray-700); /* inputs, toolbars, hover */
  --surface-overlay: var(--gray-800); /* modals, popovers, offcanvas */

  /* Text */
  --text-strong:  var(--gray-50);  /* headings, emphasis */
  --text-body:    var(--gray-200); /* default body */
  --text-muted:   var(--gray-400); /* secondary / captions */
  --text-faint:   var(--gray-500); /* placeholder / disabled */
  --text-on-accent: #ffffff;

  /* Borders */
  --border:        var(--gray-600); /* default divider/border */
  --border-subtle: var(--gray-700);
  --border-strong: var(--gray-500);

  /* Interactive accent */
  --accent:        var(--blue-500);
  --accent-hover:  var(--blue-600);
  --accent-active: var(--blue-700);
  --accent-weak:   var(--blue-tint);
  --focus-ring:    var(--blue-300);

  /* Links */
  --link:       var(--blue-300);
  --link-hover: var(--blue-400);

  /* Learning/progress */
  --progress-track: var(--gray-700);
  --progress-fill-a: var(--green-500);
  --progress-fill-b: var(--green-400);

  /* ── Typography ── */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --font-display: var(--font-sans); /* headings share the sans; weight carries hierarchy */

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  /* Type scale (rem; 1rem = 16px base). Compact end matches the
     reporter's dense forms; display sizes are for heroes. */
  --fs-2xs: 0.6875rem; /* 11px — badges, origin tags */
  --fs-xs:  0.75rem;   /* 12px — dense labels, meta */
  --fs-sm:  0.8125rem; /* 13px — dense body, table cells */
  --fs-base: 0.9375rem;/* 15px — app body */
  --fs-md:  1rem;      /* 16px */
  --fs-lg:  1.125rem;  /* 18px — lead */
  --fs-xl:  1.375rem;  /* 22px — card / section title */
  --fs-2xl: 1.75rem;   /* 28px — page title */
  --fs-3xl: 2.25rem;   /* 36px — hero */
  --fs-4xl: 3rem;      /* 48px — display */

  --lh-tight: 1.15;
  --lh-snug: 1.3;
  --lh-normal: 1.5;
  --lh-relaxed: 1.6;

  --ls-tight: -0.01em;
  --ls-normal: 0;
  --ls-wide: 0.04em;
  --ls-wider: 0.12em;

  /* ── Spacing scale (4px base, plus sub-steps for dense UI) ── */
  --space-0: 0;
  --space-px: 1px;
  --space-0-5: 2px;
  --space-1: 4px;
  --space-1-5: 6px;
  --space-2: 8px;
  --space-2-5: 10px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;

  /* ── Radii ── */
  --radius-xs: 2px;   /* the brand mark square, badges */
  --radius-sm: 3px;   /* dense controls, kbd */
  --radius-md: 4px;   /* default: inputs, buttons, panels */
  --radius-lg: 8px;   /* cards, modals, hint dialogs */
  --radius-xl: 12px;  /* learning cards (lp-card) */
  --radius-pill: 999px;

  /* ── Control dimensions (from the dense reporter forms) ── */
  --control-h-dense: 26px;
  --control-h: 32px;
  --control-h-lg: 40px;
  --row-h-dense: 28px;
  --navbar-h: 40px;

  /* ── Layout ── */
  --container-max: 1140px;
  --content-max: 900px;
  --border-w: 1px;

  /* ── Shadows (dark-tuned; low alpha, cool black) ── */
  --shadow-none: none;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.40);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.55);
  --shadow-focus: 0 0 0 0.2rem rgba(13, 110, 253, 0.35);
  --shadow-inset-top: 0 -2px 5px rgba(0, 0, 0, 0.25);

  /* Field-state insets */
  --ring-updated: inset 0 0 0 2px rgba(25, 135, 84, 0.55);

  /* ── Motion ── */
  --ease-standard: cubic-bezier(0.2, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out: ease-in-out;
  --dur-fast: 0.15s;
  --dur-base: 0.2s;
  --dur-slow: 0.3s;
  --dur-glow: 4s;

  /* ── Backdrops / blur / z-index ── */
  --backdrop: rgba(15, 23, 42, 0.55);
  --blur-sm: blur(2px);
  --z-navbar: 1030;
  --z-toolbar: 1020;
  --z-overlay: 1080;
  --z-banner: 1050;
}
