/* =====================================================================================================
   AI Systems Group — Unified Design Tokens (the ONE uniform theme across all products)
   -----------------------------------------------------------------------------------------------------
   CANONICAL SHARED SOURCE. This file is PRODUCT-NEUTRAL — it carries no Moe Money / Eve Sales / Eve EA
   branding. Every product includes this file UNCHANGED and overlays ONLY its own accent + logo + name
   (see --product-accent). That is what makes the theme uniform across every AI Systems Group project.

   Home: this is authored here for delivery; it belongs in the SEPARATE central design-system repo (Moe
   2026-07-13 "it will be separate but I want a uniform theme amongst all my projects"). Products vendor a
   copy under their own static dir and include it BEFORE their product stylesheet. The two Eves receive it
   via the ADMIN courier so all projects stay byte-identical.

   Color never carries meaning alone (WCAG) — pair every state with text and, where useful, an icon.
   Values from AI_SYSTEMS_GROUP_UNIFIED_PRODUCT_STANDARD.md §Visual language.
   ===================================================================================================== */

:root,
:root[data-theme="dark"] {
  /* --- base palette (deep ink/navy, layered slate surfaces, warm off-white text) --- */
  --aisg-bg:            #0b1220;   /* deep ink/navy page background */
  --aisg-surface-1:     #111a2b;   /* primary card surface */
  --aisg-surface-2:     #16223a;   /* raised / nested surface */
  --aisg-surface-3:     #1d2c49;   /* highest elevation / hover */
  --aisg-border:        #26375a;   /* visible border on surfaces */
  --aisg-border-strong: #35507f;

  --aisg-text:          #f2f6ff;   /* primary — warm off-white */
  --aisg-text-2:        #a9b8d4;   /* secondary — cool gray-blue */
  --aisg-text-3:        #7688a8;   /* tertiary / muted */

  /* --- semantic accents (meaning is FIXED company-wide) --- */
  --aisg-success:       #2bb9a3;   /* verified / success — teal */
  --aisg-success-ink:   #052b26;
  --aisg-accent:        #6d7cff;   /* interactive / AI — indigo */
  --aisg-accent-ink:    #0a1030;
  --aisg-ai:            #6d7cff;   /* AI/assistant == interactive indigo */
  --aisg-warn:          #f5b83d;   /* attention / pending — amber */
  --aisg-warn-ink:      #2a1d00;
  --aisg-danger:        #ef4444;   /* destructive / error / LIVE-money danger — red */
  --aisg-danger-ink:    #2a0606;
  --aisg-info:          #4b9dff;   /* informational — blue */

  /* Semantic TEXT colors — separated from the fill colors so small badge/label text meets AA. On the
     dark base the bright semantic colors already pass, so text == fill here; the light theme overrides
     these with darker values (a bright fill fails as small text on light). */
  --aisg-success-text:  var(--aisg-success);
  --aisg-warn-text:     var(--aisg-warn);
  --aisg-danger-text:   var(--aisg-danger);
  --aisg-info-text:     var(--aisg-info);
  --aisg-ai-text:       var(--aisg-ai);

  /* --- per-product overlay: a product sets ONLY this (accent + logo + name), never the base above --- */
  --product-accent:     var(--aisg-accent);

  /* --- spacing scale (4px base) --- */
  --aisg-space-0: 0; --aisg-space-1: 4px; --aisg-space-2: 8px; --aisg-space-3: 12px;
  --aisg-space-4: 16px; --aisg-space-5: 24px; --aisg-space-6: 32px; --aisg-space-8: 48px;

  /* --- typography scale --- */
  --aisg-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --aisg-font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --aisg-fs-xs: .72rem; --aisg-fs-sm: .85rem; --aisg-fs-md: 1rem; --aisg-fs-lg: 1.25rem;
  --aisg-fs-xl: 1.6rem; --aisg-fs-2xl: 2rem;
  --aisg-lh: 1.55; --aisg-lh-tight: 1.25;

  /* --- radius family --- */
  --aisg-radius-sm: 6px; --aisg-radius-md: 10px; --aisg-radius-lg: 14px; --aisg-radius-pill: 999px;

  /* --- elevation family (subtle; business-software restraint) --- */
  --aisg-elev-1: 0 1px 2px rgba(0,0,0,.30);
  --aisg-elev-2: 0 4px 14px rgba(0,0,0,.35);
  --aisg-elev-3: 0 10px 30px rgba(0,0,0,.45);

  /* --- focus + motion policy --- */
  --aisg-focus-ring: 0 0 0 3px rgba(109,124,255,.55);
  --aisg-motion-fast: 120ms ease; --aisg-motion: 200ms ease;

  /* --- layout system --- */
  --aisg-content-max: 1080px;
  --aisg-touch-min: 44px;         /* minimum touch target (CSS px) */
  --aisg-nav-w: 232px;            /* desktop left nav */
  --aisg-bottomnav-h: 60px;       /* mobile bottom nav */
}

/* Light theme — same token NAMES, business-legible values. The TWO light blocks below (explicit
   data-theme and the prefers-color-scheme fallback) are kept BYTE-IDENTICAL so media-query ordering can
   never silently restore an inaccessible value (P0.5 review). Fill colors are the brand hues; the
   *-text values are darkened so small badge/label text clears WCAG AA (>=4.5:1) on light surfaces. */
:root[data-theme="light"] {
  --aisg-bg:#eef2f9; --aisg-surface-1:#ffffff; --aisg-surface-2:#f4f7fc; --aisg-surface-3:#e8eef8;
  --aisg-border:#d3ddec; --aisg-border-strong:#b4c4dd;
  --aisg-text:#0d1626; --aisg-text-2:#3c4d66; --aisg-text-3:#556579;
  --aisg-success:#0f9d8c; --aisg-accent:#4b5bd8; --aisg-ai:#4b5bd8; --aisg-warn:#b9791a;
  --aisg-danger:#d13636; --aisg-info:#2f6fd6;
  --aisg-success-text:#0a6157; --aisg-warn-text:#8a5a12; --aisg-danger-text:#b42318;
  --aisg-info-text:#1f5fbf; --aisg-ai-text:#3d4bc4;
}
/* OS preference selects light ONLY when the document has made NO explicit choice. Once any data-theme is
   set (the app always sets one — default dark/midnight), the SELECTED theme governs and the OS is
   ignored, so a chosen theme can never be silently overridden by the browser color-scheme (P0.5 R8 #4). */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --aisg-bg:#eef2f9; --aisg-surface-1:#ffffff; --aisg-surface-2:#f4f7fc; --aisg-surface-3:#e8eef8;
    --aisg-border:#d3ddec; --aisg-border-strong:#b4c4dd;
    --aisg-text:#0d1626; --aisg-text-2:#3c4d66; --aisg-text-3:#556579;
    --aisg-success:#0f9d8c; --aisg-accent:#4b5bd8; --aisg-ai:#4b5bd8; --aisg-warn:#b9791a;
    --aisg-danger:#d13636; --aisg-info:#2f6fd6;
    --aisg-success-text:#0a6157; --aisg-warn-text:#8a5a12; --aisg-danger-text:#b42318;
    --aisg-info-text:#1f5fbf; --aisg-ai-text:#3d4bc4;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root { --aisg-motion-fast: 0ms; --aisg-motion: 0ms; }
}
