/* ============================================================================
   ACA DESIGN SYSTEM — TOKEN FOUNDATION
   Anti-Corruption Agency of the Republic of Uzbekistan
   v0.1 · 2026-08-06

   Three layers, after the NL Design System model:

     1. FOUNDATION  --aca-*          brand-wide primitives. Set once.
     2. THEME       --aca-color-*    semantic roles. Per-property overrides here.
     3. APPLICATION --accent, --bg…  what component CSS actually consumes.

   Component CSS must only ever reference layer 3. Nothing hardcodes a hex.
   Changing --aca-blue-600 below moves aca.uz, eanticor.uz and both Flutter
   apps together. That is the entire point.
   ============================================================================ */

:root{

  /* ---------------------------------------------------------------- LAYER 1
     FOUNDATION — primitives. No semantic meaning. Never used directly.
     -------------------------------------------------------------------- */

  /* Brand blue ramp. 600 is the live ACA brand colour, measured from
     aca.uz and eanticor.uz. 7.94:1 on white — clears WCAG AAA. */
  --aca-blue-100:#E7EFFE;
  --aca-blue-200:#CEDDF9;   /* map step 1 */
  --aca-blue-300:#7FA5EC;   /* map step 2 */
  --aca-blue-400:#6B94E8;   /* chart step 1 — 2.91:1, labels+table required */
  --aca-blue-500:#2E62D4;   /* chart step 2 — 5.52:1 */
  --aca-blue-600:#0244C6;   /* ★ BRAND PRIMARY — 7.94:1 (AAA) */
  --aca-blue-700:#0138A3;   /* links, hover — 9.93:1 (AAA) */
  --aca-blue-900:#01277A;   /* chart step 3 */

  /* Neutral ink ramp. */
  --aca-ink-900:#0F172A;
  --aca-ink-800:#1E293B;
  --aca-ink-700:#334155;
  --aca-ink-500:#556274;
  --aca-ink-400:#8FA0B4;
  --aca-ink-300:#A9B6C6;
  --aca-ink-200:#CBD5E1;
  --aca-ink-100:#E2E8F0;
  --aca-ink-75:#F1F5F9;
  --aca-ink-50:#F8FAFC;
  --aca-white:#FFFFFF;
  --aca-black:#020617;

  /* Status. Reserved — never reused as a chart series colour. */
  --aca-status-good:#15803D;
  --aca-status-warn:#A16207;
  --aca-status-error:#B91C1C;
  --aca-status-warn-soft:#FEF3C7; --aca-status-good-soft:#DCFCE7;   /* pill backgrounds */

  /* Space, radius, type scale. */
  --aca-space-1:4px;  --aca-space-2:8px;  --aca-space-3:12px;
  --aca-space-4:16px; --aca-space-5:24px; --aca-space-6:32px;
  --aca-space-7:48px; --aca-space-8:64px;
  --aca-radius-sm:3px; --aca-radius:6px; --aca-radius-lg:10px; --aca-radius-pill:99px;
  /* Type scale. Eight steps; every font-size in base.css is one of them. */
  --aca-text-xs:13px;  --aca-text-sm:14px;  --aca-text-base:16px; --aca-text-md:17px;
  --aca-text-lg:20px;  --aca-text-xl:24px;  --aca-text-2xl:28px;  --aca-text-3xl:34px;
  --aca-lh-tight:1.2;  --aca-lh-snug:1.4;   --aca-lh-body:1.6;    --aca-lh-prose:1.75;
  --aca-measure:70ch;                /* readable line length for running text */
  --aca-font:'Roboto','Segoe UI',system-ui,-apple-system,'Helvetica Neue',Arial,sans-serif;
  /* Roboto, as on president.uz. Whatever replaces it must cover Cyrillic as well as
     Latin — O'zbek / Ўзбек / Русский / English. Never a Latin-only face. */

  --aca-maxw:1200px;
  --aca-tap:44px;                    /* minimum touch target */
  --aca-control-h:52px;              /* one height for input / select / date */


  /* ---------------------------------------------------------------- LAYER 2
     THEME — semantic roles. A second property overrides ONLY this block.
     -------------------------------------------------------------------- */

  --aca-color-primary:        var(--aca-blue-600);
  --aca-color-primary-hover:  var(--aca-blue-700);
  --aca-color-primary-soft:   var(--aca-blue-100);
  --aca-color-on-primary:     var(--aca-white);

  --aca-color-bg:             var(--aca-ink-50);
  --aca-color-surface:        var(--aca-white);
  --aca-color-fg:             var(--aca-black);
  --aca-color-fg-muted:       var(--aca-ink-500);
  --aca-color-border:         var(--aca-ink-100);
  --aca-color-muted:          #E8ECF1;

  --aca-color-header-bg:      var(--aca-ink-900);
  --aca-color-header-fg:      var(--aca-ink-200);

  --aca-focus-ring:           3px solid var(--aca-color-primary);
  --aca-focus-offset:         2px;

  /* Chart ramp — SEQUENTIAL, single hue, light→dark.
     Encodes pipeline progression: new → under review → reviewed.
     Validated 2026-08-06 via dataviz/scripts/validate_palette.js:
       normal-vision ΔE 15.4 PASS · protan 15.2 PASS · tritan 12.2 PASS
       lightness monotonic 0.72 → 0.53 → 0.32
       step 1 contrast 2.91:1 — under 3:1, so direct labels AND a data
       table are MANDATORY wherever this ramp is used. Not optional. */
  --aca-chart-1: var(--aca-blue-400);
  --aca-chart-2: var(--aca-blue-500);
  --aca-chart-3: var(--aca-blue-900);
  /* Choropleth ramp - four steps of one hue, validated in base.css
     (adjacent dE 18.6 / 17.4 / 17.2). The two light steps are under 3:1,
     so every value is also printed in the region list and the table. */
  --aca-map-1: var(--aca-blue-200);
  --aca-map-2: var(--aca-blue-300);
  --aca-map-3: var(--aca-blue-500);
  --aca-map-4: var(--aca-blue-900);
  --aca-chart-grid:  var(--aca-ink-100);
  --aca-chart-axis:  var(--aca-ink-500);

  --aca-shadow-sm:0 1px 2px rgba(2,6,23,.06);
  --aca-shadow:0 2px 8px rgba(2,6,23,.08);
  --aca-shadow-lg:0 8px 24px rgba(2,6,23,.10);
  --aca-shadow-menu:0 12px 32px rgba(2,6,23,.16);


  /* ---------------------------------------------------------------- LAYER 3
     APPLICATION — the names component CSS consumes.
     Keeps existing stylesheets working untouched.
     -------------------------------------------------------------------- */

  --navy:        var(--aca-ink-900);
  --navy-2:      var(--aca-ink-800);
  --slate:       var(--aca-ink-700);
  --accent:      var(--aca-color-primary);
  --accent-dark: var(--aca-color-primary-hover);
  --accent-light:var(--aca-color-primary-soft);
  --bg:          var(--aca-color-bg);
  --card:        var(--aca-color-surface);
  --fg:          var(--aca-color-fg);
  --muted:       var(--aca-color-muted);
  --muted-fg:    var(--aca-color-fg-muted);
  --border:      var(--aca-color-border);

  --space-1:var(--aca-space-1); --space-2:var(--aca-space-2);
  --space-3:var(--aca-space-3); --space-4:var(--aca-space-4);
  --space-5:var(--aca-space-5); --space-6:var(--aca-space-6);
  --space-7:var(--aca-space-7); --space-8:var(--aca-space-8);
  --radius-sm:var(--aca-radius-sm); --radius:var(--aca-radius); --radius-lg:var(--aca-radius-lg);
  --maxw:var(--aca-maxw);
  --text-xs:var(--aca-text-xs); --text-sm:var(--aca-text-sm); --text-base:var(--aca-text-base);
  --text-md:var(--aca-text-md); --text-lg:var(--aca-text-lg); --text-xl:var(--aca-text-xl);
  --text-2xl:var(--aca-text-2xl); --text-3xl:var(--aca-text-3xl);
  --lh-tight:var(--aca-lh-tight); --lh-snug:var(--aca-lh-snug);
  --lh-body:var(--aca-lh-body); --lh-prose:var(--aca-lh-prose);
  --measure:var(--aca-measure);
  --control-h:var(--aca-control-h);
  /* Our own select chevron (the native one hugs the edge). A data URI cannot
     read currentColor, so the contrast modes below restate it. */
  --select-chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  --shadow-sm:var(--aca-shadow-sm); --shadow:var(--aca-shadow);
  --shadow-lg:var(--aca-shadow-lg); --shadow-menu:var(--aca-shadow-menu);
}

/*site:eanticor*/
/* ----------------------------------------------------------------------------
   EANTICOR THEME OVERRIDE
   Add class="theme-eanticor" to <html> to reskin. Layer 2 only — proof that
   a second property never touches foundation or component CSS.
   Currently identical to ACA by intent: one agency, one identity. Diverge
   here only if eanticor is deliberately given its own accent.
   -------------------------------------------------------------------------- */
.theme-eanticor{
  --aca-color-primary:       var(--aca-blue-600);
  --aca-color-primary-hover: var(--aca-blue-700);
}
/*/site:eanticor*/

/* ----------------------------------------------------------------------------
   ACCESSIBILITY CONTRAST MODES — set by a11y.js as html[data-a11y-contrast].
   Layer 2 only, exactly like a second property would reskin: components keep
   consuming --bg, --fg, --border… and follow. The chart ramp becomes three
   steps of the foreground so magnitude still reads. Dark surfaces that
   base.css paints with literals are remapped in its "Accessibility" block.
   -------------------------------------------------------------------------- */
html[data-a11y-contrast="light"]{
  --select-chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  --aca-color-bg:#fff; --aca-color-surface:#fff; --aca-color-fg:#000;
  --aca-color-fg-muted:#000; --aca-color-border:#000; --aca-color-muted:#eee;
  --aca-color-primary:#000; --aca-color-primary-hover:#000; --aca-color-primary-soft:#eee;
  --aca-color-on-primary:#fff; --aca-ink-900:#000; --aca-ink-800:#000; --aca-ink-700:#000;
  --aca-ink-500:#000; --aca-ink-400:#000; --aca-ink-300:#000; --aca-ink-200:#000;
  --aca-ink-100:#000; --aca-ink-75:#eee; --aca-ink-50:#fff;
  --aca-chart-1:#999; --aca-chart-2:#555; --aca-chart-3:#000; --aca-chart-grid:#ccc;
  --aca-map-1:#ddd; --aca-map-2:#aaa; --aca-map-3:#666; --aca-map-4:#000;
  --aca-status-good:#000; --aca-status-warn:#000; --aca-status-error:#000;
  --aca-status-warn-soft:#fff; --aca-status-good-soft:#fff;
  --aca-shadow-sm:none; --aca-shadow:none; --aca-shadow-lg:none; --aca-shadow-menu:none;
}
html[data-a11y-contrast="dark"]{
  --select-chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  --aca-color-bg:#000; --aca-color-surface:#000; --aca-color-fg:#fff;
  --aca-color-fg-muted:#fff; --aca-color-border:#fff; --aca-color-muted:#222;
  --aca-color-primary:#fff; --aca-color-primary-hover:#fff; --aca-color-primary-soft:#222;
  --aca-color-on-primary:#000; --aca-ink-900:#000; --aca-ink-800:#000; --aca-ink-700:#fff;
  --aca-ink-500:#fff; --aca-ink-400:#fff; --aca-ink-300:#fff; --aca-ink-200:#fff;
  --aca-ink-100:#fff; --aca-ink-75:#222; --aca-ink-50:#000;
  --aca-chart-1:#888; --aca-chart-2:#ccc; --aca-chart-3:#fff; --aca-chart-grid:#444;
  --aca-map-1:#333; --aca-map-2:#777; --aca-map-3:#bbb; --aca-map-4:#fff;
  --aca-status-good:#fff; --aca-status-warn:#fff; --aca-status-error:#fff;
  --aca-status-warn-soft:#000; --aca-status-good-soft:#000;
  --aca-shadow-sm:none; --aca-shadow:none; --aca-shadow-lg:none; --aca-shadow-menu:none;
}
html[data-a11y-contrast="yellow"]{
  --select-chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffff00' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  --aca-color-bg:#000; --aca-color-surface:#000; --aca-color-fg:#ff0;
  --aca-color-fg-muted:#ff0; --aca-color-border:#ff0; --aca-color-muted:#222;
  --aca-color-primary:#ff0; --aca-color-primary-hover:#ff0; --aca-color-primary-soft:#222;
  --aca-color-on-primary:#000; --aca-ink-900:#000; --aca-ink-800:#000; --aca-ink-700:#ff0;
  --aca-ink-500:#ff0; --aca-ink-400:#ff0; --aca-ink-300:#ff0; --aca-ink-200:#ff0;
  --aca-ink-100:#ff0; --aca-ink-75:#222; --aca-ink-50:#000;
  --aca-chart-1:#880; --aca-chart-2:#cc0; --aca-chart-3:#ff0; --aca-chart-grid:#444;
  --aca-map-1:#330; --aca-map-2:#770; --aca-map-3:#bb0; --aca-map-4:#ff0;
  --aca-status-good:#ff0; --aca-status-warn:#ff0; --aca-status-error:#ff0;
  --aca-status-warn-soft:#000; --aca-status-good-soft:#000;
  --aca-shadow-sm:none; --aca-shadow:none; --aca-shadow-lg:none; --aca-shadow-menu:none;
}
/* Wider line spacing: the tokens do the work, no selector list to maintain. */
html[data-a11y-lines="wide"]{
  --aca-lh-tight:1.5; --aca-lh-snug:1.7; --aca-lh-body:1.9; --aca-lh-prose:2.1;
}
