/* ============================================================
   THEME TOKENS — single source of truth for both themes.
   Loaded FIRST. The light theme flips these custom properties
   (including the legacy --cyber-* set consumed by style.css),
   so most of the 18k lines of legacy CSS re-theme for free.
   Toggle: html[data-theme="light"], set by base.html.
   ============================================================ */

:root {
    color-scheme: dark;

    /* modern token set */
    --bg: #0a192f;
    --bg-deep: #020c1b;
    --card: #12253f;
    --card-2: #0c1a30;
    --surface: #0d1f3a;
    --accent: #00d4ff;
    --accent-strong: #00bfff;
    --accent-2: #8b5cf6;
    --text: #eaf4ff;
    --text-muted: #9fbbe0;
    --border: rgba(0, 191, 255, .2);
    --border-strong: rgba(0, 191, 255, .4);
    --success: #34d399;
    --success-fill: #22c55e;
    --danger: #ff4d6a;
    --warning: #ffcf5c;
    --glow: 0 0 10px rgba(0, 191, 255, .35);
    --shadow: 0 8px 24px rgba(0, 0, 0, .28);

    /* ---- literal-tokens: every hardcoded dark color in templates now reads these ---- */
    --sur-page: #0a192f; --sur-1: #12253f; --sur-2: #0c1a30; --sur-in: #0a1628; --sur-hov: #14294a;
    --ink-hi: #eaf4ff; --ink: #e6f2ff; --ink-2: #cfe6ff; --ink-mut: #9fbbe0; --ink-link: #7fd4ff;
    --acc-t: #00d4ff; --acc2-t: #8b5cf6;
    --warn-t: #ffcf5c; --warn-t2: #ffe39a;
    --ok-t: #34d399; --ok-t2: #b8f5c9; --ok-fill: #22c55e; --ok-fill2: #16a34a;
    --bad-t: #ff4d6a; --bad-t2: #ffb4b4; --bad-fill: #ef4444; --bad-fill2: #b91c1c;
    --btn-ink: #08131f;
}

html[data-theme="light"] {
    color-scheme: light;

    /* eye-soothing light: blue-tinted greys, navy text (never harsh white/black) */
    --bg: #f6f8fb;
    --bg-deep: #eef2f8;
    --card: #ffffff;
    --card-2: #eef2f8;
    --surface: #ffffff;
    --accent: #2563eb;        /* cyan darkened for text-contrast on white */
    --accent-strong: #1d4ed8;
    --accent-2: #7c3aed;
    --text: #0f2440;
    --text-muted: #64748b;
    --border: #dde5ef;
    --border-strong: #c3d0e0;
    --success: #15803d;
    --success-fill: #16a34a;
    --danger: #be123c;
    --warning: #b45309;       /* amber must darken to stay readable as text */
    --glow: none;
    --shadow: 0 2px 6px rgba(23, 43, 66, .06), 0 10px 26px rgba(23, 43, 66, .09);

    /* ---- remap the legacy variable set consumed across style.css ---- */
    --cyber-primary: #2563eb;
    --cyber-secondary: #eef2f8;
    --cyber-accent: #1d4ed8;
    --cyber-text: #33465e;
    --cyber-text-dim: #64748b;
    --cyber-text-bright: #0f2440;
    --cyber-dark: #f6f8fb;
    --cyber-dark-alt: #ffffff;
    --cyber-dark-text: #111111;
    --cyber-mid-text: #64748b;
    --cyber-glow: none;   /* glows fully OFF in light — soft shadows read as smudged halos */
    --cyber-highlight: rgba(37, 99, 235, .10);
    --cyber-warning: #9a6a00;
    --cyber-danger: #c81e40;
    --cyber-success: #157f3d;
    --neon-text-shadow: none;
    --cyber-gradient: linear-gradient(90deg, #ffffff, #eef3f9 100%);

    /* ---- literal-tokens flipped for light ---- */
    --sur-page: #f6f8fb; --sur-1: #ffffff; --sur-2: #eef2f8; --sur-in: #ffffff; --sur-hov: #e7eefc;
    --ink-hi: #0f2440; --ink: #33465e; --ink-2: #33465e; --ink-mut: #64748b; --ink-link: #1d4ed8;
    --acc-t: #2563eb; --acc2-t: #7c3aed;
    --warn-t: #b45309; --warn-t2: #92600a;
    --ok-t: #15803d; --ok-t2: #136c34; --ok-fill: #16a34a; --ok-fill2: #127a43;
    --bad-t: #be123c; --bad-t2: #9f1239; --bad-fill: #d21f3c; --bad-fill2: #a01730;
    --btn-ink: #ffffff;

    /* ---- the separate --admin-* palette (enhanced-theme.css) flipped for light ---- */
    --admin-bg: #f6f8fb;
    --admin-panel: #eef2f8;
    --admin-card: #ffffff;
    --admin-border: #dde5ef;
    --admin-text: #0f2440;
    --admin-text-dim: #64748b;
    --admin-accent: #2563eb;
    --admin-accent-2: #1d4ed8;
}
