/**
 * ERI design tokens — shared primitives for admin-panel and platform.
 * Source: RiskIQ Figma, node 220:32082 (API Keys screen), verified 2026-07-16.
 * Brand colours/fonts updated 2026-08-27 per client brand refresh (ERI Brand Guide) —
 * supersedes the Figma-only "Emerald" palette below until Figma itself is re-synced.
 * Consuming apps import this file and map --eri-* primitives onto their own
 * semantic/component tokens (e.g. shadcn's --primary, --destructive, ...).
 * Do not add values here that aren't verified in Figma/brand guide — flag gaps instead.
 */

:root {
  /* Brand — ERI Brand Guide 2026-08-27: Petrol (dominant) / Deep Teal (supporting) */
  --eri-color-primary: #0f3a43; /* Petrol */
  --eri-color-accent-foreground: #2e6470; /* Deep Teal */
  /* Refined Brass — highlight / Call To Action only, never a large fill or chart colour */
  --eri-color-cta: #e0a93e;

  /* Semantic */
  --eri-color-destructive: #a10a32;
  --eri-color-destructive-bg: #ffe8ee; /* verified 2026-07-17, node 245:52050, Status "Revoked" badge */
  --eri-color-success-foreground: #096b22;
  --eri-color-success-bg: #e3ffea;
  --eri-color-warning-foreground: #92400e;
  --eri-color-info-foreground: #1375b2;
  --eri-color-info-bg: #def3ff;

  /* Neutrals */
  --eri-color-border: #e4e4e7;
  --eri-color-muted: #f4f4f5;
  --eri-color-accent: #f4f4f5;
  --eri-color-sidebar: #f9fafa;
  --eri-color-foreground: #3f3f46;
  --eri-color-background: #ffffff;
  --eri-color-card: #ffffff;
  --eri-color-muted-foreground: #71717b;
  --eri-color-ring: #9f9fa9; /* verified 2026-08-11, node 988:1218 (Input, Focus) — neutral, not brand primary */

  /* Verified from the ERI-122 auth-screen Figma copy-as-CSS exports, 2026-08-03
     (login / login-error / create-account / forgot-password dumps). ⚠ Copy-as-CSS emits
     RESOLVED values, so this may be an unbound raw fill rather than a Figma variable —
     pending live-variable confirmation. Consumers: the 480 card titles and the RiskIQ wordmark. */
  --eri-color-foreground-strong: #09090b;

  /* Dark mode — verified 2026-07-20 from "(ERI) shadcn-ui-kit-for-figma",
     Variables collection "2. Theme", mode "Dark" (exported tokens JSON).
     Brand hues updated 2026-09-15: the previous Petrol 80% tint (#3f6169) read as a
     washed-out grey on the dark card (2.64:1) and nearly disappeared — replaced with
     a lighter Petrol tint (#3f8b9b, 4.54:1 on the dark card) per Joanna.
     accent-foreground-dark stays #ffffff — Joanna wants #3f8b9b reserved for
     secondary/decorative elements, not swapped in as body/label text color. */
  --eri-color-primary-dark: #3f8b9b;
  --eri-color-accent-foreground-dark: #ffffff;
  --eri-color-destructive-dark: #db1c4f;
  --eri-color-destructive-bg-dark: #18181b;
  --eri-color-success-foreground-dark: #64ce80;
  --eri-color-success-bg-dark: #18181b;
  --eri-color-warning-foreground-dark: #fbbf24;
  /* Missing before 2026-09-15: --warning was wired to reuse this same foreground value as
     its own background (globals.css), making "Moderate" badge text invisible against its
     own fill in dark mode. Not Figma-verified (see DESIGN.md's existing flag on warning's
     background) — filled in to match the dark neutral every other status pair already uses
     (destructive-bg-dark, success-bg-dark, info-bg-dark, all #18181b), not invented fresh. */
  --eri-color-warning-bg-dark: #18181b;
  --eri-color-info-foreground-dark: #4cafec;
  --eri-color-info-bg-dark: #18181b;
  --eri-color-border-dark: rgb(255 255 255 / 10%);
  --eri-color-muted-dark: #27272a;
  --eri-color-accent-dark: #3f3f46;
  --eri-color-sidebar-dark: #0e0e10;
  --eri-color-foreground-dark: #ffffff;
  --eri-color-background-dark: #09090b;
  --eri-color-card-dark: #18181b;
  --eri-color-muted-foreground-dark: #9f9fa9;
  --eri-color-input-dark: rgb(255 255 255 / 15%);
  --eri-color-ring-dark: #71717b; /* kit default neutral — was incorrectly overridden to brand primary, see light-mode fix 2026-08-11 */
  --eri-color-sidebar-primary-dark: #0f3a43;
  --eri-color-sidebar-primary-foreground-dark: #2e6470;
  --eri-color-sidebar-ring-dark: #71717b;

  /* Spacing (Figma variable VALUES, not name suffixes — e.g. "spacing/1" = 4px
     in Figma, matching Tailwind's default scale of token-number x 4px) */
  --eri-space-0: 0rem;
  --eri-space-1: 0.25rem;
  --eri-space-1-5: 0.375rem;
  --eri-space-2: 0.5rem;
  --eri-space-3: 0.75rem;
  --eri-space-4: 1rem;
  --eri-space-5: 1.25rem;
  --eri-space-6: 1.5rem;
  --eri-space-8: 2rem;
  --eri-space-14: 3.5rem;

  /* Radius */
  --eri-radius-none: 0rem;
  --eri-radius-xs: 0.25rem;
  --eri-radius-sm: 0.5rem;
  --eri-radius-md: 0.75rem;
  --eri-radius-lg: 1rem;
  --eri-radius-full: 9999px;

  /* Typography — Georgia (headings) per ERI Brand Guide, 2026-08-27; body/UI switched from
     Arial to Inter on 2026-09-01 (full weight range, better fit for desktop/mobile app UI).
     'Inter Variable' comes first because @fontsource-variable/inter (see globals.css)
     registers the font under that name, not 'Inter' — plain 'Inter' stays as fallback
     for any consumer loading it a different way (e.g. Google Fonts). */
  --eri-font-sans: 'Inter Variable', Inter, Arial, Helvetica, sans-serif;
  --eri-font-serif: Georgia, 'Times New Roman', serif;
  --eri-text-xs: 0.75rem;
  --eri-text-sm: 0.875rem;
  --eri-text-base: 1rem;
  --eri-text-lg: 1.125rem;
  --eri-text-xl: 1.25rem;
  --eri-text-2xl: 1.5rem;

  /* Verified from the ERI-122 auth-screen Figma copy-as-CSS exports, 2026-08-03.
     Role-named, not size-named: 22px is off the t-shirt scale (xl 20 → 2xl 24) and has
     exactly one call site, the 380 auth welcome-card title. ⚠ Same copy-as-CSS
     resolved-value caveat as --eri-color-foreground-strong. */
  --eri-text-title: 1.375rem; /* 22px */
  --eri-text-title-line-height: 1.9375rem; /* 31px */

  /* Field labels are weight 500 in every dump; --font-weight-medium is deliberately
     redefined to 400 app-wide, so `font-medium` cannot express them. */
  --eri-font-weight-label: 500;

  /* Shadows (verified from Figma, API Keys screen; opacity/color consolidated) */
  --eri-shadow-color: rgb(0 0 0 / 0.1);
  --eri-shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --eri-shadow-sm: 0 4px 8px 0 rgb(0 0 0 / 0.08);
  --eri-shadow-lg: 0 4px 6px -4px var(--eri-shadow-color), 0 10px 15px -3px var(--eri-shadow-color);
  --eri-shadow-xl: 0 9px 7px 0 var(--eri-shadow-color);

  /* Threat level — ERI Brand Guide 2026-08-27 "Emergent Risk Levels" chart, mapped onto our
     3-tier domain scale (docs/ubiquitous-language.md: Low / Elevated / Critical — names
     unchanged, colours only). The brand chart has 5 tiers (Low/Guarded/Moderate/High/Severe);
     Elevated takes the middle (Moderate) tier, Critical takes the top (Severe) tier.
     Never reorder these three, and never reuse them as generic chart colours. */
  --eri-color-threat-low: #3c9188;
  --eri-color-threat-elevated: #efc53a;
  --eri-color-threat-critical: #be2f33;

  /* Chart marks — DERIVED, not from Figma/brand guide. The brand threat hexes above are
     specified for large fills (the brand guide's own risk chart, our map choropleth) and
     two of them fail contrast as *small* marks, measured with the dataviz palette
     validator, not eyeballed:
       - threat-elevated #efc53a on the white surface = 1.61:1. A 4px dot in it is
         invisible (visible in the CRI detail chart before this change).
       - primary-dark #3f6169 on the dark surface = 2.59:1. A 2px line in it is too dim.
     Each derived step keeps its source's OKLCH hue and drops only lightness, the same
     lighten/darken-for-contrast intent as the primary-dark tint above. All three mark
     colours pass >= 3:1 on both surfaces. Large fills keep the brand hexes — use the
     *-mark steps only for lines, dots and other <= 8px marks. */
  --eri-color-threat-low-mark: #3c9188; /* unchanged, 3.3:1 light — already passes */
  --eri-color-threat-elevated-mark: #a28208; /* oklch(0.62 0.125 91.2), from #efc53a's hue */
  --eri-color-threat-critical-mark: #be2f33; /* unchanged, 5.5:1 light — already passes */
  --eri-color-chart-line-dark: #5d8690; /* oklch(0.593 0.048 214.4) — Petrol 60% tint */
}

/*
 * Not yet verified from Figma/brand guide — do not invent, pull real values before use:
 * - dark-mode variants for the threat-level colours above (brand guide gives no dark tints).
 *   On the dark surface all three brand hexes clear 3:1 as-is, so the *-mark steps are
 *   light-mode-only; ask the client whether they want real dark tints.
 * - threat-low #3c9188 sits just under the dataviz chroma floor (C 0.083 vs 0.09) — it
 *   reads slightly grey next to the other two. Brand-given, so left alone; flag it if the
 *   client ever reopens the palette.
 */
