/* tokens.css — Temi chiaro e scuro: i token (custom properties) che tutto il resto usa.
   Un pezzo del foglio di PicSelect: l'ordine dei pezzi conta (la cascata) ed è in assets/app.js. */

/* ============================================================
   PicSelect — design system
   Temi: chiaro (default) e scuro su base grigia neutra.
   Meccanismo: token in custom properties; il tema segue il sistema
   (prefers-color-scheme) salvo override manuale via [data-theme].
   ============================================================ */

:root {
    color-scheme: light;

    --bg: #f7f7f8;
    --surface: #ffffff;
    --surface-2: #f1f1f3;
    --text: #1c1c1f;
    --text-muted: #6e6e76;
    --border: #e3e3e8;
    --border-strong: #cfcfd6;

    --accent: #2563eb;
    --btn-bg: #1c1c1f;
    --btn-text: #ffffff;

    --danger: #b91c1c;
    --danger-bg: #fdecec;
    --success: #15803d;
    --success-bg: #e8f5ec;

    --progress: #16a34a;
    --shadow: 0 1px 3px rgb(0 0 0 / 6%), 0 1px 2px rgb(0 0 0 / 4%);
    --radius: .5rem;
}

/* Tema scuro — base grigia neutra (nessuna dominante blu) */
[data-theme='dark'] {
    color-scheme: dark;

    --bg: #1a1a1a;
    --surface: #232323;
    --surface-2: #2c2c2c;
    --text: #e7e7e7;
    --text-muted: #9c9c9c;
    --border: #383838;
    --border-strong: #4a4a4a;

    --accent: #82b4fe;
    --btn-bg: #e7e7e7;
    --btn-text: #1a1a1a;

    --danger: #f07575;
    --danger-bg: #3a2626;
    --success: #63cf82;
    --success-bg: #24352a;

    --progress: #4caf6d;
    --shadow: 0 1px 3px rgb(0 0 0 / 40%);
}

/* Auto: senza override manuale segue il sistema */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) {
        color-scheme: dark;

        --bg: #1a1a1a;
        --surface: #232323;
        --surface-2: #2c2c2c;
        --text: #e7e7e7;
        --text-muted: #9c9c9c;
        --border: #383838;
        --border-strong: #4a4a4a;

        --accent: #82b4fe;
        --btn-bg: #e7e7e7;
        --btn-text: #1a1a1a;

        --danger: #f07575;
        --danger-bg: #3a2626;
        --success: #63cf82;
        --success-bg: #24352a;

        --progress: #4caf6d;
        --shadow: 0 1px 3px rgb(0 0 0 / 40%);
    }
}
