/*
 * Light Theme — B · Operational SaaS (hardened), EPIC #990 Phase 3
 *
 * Direction B light palette. Replaces the legacy green accent and teal
 * default border (pre-#990 remnants) with B's wayfinding blue + neutral
 * slate borders; statuses carry the semantic signal palette (see dark.css).
 */

[data-theme="light"] {
  /* === Surface Colors (B: cool page, white panels, gray inset) === */
  --theme-surface-page: #f5f6f8;
  --theme-surface-panel: #ffffff;
  /* A soft gray DISTINCT from the white panel — this token is used app-wide (~44
     files) as "a surface set off from the panel": secondary-button / chip / badge
     fills, active tab/segment fills, list-row + control hovers, raised list items.
     Kept grey (NOT white) so all of those stay visible on a white panel in light.
     Cards that should read as pure-white lift already sit on --color-surface-panel
     (#fff) over the grey page — the mock's white-card-on-grey look — so elevation
     does not need this to be white. */
  --theme-surface-elevated: #eceff3;
  /* Recessed filled CONTROLS — toggle track, button/list-row hover, tab segment.
     NOT text fields: those use --theme-surface-field below (#686). */
  --theme-surface-input: #eef1f5;
  --theme-surface-overlay: rgba(255, 255, 255, 0.95);
  /* Recessed PLANE surface (#990 N2b) — the full-bleed instrument devplane, a
     plane deeper than the white app bar. B-coherent: a neutral SLIGHTLY DARKER
     than the page (page #f5f6f8 → inset #eef1f5), so the edge-to-edge toolbar
     reads as a recessed trough below the raised app chrome (mirrors the B mock's
     bg-inset). NOT a control fill and NOT an elevation. */
  --theme-surface-inset: #eef1f5;

  /* === Text-field surfaces (#686) ===
     A live field is the LIGHTEST thing on the panel and leans on its border for
     the edge; a dead one is a flat gray slab. Before, enabled was the gray while
     disabled composited lighter — the live control read as disabled. The gray
     (now #eceff3) is the disabled fill: the state it always looked like. */
  --theme-surface-field: #ffffff;
  --theme-surface-field-disabled: #eceff3;
  --theme-text-field-disabled: #b3bcc5;

  /* === Border Colors (B neutral slate — the legacy teal default is gone) === */
  --theme-border-default: #d2d9e0;
  --theme-border-subtle: #e4e8ed;
  /* Focus follows the accent (B idiom), matching dark. */
  --theme-border-focus: #2f6fed;
  /* A field boundary must clear WCAG 2.2 SC 1.4.11's 3:1 for UI components against
     BOTH adjacent colours — the field fill INSIDE and whatever sits OUTSIDE. A bare
     form/select has no panel-ancestry guarantee, so "outside" includes the page.
     #818b96 clears 3:1 on ALL permitted neighbours: field #fff 3.46, panel #fff
     3.46, page #f5f6f8 3.20 (this is the 3:1 UI-component bar, NOT the 4.5 text
     rule). The previous #64748b (4.76) was far heavier than B intends; #818b96
     keeps B's light-slate register while clearing 3:1 everywhere. --theme-border-
     subtle is well below 3:1 and is NOT sufficient here. Floored (both themes) by
     theme-integrity.test against field + panel + page. */
  --theme-border-field: #818b96;

  /* Hover scrim — the SINGLE owner of "a pointer is over this control" (#685).
     Per-theme by necessity, not preference: an ink scrim has far less room on a
     near-white surface than a near-black one, so one shared alpha cannot serve
     both. At dark's 0.08 this composites to ~1.157:1 against the bezel — present
     but invisible, which is exactly how the nav rows shipped with no perceptible
     hover in light. 0.16 lands ~1.360:1, matching dark's perceived weight. */
  --theme-hover-scrim: rgba(30, 41, 59, 0.16);

  /* === Text Colors (B ink ramp; muted clears WCAG 4.5:1 on EVERY text surface
     incl. elevated — enforced by theme-integrity.test, jury graft #4) === */
  --theme-text-primary: #0f1720;
  --theme-text-secondary: #58626f;
  --theme-text-muted: #616c79;
  --theme-text-inverse: #f5f6f8;

  /* === Accent Colors (B wayfinding blue — pure wayfinding: nav / selection /
     marks. The solid affirmative ACTION owns the theme-invariant --color-action-*
     in tokens.css. hover/pressed DARKEN on light, hence dim/dark below primary;
     -contrast = the white non-text mark on the accent fill — checkbox tick /
     toggle knob) === */
  --theme-accent-primary: #2f6fed;
  --theme-accent-primary-dim: #1f5fe0;
  --theme-accent-primary-dark: #1a4fc4;
  --theme-accent-primary-contrast: #ffffff;
  --theme-accent-secondary: #2f6fed;
  --theme-accent-info: #9a640e;

  /* === Status Colors (semantic signal palette — see dark.css). SPLIT into two
     roles (#990 council: globally deepening these dulled the B mock's signals):
     the BASE hue is the SIGNAL for dots / fills / borders (WCAG 1.4.11 UI bar,
     3:1) and reverts to B's originals; the deepened, text-safe values move to
     --theme-status-*-ink (used everywhere a status color is TEXT). Base signal
     contrast on white/page: success 3.46/3.20, error 4.45/4.11, warning
     3.26/3.01, active 4.10/3.79 — all >=3.0. === */
  --theme-status-success: #0f9d6e;
  --theme-status-error: #d3454b;
  --theme-status-warning: #c67f12;
  --theme-status-active: #0284c7;
  /* Status TEXT inks — deepened, text-safe (>=4.5 on white): success 5.14,
     error 5.57, warning 5.00, active 5.63. Every status color used AS TEXT points
     here; dots / fills / borders stay on the base signal hue above. */
  --theme-status-success-ink: #0b7d57;
  --theme-status-error-ink: #c03338;
  --theme-status-warning-ink: #9a640e;
  --theme-status-active-ink: #026da5;
  --theme-status-scanning: #9333ea;
  --theme-status-offline: #616c79;
  --theme-role-lab: #0d9488;

  /* === Threat Classification Colors (domain contract — NOT re-themed) === */
  --theme-threat-enemy: #dc2626;
  --theme-threat-friend: #0284c7;
  --theme-threat-protected: #16a34a;
  --theme-threat-unknown: #1f2937;
  --theme-threat-fm-radio: #0284c7;

  /* === Threat Background Colors (flat translucent row tints — OsdLogsModal) === */
  --theme-threat-enemy-bg: rgba(220, 38, 38, 0.35);
  --theme-threat-friend-bg: rgba(2, 132, 199, 0.35);
  --theme-threat-protected-bg: rgba(22, 163, 74, 0.35);
  --theme-threat-unknown-bg: rgba(31, 41, 55, 0.35);
  --theme-threat-fm-radio-bg: rgba(2, 132, 199, 0.35);

  /* === Threat RGB Values (for layered rgba() usage) === */
  --theme-threat-enemy-rgb: 220, 38, 38;
  --theme-threat-friend-rgb: 2, 132, 199;
  --theme-threat-protected-rgb: 22, 163, 74;
  --theme-threat-unknown-rgb: 31, 41, 55;
  /* Canvas FILL for an unclassified threat. The ink above is the glyph/label
     colour and is near-black by design; a near-black FILL under the spectrum
     trace reads as a black stain over the signal, so the fill is the same hue
     lifted to a mid slate. */
  --theme-threat-unknown-fill-rgb: 71, 85, 105;
  --theme-threat-fm-radio-rgb: 2, 132, 199;

  /* === Spectrum sweep glow ===
   * Same bright sky-blue as dark theme so the sweep tail stays readable
   * over the white panel. See dark.css for the rationale. */
  --theme-spectrum-glow-rgb: 56, 189, 248;

  /* === Chart chrome (#638) ===
   * Darker than --theme-text-muted: the spectrum fill fades to near-transparent
   * at the noise floor, so the dB/MHz lattice is what gives the plot structure —
   * a muted-grey grid disappeared under it. (Values kept through the B re-theme;
   * they already sit on B's text-2 ink.) */
  --theme-chart-grid-rgb: 71, 85, 105;
  --theme-chart-axis-tick: #475569;

  /* === Shadow Tokens (B: hairline + modal float on light ink) === */
  --theme-shadow-panel: 0 1px 2px rgba(16, 24, 40, 0.07);
  --theme-shadow-focus: 0 0 0 2px rgba(47, 111, 237, 0.25);
  --theme-shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.1);
  --theme-shadow-hover-strong: 0 4px 8px rgba(0, 0, 0, 0.15);
  --theme-shadow-modal: 0 16px 36px -10px rgba(16, 24, 40, 0.2), 0 2px 6px rgba(16, 24, 40, 0.08);
  --theme-shadow-error: 0 0 0 2px rgba(192, 51, 56, 0.25);
  --theme-shadow-active: 0 0 0 2px rgba(47, 111, 237, 0.3);

  /* === Overlay Colors === */
  --theme-dim-overlay: rgba(0, 0, 0, 0.2);
  --theme-scrim: rgba(0, 0, 0, 0.35);

  /* === RGB Values (for rgba() usage) === */
  --theme-accent-primary-rgb: 47, 111, 237;
  --theme-accent-secondary-rgb: 47, 111, 237;
  --theme-accent-info-rgb: 154, 100, 14;  /* matches --theme-accent-info */
  --theme-status-success-rgb: 15, 157, 110;
  --theme-status-error-rgb: 211, 69, 75;
  --theme-status-warning-rgb: 198, 127, 18;
  --theme-status-active-rgb: 2, 132, 199;
  --theme-status-scanning-rgb: 147, 51, 234;
  --theme-role-lab-rgb: 13, 148, 136;
  --theme-border-default-rgb: 210, 217, 224;
  --theme-text-primary-rgb: 15, 23, 32;
  --theme-text-secondary-rgb: 88, 98, 111;
  --theme-text-muted-rgb: 97, 108, 121;
  --theme-text-inverse-rgb: 245, 246, 248;
  --theme-surface-page-rgb: 245, 246, 248;
  --theme-surface-panel-rgb: 255, 255, 255;
  --theme-surface-elevated-rgb: 236, 239, 243;
  --theme-surface-input-rgb: 238, 241, 245;
  --theme-surface-inset-rgb: 238, 241, 245;

  /* === Dim/hover variants of status colors === */
  --theme-status-error-dim: #a52b30;
  --theme-status-warning-dim: #7d520b;

  /* === TRANSMIT button + CRT-effect palette (always-dark visual concept;
     deliberately outside the B re-theme — matches dark-theme intent) === */
  --theme-transmit-button-bg: #dc2626;
  --theme-transmit-trace: #b91c1c;
  --theme-transmit-trace-rgb: 185, 28, 28;
  --theme-crt-tube-bg: #3a3a3a;
  --theme-crt-tube-bg-active: #4a4a4a;
  --theme-crt-tube-bg-error: #4a2020;
  --theme-crt-scanline-rgb: 255, 255, 255;
  --theme-crt-scanline-warning-rgb: 255, 100, 100;

  /* === Spectrum-Sweep gradient (cold → hot, used by sliders) ===
   * #638: sampled from the light waterfall ramp (spectrumPalette.ts) so every
   * cold→hot surface tells the same colour story. The cold end is clamped to
   * the ramp's 0.25 stop rather than its near-white floor — a slider track has
   * to stay visible against the light panel. (Moves with the JS palette bridge
   * slice, not with the B re-theme.) */
  --theme-gradient-spectrum-sweep:
    rgb(166, 203, 242) 0%,
    rgb(34, 150, 220) 25%,
    rgb(43, 177, 94) 50%,
    rgb(234, 180, 0) 75%,
    rgb(220, 38, 38) 100%;
}
