/* ==========================================================================
   McIntyre MedSys - Design Tokens
   A single source of truth for colour, type, spacing, elevation & motion.
   Clinical, calm, trustworthy. Light + dark aware.
   ========================================================================== */

:root {
  /* ---- Brand -------------------------------------------------------- */
  --brand-900: #06303a;
  --brand-800: #0a4552;
  --brand-700: #0d5c6e;
  --brand-600: #12798f;   /* primary */
  --brand-500: #1a97b0;
  --brand-400: #3fb5cc;
  --brand-300: #7fd0e0;
  --brand-200: #b6e6ef;
  --brand-100: #e0f5f9;
  --brand-050: #f0fafc;

  --accent-600: #6d4aff;  /* intelligence / AI accent */
  --accent-500: #8163ff;
  --accent-100: #ece7ff;

  /* ---- Clinical risk semantics (match the 🔴🟡🟢 in the spec) -------- */
  --risk-red-600:   #d1344b;
  --risk-red-100:   #fde6ea;
  --risk-amber-600: #cf8a06;
  --risk-amber-100: #fcf1d6;
  --risk-green-600: #1f9d63;
  --risk-green-100: #e2f6ec;
  --risk-blue-600:  #2f6fed;
  --risk-blue-100:  #e4edfe;

  /* ---- Neutrals ----------------------------------------------------- */
  --ink-900: #0f1b21;
  --ink-800: #1c2b33;
  --ink-700: #33454e;
  --ink-600: #4d5f68;
  --ink-500: #6b7c85;
  --ink-400: #91a0a8;
  --ink-300: #c2ced4;
  --ink-200: #dde5e9;
  --ink-100: #eef3f5;
  --ink-050: #f7fafb;
  --white:   #ffffff;

  /* ---- Semantic surface (light) ------------------------------------- */
  --bg:            #eef3f5;
  --bg-elevated:   #ffffff;
  --surface:       #ffffff;
  --surface-2:     #f7fafb;
  --surface-3:     #eef3f5;
  --border:        #dde5e9;
  --border-strong: #c2ced4;
  --text:          #0f1b21;
  --text-muted:    #4d5f68;
  --text-subtle:   #6b7c85;
  --text-invert:   #ffffff;
  --primary:       var(--brand-600);
  --primary-strong:var(--brand-700);
  --primary-soft:  var(--brand-100);
  --ring:          rgba(18,121,143,.35);

  /* ---- Typography --------------------------------------------------- */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;

  --fs-xs: .75rem;
  --fs-sm: .8125rem;
  --fs-base: .9375rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.75rem;
  --fs-3xl: 2.25rem;
  --fs-4xl: 3rem;
  --fs-5xl: 3.75rem;

  --lh-tight: 1.15;
  --lh-snug: 1.35;
  --lh-normal: 1.6;

  --fw-normal: 400;
  --fw-medium: 500;
  --fw-semi: 600;
  --fw-bold: 700;
  --fw-black: 800;

  /* ---- Spacing scale ------------------------------------------------ */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;
  --sp-12: 48px; --sp-16: 64px; --sp-20: 80px; --sp-24: 96px;

  /* ---- Radius ------------------------------------------------------- */
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px; --r-2xl: 28px; --r-full: 999px;

  /* ---- Elevation ---------------------------------------------------- */
  --sh-xs: 0 1px 2px rgba(15,27,33,.06);
  --sh-sm: 0 1px 3px rgba(15,27,33,.08), 0 1px 2px rgba(15,27,33,.04);
  --sh-md: 0 4px 12px rgba(15,27,33,.08), 0 2px 4px rgba(15,27,33,.05);
  --sh-lg: 0 12px 28px rgba(15,27,33,.12), 0 4px 10px rgba(15,27,33,.06);
  --sh-xl: 0 24px 56px rgba(15,27,33,.18);
  --sh-glow: 0 0 0 4px var(--ring);

  /* ---- Motion ------------------------------------------------------- */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --dur-fast: .12s;
  --dur: .22s;
  --dur-slow: .4s;

  --maxw: 1200px;
  --header-h: 64px;
}

:root[data-theme="dark"] {
  --bg:            #0a1418;
  --bg-elevated:   #10212a;
  --surface:       #10212a;
  --surface-2:     #162c36;
  --surface-3:     #1d3742;
  --border:        #24404c;
  --border-strong: #315060;
  --text:          #eaf2f5;
  --text-muted:    #a9bcc4;
  --text-subtle:   #7d939c;
  --text-invert:   #06303a;
  --primary:       var(--brand-400);
  --primary-strong:var(--brand-300);
  --primary-soft:  rgba(63,181,204,.14);
  --ring:          rgba(63,181,204,.4);

  --risk-red-100:   rgba(209,52,75,.16);
  --risk-amber-100: rgba(207,138,6,.16);
  --risk-green-100: rgba(31,157,99,.16);
  --risk-blue-100:  rgba(47,111,237,.16);
  --accent-100:     rgba(129,99,255,.16);

  --sh-xs: 0 1px 2px rgba(0,0,0,.4);
  --sh-sm: 0 1px 3px rgba(0,0,0,.45);
  --sh-md: 0 4px 14px rgba(0,0,0,.5);
  --sh-lg: 0 14px 34px rgba(0,0,0,.55);
  --sh-xl: 0 26px 60px rgba(0,0,0,.62);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:            #0a1418;
    --bg-elevated:   #10212a;
    --surface:       #10212a;
    --surface-2:     #162c36;
    --surface-3:     #1d3742;
    --border:        #24404c;
    --border-strong: #315060;
    --text:          #eaf2f5;
    --text-muted:    #a9bcc4;
    --text-subtle:   #7d939c;
    --text-invert:   #06303a;
    --primary:       var(--brand-400);
    --primary-strong:var(--brand-300);
    --primary-soft:  rgba(63,181,204,.14);
    --ring:          rgba(63,181,204,.4);
    --risk-red-100:   rgba(209,52,75,.16);
    --risk-amber-100: rgba(207,138,6,.16);
    --risk-green-100: rgba(31,157,99,.16);
    --risk-blue-100:  rgba(47,111,237,.16);
    --accent-100:     rgba(129,99,255,.16);
    --sh-xs: 0 1px 2px rgba(0,0,0,.4);
    --sh-sm: 0 1px 3px rgba(0,0,0,.45);
    --sh-md: 0 4px 14px rgba(0,0,0,.5);
    --sh-lg: 0 14px 34px rgba(0,0,0,.55);
    --sh-xl: 0 26px 60px rgba(0,0,0,.62);
  }
}

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