/* ═══════════════════════════════════════════════════════════════════════════════════════
   ONE INSURANCE — RECORD SYSTEM TOKENS
   Single source of truth. Loaded before app.css and record.css.

   COLOUR (ADO #366): OOF paints in the OCI suite's shared colours, so moving between OCI,
   VOCAL, NuRoad and OOF reads as one product. The values come from One Caller Intelligence
   `web/alpha/style.css` (the same `--color-*` tokens NuRoad uses verbatim and VOCAL's dark
   theme copies). They are declared here under OCI's own names, and the app's existing names
   (--canvas, --ink, --azure, …) point at them, so no component rule had to change.

   Where an OCI value fails WCAG AA in a pairing this app actually uses, it is lifted just
   enough and the line says so. Every pair was measured, not eyeballed.

   The theme is `[data-theme]` on <html>: the app's own toggle, or One Caller Intelligence's
   `?theme=` when it opens OOF in its panel (see main.js).
   ═══════════════════════════════════════════════════════════════════════════════════════ */

:root {
  /* ── OCI brand ramp (theme-independent) ── */
  --navy-900: #0a1b33;  --navy-800: #0c2140;  --navy-700: #0e2a4b;  /* the OCI sidebar ground */
  --navy-600: #16335a;  --navy-500: #1a3b63;
  --cyan: #00aae5;      --cyan-light: #7fd3f2; --cyan-pale: #8fdbf7;
  --blue-pale: #c4d9e8;

  /* ── OCI shared theme tokens: light ── */
  --color-bg-base: #f7f8fa;
  --color-bg-elevated: #ffffff;
  --color-bg-sunken: #f1f4f8;
  --color-border: #e1e7ee;
  --color-border-subtle: #edf1f5;
  --color-border-strong: #c4d1de;
  --color-text-primary: #0e2a4b;    /* Deep Navy is the ink, not black */
  --color-text-secondary: #4a6280;
  --color-text-tertiary: #8698ac;
  --color-text-inverted: #ffffff;
  --color-accent: #0069a7;          /* OneInsurance azure, the action colour */
  --color-accent-hover: #005588;

  /* ── This app's names, fed by the tokens above ── */
  --azure: var(--color-accent);            --azure-hover: var(--color-accent-hover);
  --azure-deep: #004a75;                   /* selected text on --sel-bg, 8.47:1 */
  --ink: var(--color-text-primary);        --navy: var(--navy-700);   --sky: var(--cyan);
  --mist: var(--blue-pale);                --blue-300: #96bfda;
  --secondary: var(--color-text-secondary);
  --muted: #5c7088;        /* OCI's tertiary #8698ac is 2.96:1 on white, too faint for help text;
                              lifted to 4.59:1 on the faintest ground it sits on (--sel-bg) */
  --placeholder: #76889d;  /* tertiary lifted to 3.63:1, the contrast the old placeholder had */

  /* Surfaces */
  --canvas: var(--color-bg-base);   --card: var(--color-bg-elevated);
  --sunken: var(--color-bg-sunken); --pressed: var(--color-border);
  --hairline: var(--color-border-subtle);
  --border: var(--color-border);    --border-strong: var(--color-border-strong);
  --sel-bg: #eef4f9; --sel-bg-2: #f5f8fa;  /* the accent wash (OCI --color-accent-subtle), solid */

  /* Status tints — the suite's shared pairs (VOCAL's --tint-* light values) */
  --att-bg: #fbeee5; --att-border: #f0c4a3; --att-text: #8a3d0a; --att-strong: #e06b35;
  --ok-bg:  #f1f6e6; --ok-border:  #c9dca0; --ok-text:  #3f5a14;
  --info-bg:#ecf4f2; --info-border:#b5d5ce; --info-text:#2c635a;

  --shadow-xs: 0 1px 2px rgba(14,42,75,.05);
  --shadow-sm: 0 1px 3px rgba(14,42,75,.08), 0 1px 2px rgba(14,42,75,.04);
  --shadow-md: 0 4px 12px rgba(14,42,75,.10), 0 2px 4px rgba(14,42,75,.05);
  --shadow-lg: 0 12px 32px rgba(14,42,75,.16), 0 2px 6px rgba(14,42,75,.06);

  --fast: 120ms ease-out;  --base: 160ms ease-out;
  --panel-w: 440px;        --topbar-h: 56px;   --gutter: 44px;

  /* Ink on filled azure: white in light (5.87:1). Dark flips it — see below. */
  --on-azure: var(--color-text-inverted);

  /* --ink is the TEXT colour. The banner needs navy as a GROUND, and in dark those two roles
     pull in opposite directions (text must lighten, the banner must not). So the ground gets
     its own token: OCI's sidebar navy, day and night, like the OCI chrome around it. */
  --banner: var(--navy-700);
  --scrim: rgb(10 27 51 / .38);
}

@media (min-width: 1800px) { :root { --panel-w: 500px; } .page { max-width: 1480px; } }

/* ─── DARK — OCI's `body.dark-mode`, value for value where it passes ────────────────────
   The whole app descends into the navy of OCI's sidebar instead of a separate near-black,
   so OOF inside OCI's panel has no seam. Tokens only: no component is styled in here.

   - The accent lightens to OCI's #4fb3e0 (6.10:1 on the card) to stay readable as a link.
     That is too light to carry white button text, so --on-azure flips to navy (7.27:1),
     as OCI's own dark primary button does.
   - Status washes use VOCAL's navy-tuned tints: the hue stays, the wash darkens and the
     text lifts together. Moving one without the other makes status pills illegible.
   - Shadows go black, as OCI's dark shadows do; borders do the separating. */

[data-theme="dark"] {
  --blue-pale: #24486f;   /* OCI: the chip ground has to darken or every tag glows */

  --color-bg-base: #081527;
  --color-bg-elevated: #0e2a4b;
  --color-bg-sunken: #0a1b33;
  --color-border: #1d3a5c;
  --color-border-subtle: #142c49;
  --color-border-strong: #2c5480;   /* kept as OCI has it: styles.css points --border at this,
                                       so a lift would brighten every card edge, not just inputs */
  --color-text-primary: #e6eef6;    /* 12.35:1 on the card */
  --color-text-secondary: #a3bad1;  /* 7.24:1 */
  --color-text-tertiary: #6f8ba7;   /* 4.08:1 */
  --color-text-inverted: #0a1b33;
  --color-accent: #4fb3e0;          /* 6.10:1 */
  --color-accent-hover: #7fd3f2;

  --azure-deep: var(--cyan-pale);   /* selected text on --sel-bg, 6.99:1 */
  --muted: #94acc4;                 /* VOCAL's lifted muted, 4.59:1 on --sel-bg */
  --placeholder: var(--color-text-tertiary);
  --pressed: var(--navy-600);
  --sel-bg: #184063; --sel-bg-2: #163c5e;  /* OCI's accent wash over the card, solid */

  --att-bg: #383a4b; --att-border: #6a595b; --att-text: #f5a072; --att-strong: #f5834c;
  --ok-bg:  #23414e; --ok-border:  #4a6c54; --ok-text:  #a3cf62;
  --info-bg:#193f57; --info-border:#346875; --info-text:#6ec4b3;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.30);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.36), 0 1px 2px rgba(0,0,0,.24);
  --shadow-md: 0 4px 12px rgba(0,0,0,.36), 0 2px 4px rgba(0,0,0,.24);
  --shadow-lg: 0 16px 40px -18px rgba(0,0,0,.6), 0 2px 6px rgba(0,0,0,.30);

  --scrim: rgb(2 9 20 / .72);
}
