/* --- BANNER CONSENSO COOKIE --- */
/* Palette e tipografia allineate al sito pubblico (home.css) */

.lf-cookie {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    padding: 0 16px 16px;
    display: flex;
    justify-content: center;
    pointer-events: none;

    /* Entrata discreta: scivola dal basso */
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .32s cubic-bezier(0.4, 0, 0.2, 1),
                transform .32s cubic-bezier(0.4, 0, 0.2, 1);
}

.lf-cookie--visibile {
    opacity: 1;
    transform: translateY(0);
}

.lf-cookie-box {
    pointer-events: auto;
    width: 100%;
    max-width: 760px;
    background: #0A1628;
    color: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(184, 134, 11, 0.35);
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    padding: 22px 24px 18px;
    font-family: 'Roboto', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

/* Filo dorato in cima, come richiamo all'accento del sito */
.lf-cookie-box {
    background-image: linear-gradient(#B8860B, #B8860B);
    background-size: 100% 3px;
    background-repeat: no-repeat;
    background-position: top left;
}

/* Il banner non deve ereditare le regole della pagina (home.css centra tutti
   gli h2 del sito, per esempio): qui si riparte da uno stato noto. */
.lf-cookie-box,
.lf-cookie-box * {
    text-align: left;
    box-sizing: border-box;
}

.lf-cookie-testa {
    margin-bottom: 16px;
}

.lf-cookie h2 {
    font-family: 'Roboto Condensed', 'Roboto', system-ui, Arial, sans-serif;
    font-size: 17px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: #fff;
    margin: 0 0 8px;
    padding-left: 12px;
    border-left: 3px solid #B8860B;
    line-height: 1.25;
}

.lf-cookie p {
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
}

.lf-cookie strong {
    color: #fff;
    font-weight: 500;
}

/* --- DETTAGLI PER FINALITÀ --- */

.lf-cookie-dettagli {
    border-top: 1px solid rgba(255, 255, 255, 0.09);
    margin-bottom: 16px;
}

.lf-cookie-voce {
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.lf-cookie-voce:last-child {
    border-bottom: none;
}

.lf-cookie-voce-testa {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 5px;
}

.lf-cookie-voce-titolo {
    font-weight: 500;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.lf-cookie-voce--fissa .lf-cookie-voce-titolo {
    cursor: default;
}

.lf-cookie-sempre {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #B8860B;
    white-space: nowrap;
}

.lf-cookie-voce p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.62);
}

/* --- INTERRUTTORE --- */

.lf-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}

.lf-switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.lf-switch-cursore {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.16);
    border-radius: 24px;
    transition: background .2s ease;
    pointer-events: none;
}

.lf-switch-cursore::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s cubic-bezier(0.4, 0, 0.2, 1);
}

.lf-switch input:checked + .lf-switch-cursore {
    background: #B8860B;
}

.lf-switch input:checked + .lf-switch-cursore::before {
    transform: translateX(18px);
}

.lf-switch input:focus-visible + .lf-switch-cursore {
    outline: 2px solid #B8860B;
    outline-offset: 2px;
}

/* --- PULSANTI --- */

.lf-cookie-azioni {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.lf-btn {
    font-family: inherit;
    text-align: center;   /* il reset di cui sopra allinea a sinistra: qui no */
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .4px;
    padding: 11px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all .2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

/* Rifiuta e Accetta hanno lo STESSO peso visivo: il rifiuto deve essere
   facile quanto l'accettazione (linee guida EDPB 05/2020). */
.lf-btn-scelta {
    /* base 0: i due pulsanti risultano identici al pixel, non dimensionati
       sulla lunghezza del testo. Nessun dubbio su quale sia favorito. */
    flex: 1 1 0;
    min-width: 150px;
    background: #B8860B;
    color: #0A1628;
    border-color: #B8860B;
}

.lf-btn-scelta:hover {
    background: #d1a01d;
    border-color: #d1a01d;
}

.lf-btn-secondario {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.22);
}

.lf-btn-secondario:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.45);
}

.lf-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.lf-cookie-note {
    margin-top: 14px !important;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5) !important;
}

.lf-cookie-note a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.lf-cookie-note a:hover {
    color: #B8860B;
}

/* --- SCHERMI PICCOLI --- */

@media (max-width: 560px) {
    .lf-cookie {
        padding: 0 10px 10px;
    }

    .lf-cookie-box {
        padding: 18px 16px 14px;
        border-radius: 12px;
    }

    .lf-cookie-azioni {
        flex-direction: column;
    }

    /* Anche impilati restano equivalenti: stessa larghezza, stesso stile */
    .lf-btn-scelta,
    .lf-btn-secondario {
        width: 100%;
        min-width: 0;
    }
}

/* --- ASPETTO SENZA I CARATTERI ESTERNI --- */
/* Finché non c'è consenso i font Google non vengono richiesti. Il testo usa i
   caratteri di sistema (dichiarati come alternativa in home.css), ma l'icona
   Material mostrerebbe la parola "search": la sostituiamo con un simbolo. */

html:not(.lf-font-esterni) .material-symbols-outlined {
    font-size: 0 !important;
    line-height: 1;
}

html:not(.lf-font-esterni) .material-symbols-outlined::before {
    content: '\1F50D';
    font-size: 1.35rem;
    line-height: 1;
}

/* Chi preferisce meno animazioni non le subisce */
@media (prefers-reduced-motion: reduce) {
    .lf-cookie {
        transition: opacity .01ms;
        transform: none;
    }
}
