/**
 * Stili Grafici Centralizzati Cookie Banner — ITAL-CER S.r.l.
 */

/* --- BANNER PRINCIPALE IN BASSO --- */
#cookie-banner {
    position: fixed;
    bottom: 24px;
    right: 24px;
    max-width: 420px;
    background: #0B2545; /* Richiama il colore primario del sito */
    color: #FFFFFF;
    padding: 24px;
    border-radius: 8px;
    z-index: 9999;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.95rem;
    border: 1px solid rgba(255,255,255,0.1);
    display: none;
    animation: cookieFadeIn 0.4s ease-out;
}

#cookie-banner p {
    margin-bottom: 16px;
    line-height: 1.5;
    color: #E2E8F0;
}

#cookie-banner p a {
    color: #FF6B00; /* Richiama l'arancione secondario */
    text-decoration: underline;
}

/* --- PULSANTI BANNER --- */
.cookie-btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cookie-row-btns {
    display: flex;
    gap: 10px;
}

#cookie-banner button, 
#cookie-settings-modal button {
    padding: 10px 16px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    border-radius: 4px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.9rem;
    transition: background 0.2s ease;
}

.btn-accetta {
    background: #2ecc71;
    color: #FFFFFF;
    flex: 1;
}

.btn-accetta:hover {
    background: #27ae60;
}

.btn-rifiuta {
    background: #e74c3c;
    color: #FFFFFF;
    flex: 1;
}

.btn-rifiuta:hover {
    background: #c0392b;
}

.btn-personalizza {
    background: rgba(255,255,255,0.1);
    color: #FFFFFF;
    width: 100%;
    border: 1px solid rgba(255,255,255,0.2) !important;
}

.btn-personalizza:hover {
    background: rgba(255,255,255,0.2);
}

/* --- SFONDO SCURO DI BLOCCO (BACKDROP) --- */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11,37,69,0.6);
    backdrop-filter: blur(4px);
    z-index: 9998;
}

/* --- SCHERMATA DI PERSONALIZZAZIONE (MODALE) --- */
#cookie-settings-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #FFFFFF;
    color: #1E293B;
    padding: 30px;
    z-index: 10000;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    font-family: 'Source Sans 3', sans-serif;
    animation: cookieFadeIn 0.3s ease-out;
}

#cookie-settings-modal h3 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.6rem;
    color: #0B2545;
    margin-bottom: 10px;
    text-transform: uppercase;
}

#cookie-settings-modal p {
    font-size: 0.9rem;
    color: #64748B;
    margin-bottom: 20px;
}

#cookie-settings-modal hr {
    border: 0;
    border-top: 1px solid #E2E8F0;
    margin: 20px 0;
}

.setting-item {
    margin: 16px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
}

.setting-item span strong {
    display: block;
    color: #1E293B;
}

.setting-item span em {
    display: block;
    font-size: 0.8rem;
    color: #64748B;
    font-style: normal;
}

/* --- INTERRUTTORI APRI/CHIUDI (TOGGLE SWITCH) --- */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #CBD5E1;
    transition: .3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #2ecc71;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

input:disabled + .slider {
    background-color: #94A3B8;
    opacity: 0.6;
    cursor: not-allowed;
}

/* --- ANIMAZIONI E RESPONSIVE --- */
@keyframes cookieFadeIn {
    from { opacity: 0; transform: translate(0, 20px); }
    to { opacity: 1; transform: translate(0, 0); }
}

@media (max-width: 768px) {
    #cookie-banner {
        left: 16px;
        right: 16px;
        bottom: 16px;
        max-width: none;
    }
}