/* ============================================================================
   Timema · tema grafico dell'applicazione
   Adattato dal template di riferimento (webtemplate/example.html).
   Si carica DOPO Bootstrap: le definizioni qui sotto vincono sui default.
   ============================================================================ */

/* ---------------------------------------------------------------------------
   1. PALETTE E BASE
   --------------------------------------------------------------------------- */
:root {
    --rosso: #a81e22;
    --rosso-scuro: #8c171b;
    --nero: #1b1b1b;
    --fumo: #141414;
    --carta: #f3f3f0;
    --linea: #e6e6e1;
    --grigio: #8a8a86;
    --grigio-chiaro: #c7c7c2;
    --bronzo: #c08a3e;
    --bronzo-scuro: #9a6e2c;
    --testo: #2b2b29;
    --raggio: 14px;

    /* Fregio greco (meandro) in tre varianti di colore */
    --meandro-bronzo: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='10' viewBox='0 0 24 10'><path d='M1 9H22V1H7V6H14' fill='none' stroke='%23C08A3E' stroke-width='1.6'/></svg>");
    --meandro-rosso: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='10' viewBox='0 0 24 10'><path d='M1 9H22V1H7V6H14' fill='none' stroke='%23A81E22' stroke-width='1.6'/></svg>");
    --meandro-grigio: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='10' viewBox='0 0 24 10'><path d='M1 9H22V1H7V6H14' fill='none' stroke='%23B9B9B3' stroke-width='1.6'/></svg>");

    /* Allinea alcuni token di Bootstrap al tema */
    --bs-body-font-family: 'Manrope', system-ui, sans-serif;
    --bs-primary: var(--rosso);
}

* { scrollbar-width: thin; }

::selection { background: var(--rosso); color: #fff; }

body {
    margin: 0;
    font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--carta);
    color: var(--testo);
}

.font-display { font-family: 'Cinzel', serif; }

a { color: var(--rosso); text-decoration: none; }
a:hover { color: var(--rosso-scuro); text-decoration: underline; }

h1 { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.01em; margin: 0; }
h2 { font-size: 1.02rem; font-weight: 800; margin: 0 0 0.75rem; }
h3 { font-size: 0.95rem; font-weight: 800; margin: 0 0 0.5rem; }

/* Striscia a meandro (fregio greco) */
.meander { height: 10px; background: var(--meandro-bronzo) repeat-x left center; }
.meander-gray { background-image: var(--meandro-grigio); }
.meander-red { background-image: var(--meandro-rosso); }

/* ---------------------------------------------------------------------------
   2. CARDS & COMPONENTI BASE
   --------------------------------------------------------------------------- */
.card {
    display: block;
    background: #fff;
    border: 1px solid var(--linea);
    border-radius: var(--raggio);
    box-shadow: 0 1px 2px rgba(27, 27, 27, 0.04), 0 10px 26px -20px rgba(27, 27, 27, 0.3);
    padding: 1.4rem 1.5rem;
    margin-bottom: 1.25rem;
}

/* Card "a tutta pagina" con intestazione e corpo (stile template) */
.card-flush { padding: 0; overflow: hidden; }

.card-header-x {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--linea);
}

.card-body-x { padding: 1.1rem 1.25rem; }

.tit {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 0.98rem;
    letter-spacing: 0.04em;
    color: var(--nero);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0;
}

.tit i { color: var(--rosso); font-size: 1.05rem; }

.card-narrow { max-width: 440px; margin-inline: auto; }

/* --- Bottoni -------------------------------------------------------------- */
.btn {
    display: inline-block;
    border: 1px solid var(--linea);
    background: #fff;
    color: #4a4a45;
    padding: 0.55rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover { background: #f7f7f4; color: var(--nero); text-decoration: none; }

.btn-primary {
    background: var(--rosso);
    border-color: var(--rosso-scuro);
    color: #fff;
}

.btn-primary:hover { background: var(--rosso-scuro); border-color: var(--rosso-scuro); color: #fff; }

.btn-forge {
    background: var(--rosso);
    color: #fff;
    border: 1px solid var(--rosso-scuro);
    font-weight: 700;
    border-radius: 10px;
    padding: 0.55rem 1rem;
}

.btn-forge:hover { background: var(--rosso-scuro); color: #fff; }

.btn-anvil {
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #f1f1ed;
    background: transparent;
    border-radius: 10px;
    font-weight: 700;
    padding: 0.55rem 1rem;
}

.btn-anvil:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

.btn-pill {
    border: 1px solid var(--linea);
    background: #fff;
    border-radius: 9px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #4a4a45;
}

.btn-pill:hover { background: #f7f7f4; color: var(--nero); }

.btn-bronzo { background: var(--bronzo); color: #1b1408; font-weight: 800; border: 1px solid var(--bronzo-scuro); border-radius: 9px; }
.btn-bronzo:hover { background: #b57e33; color: #1b1408; }

.btn-small { padding: 0.3rem 0.6rem; font-size: 0.82rem; border-radius: 8px; }
.btn-danger { border-color: #f3cfd0; color: var(--rosso); }
.btn-danger:hover { background: #fdeaea; }
.btn-ghost { background: transparent; border-color: rgba(255, 255, 255, 0.4); color: #fff; }

.link-forge { color: var(--rosso); font-weight: 700; text-decoration: none; font-size: 0.82rem; }
.link-forge:hover { text-decoration: underline; color: var(--rosso-scuro); }

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--linea);
    background: #fff;
    color: #55554f;
    display: grid;
    place-items: center;
    position: relative;
    cursor: pointer;
}

.icon-btn:hover { color: var(--rosso); border-color: #d9d9d3; }

/* ---------------------------------------------------------------------------
   3. SIDEBAR (offcanvas sotto i 992px, fissa sopra)
   --------------------------------------------------------------------------- */
.sidebar { --bs-offcanvas-width: 300px; background: var(--fumo); color: #f0f0eb; }
.sidebar .offcanvas-body { padding: 0; display: flex; flex-direction: column; overflow-y: auto; }
.sidebar .offcanvas-body::-webkit-scrollbar { width: 8px; }
.sidebar .offcanvas-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 8px; }

.brand-name { font-family: 'Cinzel', serif; font-weight: 700; color: #f4f4f0; font-size: 1.16rem; letter-spacing: 0.08em; line-height: 1.1; }
.brand-name span { color: #c93a3e; }
.brand-tag { font-size: 0.64rem; color: #8b8b86; letter-spacing: 0.06em; }

.nav-label {
    font-size: 0.64rem;
    letter-spacing: 0.18em;
    font-weight: 800;
    color: #6e6e6a;
    margin: 1.1rem 0.95rem 0.4rem;
    text-transform: uppercase;
}

.side-nav { padding: 0 12px; flex-grow: 1; }

.nav-x {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.62rem 0.85rem;
    border-radius: 10px;
    position: relative;
    color: #aeaea9;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
}

.nav-x i { font-size: 1.05rem; width: 22px; text-align: center; }
.nav-x:hover { color: #fff; background: rgba(255, 255, 255, 0.05); text-decoration: none; }
.nav-x.active { color: #fff; background: linear-gradient(90deg, rgba(168, 30, 34, 0.3), rgba(168, 30, 34, 0.05)); }
.nav-x.active::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 18%;
    height: 64%;
    width: 3px;
    border-radius: 3px;
    background: var(--rosso);
}

.pill-count { background: var(--rosso); color: #fff; font-size: 0.68rem; font-weight: 800; border-radius: 999px; padding: 0.15rem 0.5rem; margin-left: auto; }

.userchip { background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px; padding: 0.6rem 0.7rem; }

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--rosso);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 0.78rem;
    flex-shrink: 0;
}

@media (min-width: 992px) {
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: 282px;
        z-index: 1040;
        background-color: var(--fumo) !important;
        border-right: 1px solid #232323;
        transform: none !important;
        visibility: visible !important;
    }

    .app { margin-left: 282px; }
}

/* ---------------------------------------------------------------------------
   4. TOPBAR
   --------------------------------------------------------------------------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: rgba(243, 243, 240, 0.85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--linea);
}

.topbar-inner {
    max-width: 1460px;
    margin-inline: auto;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
}

.crumb-tit { font-weight: 800; font-size: 0.95rem; line-height: 1.15; color: var(--nero); }
.crumb-sub { font-size: 0.7rem; color: var(--grigio); }

.avatar-btn { display: flex; align-items: center; gap: 0.6rem; background: transparent; border: 0; padding: 0.15rem 0.3rem; border-radius: 12px; }
.avatar-btn .avatar { border: 2px solid var(--nero); }
.uname { display: block; font-size: 0.82rem; font-weight: 800; line-height: 1.15; text-align: left; color: var(--nero); }
.urole { display: block; font-size: 0.66rem; color: var(--grigio); text-align: left; }

/* ---------------------------------------------------------------------------
   5. HERO, KPI E STATI
   --------------------------------------------------------------------------- */
.hero {
    background:
        radial-gradient(120% 160% at 88% 115%, rgba(192, 138, 62, 0.16), transparent 55%),
        radial-gradient(90% 150% at 8% 135%, rgba(168, 30, 34, 0.4), transparent 62%),
        #171717;
    color: #f1f1ed;
    border: 1px solid #262626;
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.hero h1 { font-family: 'Cinzel', serif; font-weight: 700; letter-spacing: 0.02em; font-size: 1.7rem; color: #f4f4f0; }
.hero p.lead-sm { color: rgba(244, 244, 240, 0.72); font-size: 0.95rem; margin: 0; }
.hero-eyebrow { font-size: 0.7rem; letter-spacing: 0.22em; font-weight: 800; color: #c9a05c; text-transform: uppercase; }

.chipx {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.76rem;
    font-weight: 700;
    color: rgba(244, 244, 240, 0.8);
}

.dotr, .dotb, .dotg { width: 7px; height: 7px; border-radius: 50%; }
.dotr { background: var(--rosso); }
.dotb { background: var(--bronzo); }
.dotg { background: #9a9a94; }

/* Emblema: public/assets/logo.svg, file fornito dal proprietario (non modificare) */
.emblema { display: block; }
.emblema-hero { width: 150px; height: 150px; margin-inline: auto; }
.emblema-brand { width: 44px; height: 44px; flex-shrink: 0; }
.emblema-auth { width: 96px; height: 96px; margin: 0 auto 0.75rem; }

.emblema-cap { font-size: 0.72rem; color: rgba(244, 244, 240, 0.5); text-align: center; margin-top: 0.8rem; letter-spacing: 0.05em; }

/* Logo della card Branding (F6.1 — D-043): anteprima che non deforma l'immagine */
.logo-preview { margin: 0.25rem 0 0.6rem; }
.logo-preview img { width: 96px; height: 96px; object-fit: contain; display: block; background: #ffffff; border: 1px solid rgba(27, 27, 27, 0.12); border-radius: 0.4rem; padding: 0.35rem; }

.kpi { position: relative; overflow: hidden; transition: 0.2s; }
.kpi:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -18px rgba(27, 27, 27, 0.35); }
.kpi::before { content: ""; position: absolute; top: 0; left: 18px; right: 18px; height: 7px; background: var(--meandro-rosso) repeat-x left center; opacity: 0; transition: 0.25s; }
.kpi:hover::before { opacity: 0.6; }

.icon-box { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem; flex-shrink: 0; }
.tint-red { background: rgba(168, 30, 34, 0.1); color: var(--rosso); }
.tint-bronze { background: rgba(192, 138, 62, 0.14); color: var(--bronzo-scuro); }
.tint-dark { background: var(--nero); color: #e8e8e4; }
.tint-gray { background: #efefea; color: #6e6e6a; }

.kpi-label { font-size: 0.76rem; font-weight: 700; color: var(--grigio); }
.kpi-value { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em; color: var(--nero); line-height: 1.15; }
.kpi-note { font-size: 0.72rem; color: #9a9a94; }

/* Pastiglie di stato (badge del preventivo) */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    border: 1px solid #e0e0da;
    background: #f1f1ec;
    color: #6f6f6a;
    vertical-align: middle;
}

.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.badge-bozza { color: #6f6f6a; background: #f1f1ec; border-color: #e0e0da; }
.badge-inviato { color: #8a6100; background: rgba(214, 164, 33, 0.16); border-color: rgba(214, 164, 33, 0.4); }
.badge-accettato { color: #2f6b3a; background: rgba(58, 138, 78, 0.12); border-color: rgba(58, 138, 78, 0.32); }
.badge-rifiutato { color: var(--rosso); background: rgba(168, 30, 34, 0.08); border-color: rgba(168, 30, 34, 0.22); }
.badge-annullato { color: #6f6f6a; background: #f1f1ec; border-color: #e0e0da; }
.badge-scaduto { color: var(--rosso); background: rgba(168, 30, 34, 0.08); border-color: rgba(168, 30, 34, 0.22); }

/* ---------------------------------------------------------------------------
   6. TABELLE, TOTALI, DEFINIZIONI
   --------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }

table.data { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.data th,
table.data td { padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--linea); text-align: left; vertical-align: middle; }
table.data thead th { font-size: 0.85rem; color: var(--grigio); font-weight: 600; }

/* Variante "da elenco" (data table del template) */
table.data.table-x thead th {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--grigio);
    font-weight: 800;
    background: #fbfbf8;
    white-space: nowrap;
}

table.data.table-x td { border-color: #f0f0eb; padding: 0.8rem 0.75rem; }
table.data.table-x tbody tr:hover { background: #fbfbf8; }
table.data.table-x .codice { font-weight: 800; font-size: 0.82rem; letter-spacing: 0.02em; color: var(--nero); white-space: nowrap; }

.num { text-align: right; white-space: nowrap; }
.col-num { width: 2.5rem; }
.col-azioni { width: 1%; white-space: nowrap; }
.col-qta { width: 6rem; }
.col-prezzo { width: 8rem; }
.col-sconto { width: 6rem; }
.col-iva { width: 5rem; }

table.data.righe td input,
table.data.righe td select {
    width: 100%;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--linea);
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
}

table.data.righe td.num input { text-align: right; }

.tiny { font-size: 0.7rem; color: #9a9a94; }

dl.dettagli { display: grid; grid-template-columns: 10rem 1fr; margin: 0; }
dl.dettagli dt { color: var(--grigio); font-size: 0.9rem; padding: 0.2rem 0; }
dl.dettagli dd { margin: 0; padding: 0.2rem 0; }

table.totali { margin-left: auto; margin-top: 1rem; border-collapse: collapse; }
table.totali th { text-align: right; color: var(--grigio); font-weight: 500; padding: 0.25rem 1rem 0.25rem 0; }
table.totali td { text-align: right; padding: 0.25rem 0; }
table.totali .riga-totale th,
table.totali .riga-totale td { font-weight: 700; color: var(--nero); border-top: 1px solid var(--linea); }

.stato-riga { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

.nota-fiscale { margin: 0.75rem 0 0; font-size: 0.92rem; font-style: italic; color: var(--grigio); }

/* ---------------------------------------------------------------------------
   7. FORM
   --------------------------------------------------------------------------- */
fieldset { border: 1px solid var(--linea); border-radius: 10px; margin: 0 0 1.25rem; padding: 0.5rem 1rem 1rem; }
fieldset legend { font-family: 'Cinzel', serif; font-size: 0.84rem; letter-spacing: 0.06em; color: var(--bronzo-scuro); padding: 0 0.5rem; width: auto; float: none; }

.field { margin-bottom: 1rem; }
.field label { display: block; margin-bottom: 0.3rem; font-size: 0.86rem; font-weight: 600; color: #55554f; }
.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--linea);
    border-radius: 9px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    color: var(--testo);
}

.field input:focus,
.field select:focus,
.field textarea:focus { outline: 0; border-color: #cfcfc9; box-shadow: 0 0 0 3px rgba(168, 30, 34, 0.08); }

.field-row { display: flex; gap: 1rem; }
.field-row .field { flex: 1; }
.field-narrow { flex: 0 0 8rem; }
.field-sm { flex: 0 0 8rem; }

/* Interruttore (toggle) del contributo (D-030, D-032): componente switch di Bootstrap
   (già in public/assets/vendor/) ritinto con la palette Timema. Il componente regge
   qualunque contenitore; la versione scritta a mano collassava dentro un `.field`,
   perché la regola `.field label { display: block }` batteva `.switch`. */
.form-switch { display: flex; align-items: center; gap: 0.65rem; padding-left: 0; }
.form-switch .form-check-input {
    float: none;
    width: 52px;
    height: 28px;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    border: 1px solid var(--grigio-chiaro);
    background-color: #d9d9d4;
    cursor: pointer;
}
.form-switch .form-check-input:checked { background-color: var(--rosso); border-color: var(--rosso-scuro); }
.form-switch .form-check-input:focus { border-color: var(--grigio-chiaro); box-shadow: 0 0 0 3px rgba(168, 30, 34, 0.18); }
.form-switch .form-check-label { font-size: 0.92rem; font-weight: 700; color: var(--testo); cursor: pointer; }

/* Blocco unico «interruttore + percentuale» accanto (D-030) */
.switch-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--linea);
    border-radius: var(--raggio);
    background: #fff;
}
.switch-row .field { flex: 0 1 13rem; margin: 0; }
.switch-row .field label { white-space: nowrap; }

/* Anteprima del messaggio di invio (F4.2, D-034) */
.anteprima { margin-bottom: 1rem; }
.anteprima summary { cursor: pointer; font-weight: 700; font-size: 0.9rem; color: var(--rosso); }
.anteprima summary:hover { color: var(--rosso-scuro); }
.anteprima[open] summary { margin-bottom: 0.75rem; }
.anteprima-testo {
    margin: 0 0 0.75rem;
    padding: 0.75rem 1rem;
    background: #fbfbf8;
    border: 1px solid var(--linea);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre-wrap;
    color: var(--testo);
}

/* Archivio: filtri dell'elenco e piede con paginazione (F5.1 — D-038, D-041) */
.filtri .field-row { margin-bottom: 0; }
.filtri .etichetta-filtro { display: block; margin-bottom: 0.3rem; font-size: 0.86rem; font-weight: 600; color: #55554f; }
.filtri-stati { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.25rem; }
.filtri .form-check { margin: 0; }
.filtri .form-check-label { font-size: 0.86rem; }
.filtri .form-actions { margin-top: 1rem; }
.elenco-piede { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.25rem; }
.righe-pagina .field { margin-bottom: 0; }
.righe-pagina .field select { width: auto; }
.pager .pagination { margin: 0; }

.form-actions { display: flex; gap: 0.5rem; align-items: center; margin-top: 1.25rem; }
.form-inline { display: flex; gap: 1rem; align-items: flex-end; }
.form-inline .field { margin-bottom: 0; }
.inline-form { display: inline; }

.help { color: var(--grigio); font-size: 0.9rem; }
.muted { color: var(--grigio); }

.lista-errori { margin: 0; padding-left: 1.1rem; }

.alert { padding: 0.75rem 1rem; border-radius: 10px; margin-bottom: 1rem; border: 1px solid transparent; }
.alert-error { background: #fdeaea; color: var(--rosso-scuro); border-color: #f3cfd0; }
.alert-info { background: rgba(192, 138, 62, 0.1); color: #7a5c26; border-color: rgba(192, 138, 62, 0.3); }
.revisioni-scelta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0; }
.alert-success { background: #eaf3ea; color: #2f6b3a; border-color: #cfe4d2; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0; }
.azioni { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

/* Regime forfettario: la colonna IVA non compare (D-020). */
.senza-iva .col-iva { display: none; }

/* ---------------------------------------------------------------------------
   8. CONTENUTO, FOOTER, PAGINE SENZA MENU (login, installer)
   --------------------------------------------------------------------------- */
.content { max-width: 1460px; margin-inline: auto; width: 100%; padding: 1.75rem 1.5rem 2rem; }

.footer { max-width: 1460px; margin: 0 auto; width: 100%; padding: 2rem 1.5rem 1.8rem; font-size: 0.78rem; color: var(--grigio); }
.footer strong { color: var(--nero); }

.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2.5rem 1rem;
    background:
        radial-gradient(120% 120% at 85% 115%, rgba(192, 138, 62, 0.14), transparent 55%),
        radial-gradient(90% 120% at 10% 120%, rgba(168, 30, 34, 0.35), transparent 60%),
        #171717;
}

.auth-box { width: 100%; max-width: 720px; }
.auth-brand { text-align: center; margin-bottom: 1.5rem; }
.auth-brand .brand-name { font-size: 1.6rem; }
.auth-brand .meander { max-width: 220px; margin: 0.75rem auto 0; }
.auth-foot { text-align: center; color: rgba(244, 244, 240, 0.5); font-size: 0.72rem; margin-top: 1rem; letter-spacing: 0.05em; }

/* ---------------------------------------------------------------------------
   9. ANIMAZIONI
   --------------------------------------------------------------------------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.rise { animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.d1 { animation-delay: 0.05s; } .d2 { animation-delay: 0.1s; } .d3 { animation-delay: 0.15s; }
.d4 { animation-delay: 0.2s; } .d5 { animation-delay: 0.25s; } .d6 { animation-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
    .rise { animation: none; }
    .kpi { transition: none; }
}

@media (max-width: 640px) {
    .page-head { flex-direction: column; align-items: flex-start; }
    .field-row { flex-wrap: wrap; }
    .field-narrow, .field-sm { flex: 1 1 8rem; }
    dl.dettagli { grid-template-columns: 1fr; }
    dl.dettagli dt { padding-bottom: 0; }
}
