/* =============================================================================
   BLOCCO: Design tokens e reset globale — Archivia V1.0

   Scopo:
     Definisce l'identita' visiva dell'applicazione: palette colori,
     tipografia, reset base, classi di utilita'.

   Vincoli:
     - Sfondo pagina: grigio chiaro #eef1f5
     - Riquadri: bianco perla #fafbfc con box-shadow rilievo
     - Primary: blu #2563eb
     - Accent: azzurro #3b82f6
     - Font: system-ui stack (nessun Google Fonts)
     - Breakpoint mobile: 768px
     - Breakpoint tablet: 1024px
     - Nessun framework CSS

   Ultima modifica: 17/02/2026 | v1.0
   ============================================================================= */

/* -----------------------------------------------------------------------------
   Reset e base
   ----------------------------------------------------------------------------- */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background:
        radial-gradient(1200px 500px at 50% -20%, rgba(185, 221, 255, 0.28), transparent 60%),
        #eef2f7;
    color: #111827;
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* -----------------------------------------------------------------------------
   Design tokens (variabili CSS)
   ----------------------------------------------------------------------------- */

:root {
    --color-bg: #eef2f7;
    --color-surface: #fbfcff;
    --color-surface-hover: #f4f8ff;
    --color-primary: #1f4fbf;
    --color-primary-hover: #1a43a4;
    --color-accent: #4f9dff;
    --color-accent-hover: #3e8bed;
    --color-text: #111827;
    --color-text-muted: #4b5563;
    --color-text-light: #7b8798;
    --color-border: rgba(79, 157, 255, 0.2);
    --color-border-strong: rgba(79, 157, 255, 0.38);
    --color-success: #16a34a;
    --color-success-bg: rgba(22, 163, 74, 0.08);
    --color-error: #dc2626;
    --color-error-bg: rgba(220, 38, 38, 0.06);
    --color-warning: #d97706;
    --color-warning-bg: rgba(217, 119, 6, 0.08);

    --shadow-sm: 0 2px 8px rgba(31, 79, 191, 0.07);
    --shadow-md: 0 8px 20px rgba(31, 79, 191, 0.1);
    --shadow-lg: 0 14px 34px rgba(31, 79, 191, 0.14);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 999px;

    --max-width: 1280px;
    --topbar-height: 64px;
}

/* -----------------------------------------------------------------------------
   Tipografia
   ----------------------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
    color: #0f172a;
    font-weight: 700;
    line-height: 1.3;
}

h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.1rem; }

/* -----------------------------------------------------------------------------
   Layout centrato
   ----------------------------------------------------------------------------- */

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 16px;
}

.container-narrow {
    max-width: 480px;
    margin: 0 auto;
    padding: 40px 16px;
}

/* -----------------------------------------------------------------------------
   Card (riquadri bianco perla in rilievo)
   ----------------------------------------------------------------------------- */

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(2px);
}

.card-elevated {
    box-shadow: var(--shadow-lg);
    padding: 24px;
}

.card-title {
    margin-bottom: 12px;
    font-size: 1.35rem;
}

/* -----------------------------------------------------------------------------
   Alert / messaggi
   ----------------------------------------------------------------------------- */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 0.9rem;
    border: 1px solid;
}

.alert-success {
    background: var(--color-success-bg);
    border-color: rgba(22, 163, 74, 0.2);
    color: var(--color-success);
}

.alert-error {
    background: var(--color-error-bg);
    border-color: rgba(220, 38, 38, 0.2);
    color: var(--color-error);
}

.alert-warning {
    background: var(--color-warning-bg);
    border-color: rgba(217, 119, 6, 0.2);
    color: var(--color-warning);
}

/* -----------------------------------------------------------------------------
   Utilita'
   ----------------------------------------------------------------------------- */

.text-muted { color: var(--color-text-muted); font-size: 0.9rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-small { font-size: 0.85rem; }
.text-primary { color: var(--color-primary); }
.text-error { color: var(--color-error); }
.text-success { color: var(--color-success); }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* -----------------------------------------------------------------------------
   Tag pills
   ----------------------------------------------------------------------------- */

.tag {
    display: inline-block;
    font-size: 0.78rem;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border);
    background: rgba(37, 99, 235, 0.06);
    color: var(--color-primary);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.tag:hover {
    background: rgba(37, 99, 235, 0.12);
    border-color: var(--color-border-strong);
    text-decoration: none;
}

.tag-active {
    background: rgba(37, 99, 235, 0.15);
    border-color: var(--color-accent);
    font-weight: 700;
}

/* -----------------------------------------------------------------------------
   Badge contatori
   ----------------------------------------------------------------------------- */

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border);
    background: rgba(37, 99, 235, 0.06);
    font-weight: 700;
    color: var(--color-primary);
    font-size: 0.78rem;
    min-width: 32px;
    text-align: center;
}

/* -----------------------------------------------------------------------------
   Toast notification
   ----------------------------------------------------------------------------- */

.toast {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    background: #0f172a;
    color: #fff;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 9999;
}

.toast.show {
    opacity: 1;
}

/* -----------------------------------------------------------------------------
   Pagina setup e login
   ----------------------------------------------------------------------------- */

.page-setup,
.page-login {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
    padding-top: 60px;
}
