/* _assets/tokens.css — Design token CONDIVISI (super-admin / Schulleiter / docente / studente / frontend).
   Fonte unica per colori, raggi, ombre, spaziature, focus. Caricato globalmente da includes/header.php.
   Convergenza (2026-07-03): i NEUTRI + accent di sd-* (studente) e tp-* (docente) ora derivano da questi
   token centrali (surface/ink/muted/faint/line + brand) → single source of truth. Restano da convertire
   admin-* (colori hardcoded) e alcuni toni specifici di ruolo. Usa var(--stl-*) nei nuovi stili. */
:root {
    /* Brand */
    --stl-brand:      #4f46e5;
    --stl-brand-2:    #6366f1;
    --stl-brand-ink:  #3730a3;
    --stl-brand-soft: #eef2ff;
    /* Semantici */
    --stl-ok:      #16a34a;  --stl-ok-soft:   #dcfce7;
    --stl-warn:    #d97706;  --stl-warn-soft: #fef9c3;
    --stl-danger:  #dc2626;  --stl-danger-soft:#fee2e2;
    --stl-info:    #0891b2;  --stl-info-soft: #cffafe;
    /* Neutri / testo */
    --stl-ink:    #1e293b;
    --stl-muted:  #64748b;
    --stl-faint:  #94a3b8;
    --stl-line:   #e2e8f0;
    --stl-surface:#ffffff;
    --stl-bg:     #f8fafc;
    /* Raggi */
    --stl-r-sm: 8px;  --stl-r: 12px;  --stl-r-lg: 16px;  --stl-r-xl: 20px;  --stl-r-pill: 999px;
    /* Ombre */
    --stl-sh-sm: 0 1px 3px rgba(15,23,42,.08);
    --stl-sh:    0 4px 16px rgba(15,23,42,.07);
    --stl-sh-lg: 0 12px 30px rgba(15,23,42,.14);
    /* Spaziature */
    --stl-sp-1:4px; --stl-sp-2:8px; --stl-sp-3:12px; --stl-sp-4:16px; --stl-sp-5:20px; --stl-sp-6:24px;
    /* Focus / transizioni */
    --stl-focus: 0 0 0 3px rgba(79,70,229,.35);
    --stl-t-fast: .15s ease;
    /* Sidebar (comune a tutti i portali) */
    --stl-sidebar-1: #1e293b;
    --stl-sidebar-2: #334155;
}

/* ── Dark mode (DORMIENTE) ──────────────────────────────────────────────
   Si attiva SOLO impostando <html data-theme="dark"> (nessun elemento lo fa oggi → nessun effetto).
   I temi sd-*/tp-* che ora derivano i NEUTRI dai token centrali (surface/ink/muted/faint/line + accent)
   erediteranno automaticamente. Groundwork per una futura dark mode "a interruttore" (toggle + attributo).
   NB: non ancora completa — colori hardcoded (admin_styles.css, valori non unificati di tp-*/sd-*) andranno
   convertiti prima di attivarla ufficialmente. */
:root[data-theme="dark"] {
    --stl-ink:    #e5e7eb;
    --stl-muted:  #9ca3af;
    --stl-faint:  #6b7280;
    --stl-line:   #334155;
    --stl-surface:#1e293b;
    --stl-bg:     #0f172a;
    --stl-sh-sm: 0 1px 3px rgba(0,0,0,.5);
    --stl-sh:    0 4px 16px rgba(0,0,0,.45);
    --stl-sh-lg: 0 12px 30px rgba(0,0,0,.55);
}

/* Accessibilità: anello di focus visibile e coerente su TUTTI i controlli (solo da tastiera). */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
    outline: none;
    box-shadow: var(--stl-focus);
    border-radius: var(--stl-r-sm);
}

/* Accessibilità: rispetta "riduci movimento" (utenti con sensibilità a animazioni/vertigini). */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}
