/**
 * tokens.css — stratul de TEME (preluat din sistemul "Asistent Personal").
 * O temă = un bloc de variabile. Componentele (app.css) folosesc DOAR aceste
 * variabile. Comutare: atribut <html data-theme="indigo|slate|sage|steel">.
 *
 * Teme light: indigo (implicit), slate, sage, steel.
 * Reguli: accentul se tematizează; semanticele (ok/warn/danger) NU — duc informație.
 */

:root {
    /* ── Tipografie ── */
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --fs-sm: 13px;
    --fs-base: 14px;
    --lh: 1.5;
    --fw-medium: 600;
    --fw-bold: 700;

    /* ── Spațiere / formă ── */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --radius: 6px;
    --radius-lg: 12px;
    --shadow: 0 1px 2px rgba(0, 0, 0, .06);
    --shadow-pop: 0 10px 26px rgba(34, 31, 82, .18);

    /* ── Suprafețe / text / linii ── */
    --bg: #f5f7fa;
    --surface: #ffffff;
    --surface-2: #f6f5fb;
    --text: #222222;
    --text-soft: #43555f;
    --muted: #6b7280;
    --line: #e0e0e0;
    --border: var(--line);          /* alias pt. markup CMI care folosea --border */

    /* ── Semantice (identice pe toate temele) ── */
    --ok: #1b6b43;     --ok-050: #e6f4ed;
    --warn: #92580a;   --warn-050: #fbf0dd;
    --danger: #b91c1c; --danger-050: #fdecea;
    --error: var(--danger);         /* alias */

    /* ── Rampa indigo (brandul implicit) ── */
    --ap-i900: #221f52; --ap-i700: #3d3a8f; --ap-i600: #4d49ab; --ap-i500: #6a66c9; --ap-i050: #eceaf7;

    /* ── Brand = INDIGO (implicit) ── */
    --accent: var(--ap-i600);
    --accent-hover: var(--ap-i700);
    --accent-strong: var(--ap-i700);
    --accent-050: var(--ap-i050);
    --accent-100: #e2e0f3;
    --accent-500: var(--ap-i500);
    --accent-900: var(--ap-i900);
    --on-accent: #ffffff;

    /* ── Derivate din accent (se re-rezolvă automat per temă) ── */
    --accent-border: color-mix(in srgb, var(--accent) 24%, #fff);
    --accent-ring: color-mix(in srgb, var(--accent) 16%, transparent);
}

/* ── TEMA SLATE (gri-albastru neutru) ── */
:root[data-theme="slate"] {
    --surface-2: #f4f6f8; --line: #dfe3e8;
    --accent: #4a5568; --accent-hover: #3d4759; --accent-strong: #2d3748; --accent-050: #eef1f5;
    --accent-100: #dbe1e9; --accent-500: #6b7688; --accent-900: #1d2530;
}
/* ── TEMA SAGE (verde-salvie) ── */
:root[data-theme="sage"] {
    --surface-2: #f3f7f1; --line: #dde6da;
    --accent: #5c7057; --accent-hover: #4a5c46; --accent-strong: #3b5e48; --accent-050: #e7efe4;
    --accent-100: #d4e0cf; --accent-500: #7d9377; --accent-900: #28402f;
}
/* ── TEMA STEEL (albastru-oțel) ── */
:root[data-theme="steel"] {
    --surface-2: #f2f6fa; --line: #dbe5ef;
    --accent: #3368a0; --accent-hover: #2a567f; --accent-strong: #264f7c; --accent-050: #e9f0f7;
    --accent-100: #cfdeef; --accent-500: #5d8bbd; --accent-900: #17304c;
}

/* ── Selector de temă (bulină = culoarea temei) ── */
.theme-switcher { display: inline-flex; align-items: center; gap: 2px; background: var(--surface-2);
    border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.theme-switcher__btn { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px;
    border: 0; background: none; border-radius: 999px; text-decoration: none; color: var(--muted);
    font-size: 12px; font-weight: 600; line-height: 1.4; cursor: pointer; }
.theme-switcher__btn:hover { color: var(--text); }
.theme-switcher__btn.is-active { background: #fff; color: var(--accent-strong); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.theme-switcher__dot { width: 11px; height: 11px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.theme-switcher__btn--indigo .theme-switcher__dot { background: #4d49ab; }
.theme-switcher__btn--slate  .theme-switcher__dot { background: #4a5568; }
.theme-switcher__btn--sage   .theme-switcher__dot { background: #5c7057; }
.theme-switcher__btn--steel  .theme-switcher__dot { background: #3368a0; }
@media (max-width: 720px) { .theme-switcher__code { display: none; } }
