/* =========================================
   STILI BASE (DESKTOP FIRST)
   ========================================= */

/* Reset di base per i font all'interno del banner */
.span * {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    margin: 0;
    box-sizing: border-box;
}

/* Contenitore principale a schermo intero (overlay scuro) */
.span {
    position: fixed;
    z-index: 10000;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: flex-end; /* Posiziona il banner in basso */
    background: rgba(0, 0, 0, 0.5); /* Sfondo semitrasparente scuro */
    padding: 20px; /* Spazio attorno al banner su desktop */
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Il box bianco del banner vero e proprio */
#consentBox {
    background: #fff;
    padding: 30px;
    /* RADIUS CORRETTO: Arrotondato su tutti i lati */
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: left;
    max-width: 600px;
    width: 100%;
    transform: translateY(0);
    transition: transform 0.3s ease;
    animation: slideUp 0.4s ease-out forwards; /* Animazione di entrata dal basso */
}

/* Animazione di entrata */
@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Classi per nascondere il banner con dissolvenza (usate da JS) */
.span.hide {
    opacity: 0;
    pointer-events: none; /* Evita click quando nascosto */
}

/* Header del banner (Titolo e Logo) */
#consentHeader {
    font-size: 22px;
    font-weight: 700;
    /* COLORE CORRETTO: Oro/Giallo del brand */
    color: #ffc107; 
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Logo nel banner */
#consentBox img {
    max-width: 50px;
    height: auto;
}

/* Testo del paragrafo */
#consentContent p {
    color: #555;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 25px;
}

/* Link alla policy nel testo */
.policy-link {
    color: #0a1f44 !important; /* Blu scuro brand */
    text-decoration: underline;
    font-weight: 600;
}

/* =========================================
   STILI PER I TOGGLE SWITCH (INTERRUTTORI)
   ========================================= */

/* Contenitore grigio per gli interruttori */
.cookie-toggles {
    margin-bottom: 25px;
    text-align: left;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

/* Singola riga (Testo + Interruttore) */
.toggle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.toggle-item:last-child {
    margin-bottom: 0;
}

/* Testo descrittivo accanto all'interruttore */
.toggle-text {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

/* --- LO SWITCH (L'INTERRUTTORE FISICO) --- */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

/* NASCONDI CHECKBOX NATIVO (ROBUSTO PER MOBILE) */
.switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
    -webkit-appearance: none; /* Fondamentale per iPhone/Safari */
    -moz-appearance: none;
    appearance: none;
    z-index: -1;
    pointer-events: none;
}

/* La "pista" dello switch */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc; /* Grigio (disattivato) */
  -webkit-transition: .4s;
  transition: .4s;
}

/* Il "pomello" dello switch */
.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Quando attivo (Verde moderno) */
input:checked + .slider {
  background-color: #10b981;
}

/* Spostamento pomello quando attivo */
input:checked + .slider:before {
  -webkit-transform: translateX(24px);
  -ms-transform: translateX(24px);
  transform: translateX(24px);
}

/* Arrotondamento switch */
.slider.round {
  border-radius: 34px;
}
.slider.round:before {
  border-radius: 50%;
}

/* Stile per interruttori disabilitati (es. Necessari) */
.switch.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.switch.disabled .slider {
     cursor: not-allowed;
}

/* =========================================
   BOTTONE DI SALVATAGGIO UNICO
   ========================================= */
.buttons {
    margin-top: 20px;
}

.save-btn {
    width: 100%;
    padding: 15px;
    background: #0a1f44; /* Blu scuro brand */
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s ease;
}

.save-btn:hover {
    background: #ffc107; /* Giallo brand al hover */
    color: #0a1f44;
}

/* =========================================
   ADATTAMENTO RESPONSIVE (MOBILE)
   ========================================= */
@media (max-width: 600px) {
    /* Riduciamo il padding esterno */
    .span {
        padding: 10px; 
    }
    
    /* Il box rimane arrotondato perché è "fluttuante" (c'è padding attorno) */
    #consentBox {
        padding: 20px;
        border-radius: 12px; /* Mantiene il radius completo */
    }

    /* Header leggermente più piccolo, ma MANTIENE IL COLORE ORO ereditato */
    #consentHeader {
        font-size: 20px;
    }

    /* Logo più piccolo */
    #consentBox img {
        max-width: 40px;
    }

    /* Testo toggle adattato */
    .toggle-text {
        font-size: 13px;
        padding-right: 10px;
    }
}