/*
 * Token di design Hyper (--hy-*).
 * Fonte dei valori: docs/ui/COMPONENTI.md, schede F1–F6.
 * Tema scuro = valori attuali del portale (predefinito).
 * Tema chiaro = attivo solo con data-theme="light" su <html> (UI-GUIDE §3.3).
 * Le pagine usano solo questi token: niente colori scritti a mano.
 */

:root {
    /* Tipografia (F2) */
    --hy-font-sans: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --hy-font-heading: "Montserrat", "Inter", "Segoe UI", system-ui, sans-serif;
    --hy-text-xs: .75rem;
    --hy-text-sm: .8125rem;
    --hy-text-md: .875rem;
    --hy-text-lg: 1rem;
    --hy-text-xl: 1.125rem;
    --hy-text-2xl: 1.375rem;
    --hy-text-3xl: 1.75rem;
    --hy-weight-regular: 400;
    --hy-weight-base: 500;
    --hy-weight-strong: 600;
    --hy-weight-bold: 700;
    --hy-leading-text: 1.45;
    --hy-leading-heading: 1.2;

    /* Spaziature (F3) */
    --hy-space-1: 4px;
    --hy-space-2: 8px;
    --hy-space-3: 12px;
    --hy-space-4: 16px;
    --hy-space-5: 20px;
    --hy-space-6: 24px;
    --hy-space-8: 32px;
    --hy-space-10: 40px;
    --hy-gutter: 24px;

    /* Raggi (F4) */
    --hy-radius-sm: 6px;
    --hy-radius-md: 10px;
    --hy-radius-lg: 16px;
    --hy-radius-pill: 999px;

    /* Scala z-index (UI-GUIDE §5.3) */
    --hy-z-base: 0;
    --hy-z-sticky: 100;
    --hy-z-dropdown: 1000;
    --hy-z-toolbar: 1010;
    --hy-z-overlay: 1040;
    --hy-z-modal: 1050;
    --hy-z-popover: 1070;
    --hy-z-assistant: 1080;
    --hy-z-toast: 1090;

    /* Animazioni (F6) */
    --hy-dur-fast: 120ms;
    --hy-dur-base: 180ms;
    --hy-dur-slow: 240ms;

    /* Brand (F1, D24): un solo magenta, quello del logo */
    --hy-brand-dark: #3c3c3b;
    --hy-accent: #e6007e;
    --hy-accent-fill: var(--hy-accent);
    --hy-accent-hover: #c4006b;
    --hy-on-accent: #ffffff;

    /* ---- Tema scuro (predefinito) ---- */
    --hy-bg: #c4cacc;
    --hy-bg-image: url('/images/backgroundautomation.png');
    --hy-bg-overlay-top: rgba(8, 10, 14, 0.32);
    --hy-bg-overlay: rgba(8, 10, 14, 0.40);

    --hy-glass: rgba(36, 38, 42, 0.66);
    --hy-glass-strong: rgba(28, 30, 34, 0.86);
    --hy-glass-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01));
    --hy-glass-border: rgba(255, 255, 255, 0.16);
    --hy-glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.16);
    --hy-glass-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
    --hy-glass-blur: blur(8px) saturate(118%);

    --hy-surface-alt: rgba(255, 255, 255, 0.04);
    --hy-surface-raised: rgba(36, 38, 42, 0.96);
    --hy-surface-header: rgba(60, 60, 59, 0.82);
    --hy-control-bg: rgba(59, 59, 58, 0.96);

    --hy-text: #f5f5f5;
    --hy-text-muted: #c7c9ce;
    --hy-text-placeholder: #aeb3bb;
    --hy-border: rgba(255, 255, 255, 0.10);
    --hy-border-control: rgba(255, 255, 255, 0.38); /* D19: da tarare tra .28 e .38 sul pilota */

    --hy-accent-soft: rgba(230, 0, 126, 0.14);
    --hy-accent-text: #ff4fa8;
    --hy-focus-ring: #ff4fa8;

    --hy-success: #7cc4a0;
    --hy-success-tint: rgba(27, 127, 83, 0.10);
    --hy-success-fill: #1b7f53;
    --hy-success-on: #ffffff;
    --hy-danger: #f08a93;
    --hy-danger-tint: rgba(201, 48, 63, 0.10);
    --hy-danger-fill: #c9303f;
    --hy-danger-on: #ffffff;
    --hy-warning: #e8c26a;
    --hy-warning-tint: rgba(224, 165, 38, 0.10);
    --hy-warning-fill: #e0a526;
    --hy-warning-on: #1f2023;
    --hy-info: #8bbfe6;
    --hy-info-tint: rgba(43, 108, 176, 0.12);
    --hy-info-fill: #2b6cb0;
    --hy-info-on: #ffffff;

    --hy-shadow-1: 0 2px 8px rgba(0, 0, 0, 0.24);
    --hy-shadow-2: 0 10px 22px rgba(0, 0, 0, 0.24);
    --hy-shadow-3: 0 16px 34px rgba(0, 0, 0, 0.34);

    /* Componenti (C1 bottoni glass, O1 velatura, K6 skeleton) */
    --hy-btn-glass-bg: rgba(255, 255, 255, 0.12);
    --hy-btn-glass-border: rgba(255, 255, 255, 0.16);
    --hy-btn-glass-text: #ffffff;
    --hy-btn-glass-blur: blur(8px);
    --hy-btn-shadow: 0 10px 20px rgba(0, 0, 0, 0.16);
    --hy-btn-shadow-hover: 0 14px 24px rgba(0, 0, 0, 0.22);
    --hy-icon-circle-on-fill: rgba(255, 255, 255, 0.22);
    --hy-backdrop: rgba(8, 10, 14, 0.55);
    --hy-skeleton: rgba(255, 255, 255, 0.08);

    /* Calendario richieste: un colore per tipo (palette attuale di Requests/Scheduler), testo chiaro in entrambi i temi */
    --hy-cal-text: #f5f7fa;
    --hy-cal-F: rgb(69, 102, 138);
    --hy-cal-P: rgb(74, 125, 95);
    --hy-cal-4: rgb(78, 117, 120);
    --hy-cal-S: rgb(105, 124, 70);
    --hy-cal-M: rgb(138, 84, 96);
    --hy-cal-I: rgb(128, 82, 87);
    --hy-cal-D: rgb(116, 72, 88);
    --hy-cal-C: rgb(134, 92, 58);
    --hy-cal-U: rgb(70, 98, 138);
    --hy-cal-T: rgb(89, 87, 138);
    --hy-cal-K: rgb(64, 112, 130); /* auto personale */
    --hy-cal-O: rgb(82, 90, 150); /* straordinario (indaco del calendario di prima, attenuato) */
    --hy-cal-default: rgb(79, 93, 114);
}

@media (max-width: 767.98px) {
    :root {
        --hy-gutter: 16px;
    }
}

/* ---- Tema chiaro: attivo solo con data-theme="light" (D9) ---- */
:root[data-theme="light"] {
    --hy-bg-image: url('/images/backgroundautomation-light.png');
    --hy-bg-overlay-top: rgba(244, 245, 247, 0.24);
    --hy-bg-overlay: rgba(244, 245, 247, 0.34);

    --hy-glass: rgba(255, 255, 255, 0.62);
    --hy-glass-strong: rgba(255, 255, 255, 0.86);
    --hy-glass-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.30));
    --hy-glass-border: rgba(255, 255, 255, 0.70);
    --hy-glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.90);
    --hy-glass-shadow: 0 14px 30px rgba(16, 24, 40, 0.12);
    --hy-glass-blur: blur(12px) saturate(140%);

    --hy-surface-alt: rgba(16, 24, 40, 0.03);
    --hy-surface-raised: rgba(255, 255, 255, 0.97);
    --hy-surface-header: rgba(238, 240, 243, 0.92);
    --hy-control-bg: #ffffff;

    --hy-text: #1f2023;
    --hy-text-muted: #5b6068;
    --hy-text-placeholder: #6b7079;
    --hy-border: #dde0e5;
    --hy-border-control: #8a9099;

    --hy-accent-soft: rgba(230, 0, 126, 0.08);
    --hy-accent-text: #c4006b;
    --hy-focus-ring: #e6007e;

    --hy-success: #1b7f53;
    --hy-success-tint: rgba(27, 127, 83, 0.06);
    --hy-danger: #c9303f;
    --hy-danger-tint: rgba(201, 48, 63, 0.06);
    --hy-warning: #8a5a00;
    --hy-warning-tint: rgba(224, 165, 38, 0.10);
    --hy-info: #2b6cb0;
    --hy-info-tint: rgba(43, 108, 176, 0.06);

    --hy-shadow-1: 0 1px 3px rgba(16, 24, 40, 0.10);
    --hy-shadow-2: 0 4px 12px rgba(16, 24, 40, 0.10);
    --hy-shadow-3: 0 12px 32px rgba(16, 24, 40, 0.16);

    --hy-btn-glass-bg: rgba(255, 255, 255, 0.72);
    --hy-btn-glass-border: #8a9099;
    --hy-btn-glass-text: #1f2023;
    --hy-btn-glass-blur: blur(12px);
    --hy-btn-shadow: 0 6px 14px rgba(16, 24, 40, 0.10);
    --hy-btn-shadow-hover: 0 10px 20px rgba(16, 24, 40, 0.14);
    --hy-skeleton: rgba(16, 24, 40, 0.08);
}
