/* =====================================================================
   MilI — "Midnight Aurora" — shared design tokens
   Deep-space base (#07080b) with glassy surfaces, holo gradient
   (amber -> coral -> iris) and iris as the interactive accent,
   replacing the previous "Anthracite Electric" palette (2026-07-10).
     - :root / .light-mode  -> canonical tokens (chat UI)
     - html.page-login      -> login-only overrides (glass/border/muted/grad)
     - html.page-admin      -> alias block, admin CSS keeps its token names
   ===================================================================== */

:root {
    /* surfaces — near-black space base, layered */
    --bg-primary:   #07080b;
    --bg-secondary: #101218;
    --bg-tertiary:  #181c25;
    --bg-hover:     #232837;
    --bg-glass:     rgba(255, 255, 255, 0.045);

    /* glass surfaces (pair with backdrop-filter) */
    --sidebar-glass: rgba(11, 13, 18, 0.55);
    --surface-glass: rgba(21, 24, 32, 0.5);
    --raise:         rgba(36, 41, 52, 0.55);
    --glass-hi:      inset 0 1px 0 rgba(255, 255, 255, 0.06);

    /* hairlines */
    --border:        rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.13);

    /* type */
    --text-primary:   #eef0f5;
    --text-secondary: #c2c7d2;
    --text-muted:     #8a90a0;   /* lifted for WCAG AA on the dark base */

    /* iris accent + aurora companions */
    --accent:       #8b9dff;
    --accent-hover: #b7c2ff;
    --accent-glow:  rgba(139, 157, 255, 0.24);
    --amber:        #f5b06a;
    --coral:        #ff8f6b;
    --mint:         #5ee6c4;
    --holo:         linear-gradient(120deg, #f5b06a, #ff8f6b 42%, #8b9dff);
    --on-holo:      #1a1206;    /* text/icon color ON the holo gradient */

    --user-bg:      linear-gradient(135deg, #5b6be0 0%, #8b9dff 100%);
    --assistant-bg: rgba(21, 24, 32, 0.5);

    /* semantic */
    --success: #5ee6c4;
    --error:   #ff7a70;
    --warning: #f5b06a;

    /* shape */
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;

    /* neutral shadows */
    --shadow-sm:   0 1px 2px rgba(0,0,0,0.4);
    --shadow-md:   0 8px 24px -8px rgba(0,0,0,0.55);
    --shadow-lg:   0 24px 60px -18px rgba(0,0,0,0.7);
    --shadow-glow: 0 0 0 1px var(--accent-glow), 0 8px 30px -6px var(--accent-glow);

    --sidebar-width: 300px;

    --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono:    'JetBrains Mono', ui-monospace, monospace;
    --font-display: 'Space Grotesk', 'Inter', sans-serif;

    color-scheme: dark;
}

.light-mode {
    --bg-primary:   #f3f4f9;
    --bg-secondary: #ffffff;
    --bg-tertiary:  #e9ebf3;
    --bg-hover:     #dfe3ee;
    --bg-glass:     rgba(20, 25, 55, 0.035);

    --sidebar-glass: rgba(255, 255, 255, 0.62);
    --surface-glass: rgba(255, 255, 255, 0.58);
    --raise:         rgba(228, 232, 244, 0.7);
    --glass-hi:      inset 0 1px 0 rgba(255, 255, 255, 0.7);

    --border:        rgba(18, 23, 48, 0.09);
    --border-strong: rgba(18, 23, 48, 0.16);

    --text-primary:   #181b26;
    --text-secondary: #4d5364;
    --text-muted:     #61687b;   /* WCAG AA on the light base */

    --accent:       #4f58c9;     /* deep iris — AA as small text on white */
    --accent-hover: #3a43ad;
    --accent-glow:  rgba(79, 88, 201, 0.16);

    --user-bg:      linear-gradient(135deg, #4f58c9 0%, #7583e8 100%);
    --assistant-bg: #ffffff;

    --success: #0c8a68;
    --error:   #d43a2f;
    --warning: #b45309;

    --shadow-sm:   0 1px 2px rgba(25,30,60,0.10);
    --shadow-md:   0 10px 26px -10px rgba(25,30,60,0.22);
    --shadow-lg:   0 24px 60px -18px rgba(25,30,60,0.28);
    --shadow-glow: 0 0 0 1px var(--accent-glow), 0 8px 30px -6px var(--accent-glow);

    color-scheme: light;
}

/* ---------------------------------------------------------------------
   login.html — page-scoped overrides (rest resolves from :root above).
   --grad is a login-only token (same gradient the chat calls --user-bg).
   --------------------------------------------------------------------- */
html.page-login {
    --bg-glass:      rgba(235, 240, 250, 0.04);
    --border:        rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text-muted:    #8a90a0;
    --grad:          linear-gradient(135deg, #5b6be0 0%, #8b9dff 100%);
}

/* ---------------------------------------------------------------------
   admin.html — alias block: admin CSS keeps its historical token names,
   they resolve to the shared tokens above.
   --------------------------------------------------------------------- */
html.page-admin {
    --bg:     var(--bg-primary);
    --panel:  var(--bg-secondary);
    --panel2: var(--bg-tertiary);
    --text:   var(--text-primary);
    --muted:  var(--text-muted);
    --ok:     var(--success);
    --bad:    var(--error);
    --warn:   var(--warning);
    /* admin shipped a slightly stronger hairline than the chat UI */
    --border: rgba(255,255,255,.09);
    /* admin never declared color-scheme -> keep the UA default ("normal"),
       :root above sets dark for chat/login only */
    color-scheme: normal;
}
