/* SITE Design System — livello brand condiviso da tutte le UI del portale.
 *
 * Sorgente: design system "SITE" (tokens.json / tokens.css). Regole che qui
 * si applicano a OGNI pagina:
 *  - un solo accento (site-pink); il chrome (header/sidebar) e' sempre ink
 *  - tema chiaro/scuro a tre stati: nessuna scelta (segue il sistema),
 *    chiaro esplicito, scuro esplicito (data-theme su <html>, persistito in
 *    localStorage e applicato prima del paint da site-icons.js)
 *  - Inter per tutto, monospace per i dati (email, id, codici, MAC)
 *  - stato con pill (sfondo tenue + testo pieno dello stesso hue), mai col
 *    solo colore del testo in linea
 *  - bordi sottili, ombre solo su elementi flottanti (dropdown, modali)
 * Ogni colore e' definito nella palette chiara completa e ridefinito nei due
 * blocchi scuri: mai un colore che esista in uno solo dei due temi.
 */
@font-face { font-family: "Inter"; src: url("/static/inter-400.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/static/inter-500.ttf") format("truetype"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/static/inter-600.ttf") format("truetype"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/static/inter-700.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --site-pink: #e51156;
  --site-pink-light: #ff5d96;
  --site-pink-deep: #7a0836;
  --ink: #000000;
  --paper: #fafaf9;
  --surface: #ffffff;
  --text: #0b0b10;
  --pink-text: #7a0836;
  --slate: #53525c;
  --slate-soft: #8a8890;
  --border: #e7e4e1;
  --success: #1a8f5e;
  --success-bg: #e8f6ef;
  --warning: #b45309;
  --warning-bg: #fff3e0;
  --danger: #b91c1c;
  --danger-bg: #fbeaea;
  --neutral-bg: #f1eff2;
  --shadow-dropdown: 0 8px 24px rgba(0,0,0,.12);
  --shadow-modal: 0 10px 40px rgba(0,0,0,.2);
  --overlay: rgba(0,0,0,.45);
  --pink-active-bg: rgba(229,17,86,.16);
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px;
  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 14px; --radius-pill: 999px;
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --site-pink: #e51156; --site-pink-light: #ff5d96; --site-pink-deep: #7a0836; --ink: #000000;
    --paper: #131019; --surface: #1c1824; --text: #f1eff2; --pink-text: #ff5d96;
    --slate: #aca5b4; --slate-soft: #8b8594; --border: #322c39;
    --success: #4ade9a; --success-bg: #123527; --warning: #ffb35c; --warning-bg: #3a2a12;
    --danger: #f26b6b; --danger-bg: rgba(242,107,107,.12); --neutral-bg: #241f2c;
    --shadow-dropdown: 0 8px 24px rgba(0,0,0,.5); --shadow-modal: 0 10px 40px rgba(0,0,0,.6); --overlay: rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --site-pink: #e51156; --site-pink-light: #ff5d96; --site-pink-deep: #7a0836; --ink: #000000;
  --paper: #131019; --surface: #1c1824; --text: #f1eff2; --pink-text: #ff5d96;
  --slate: #aca5b4; --slate-soft: #8b8594; --border: #322c39;
  --success: #4ade9a; --success-bg: #123527; --warning: #ffb35c; --warning-bg: #3a2a12;
  --danger: #f26b6b; --danger-bg: rgba(242,107,107,.12); --neutral-bg: #241f2c;
  --shadow-dropdown: 0 8px 24px rgba(0,0,0,.5); --shadow-modal: 0 10px 40px rgba(0,0,0,.6); --overlay: rgba(0,0,0,.6);
  color-scheme: dark;
}

/* Icone del catalogo: 24x24, tratto currentColor, dimensione dal font-size. */
.icon { width: 1em; height: 1em; display: inline-block; flex-shrink: 0; vertical-align: -0.125em; }
.icon.lg { width: 1.25em; height: 1.25em; }

/* Tipografia condivisa (scala del design system). */
.site-eyebrow { font: 600 10.5px/14px var(--font-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--slate-soft); }
.site-mono, .mono { font-family: var(--font-mono); font-size: 12px; font-weight: 500; }

/* Pill di stato condivise. */
.site-pill { display: inline-flex; align-items: center; gap: 6px; font: 600 11.5px/16px var(--font-sans); padding: 3px 12px; border-radius: var(--radius-pill); white-space: nowrap; }
.site-pill.success { background: var(--success-bg); color: var(--success); }
.site-pill.warning { background: var(--warning-bg); color: var(--warning); }
.site-pill.danger { background: var(--danger-bg); color: var(--danger); }
.site-pill.neutral { background: var(--neutral-bg); color: var(--slate); }

/* Chrome scuro condiviso (header/sidebar/hero): sempre ink, non segue il tema. */
.site-chrome { background: var(--ink); color: #fff; }
.site-chrome .site-mark { height: 28px; width: auto; display: block; }
.site-chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(255,255,255,.22); border-radius: var(--radius-pill); padding: 6px 12px; color: #fff; background: transparent; font: 500 13px/18px var(--font-sans); cursor: pointer; }
.site-chip:hover { background: var(--pink-active-bg); border-color: var(--site-pink-light); }
.site-icon-btn { width: 34px; height: 34px; border-radius: var(--radius-pill); border: 1px solid rgba(255,255,255,.22); background: none; color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 16px; }
.site-icon-btn:hover { background: var(--pink-active-bg); border-color: var(--site-pink-light); }

/* Schermata "AuthScreen" e pagine pubbliche: fondo ink, marchio sopra la card, card surface. */
.site-auth { min-height: 100vh; background: var(--ink); display: grid; place-items: center; padding: 32px 16px; }
.site-auth-inner { width: min(460px, 100%); display: grid; gap: 22px; justify-items: center; }
.site-auth-inner .site-mark { height: 44px; width: auto; }
.site-auth-card { width: 100%; background: var(--surface); color: var(--text); border-radius: var(--radius-lg); padding: 28px; }
.site-auth-footer { color: rgba(255,255,255,.55); font: 400 12px/16px var(--font-sans); text-align: center; }
.site-auth-footer a, .site-auth-footer button { color: rgba(255,255,255,.75); background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
