/* =====================================================
   COOKIE BANNER CUSTOM per portale exam.quizvds.it
   ===================================================== */

#egw-cookie-banner, #egw-cookie-prefs {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #1a1a1a;
    box-sizing: border-box;
}
#egw-cookie-banner *, #egw-cookie-prefs * { box-sizing: border-box; }

/* Banner principale (bottom) */
#egw-cookie-banner {
    left: 20px; right: 20px; bottom: 20px;
    max-width: 720px; margin: 0 auto;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,.15);
    padding: 22px 24px;
    display: none;
}
#egw-cookie-banner.show { display: block; }
#egw-cookie-banner h3 { margin: 0 0 8px; font-size: 17px; font-weight: 600; }
#egw-cookie-banner p { margin: 0 0 16px; color: #444; }
#egw-cookie-banner a { color: #0066cc; text-decoration: underline; }
#egw-cookie-banner .egw-btns {
    display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end;
}
#egw-cookie-banner button {
    border: 0; padding: 10px 18px; border-radius: 6px;
    font-size: 14px; font-weight: 500; cursor: pointer;
    transition: opacity .15s;
}
#egw-cookie-banner button:hover { opacity: .85; }
.egw-btn-primary { background: #0066cc; color: #fff; }
.egw-btn-secondary { background: #f0f0f0; color: #1a1a1a; }
.egw-btn-link { background: transparent; color: #0066cc; text-decoration: underline; }

/* Modale preferenze (full-screen) */
#egw-cookie-prefs {
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,.55);
    display: none; align-items: center; justify-content: center;
    padding: 20px;
}
#egw-cookie-prefs.show { display: flex; }
#egw-cookie-prefs .egw-modal {
    background: #fff; border-radius: 10px;
    max-width: 560px; width: 100%; max-height: 85vh; overflow-y: auto;
    padding: 28px;
}
#egw-cookie-prefs h3 { margin: 0 0 8px; font-size: 19px; }
#egw-cookie-prefs p { color: #444; margin: 0 0 18px; }
#egw-cookie-prefs .egw-cat {
    border: 1px solid #e0e0e0; border-radius: 8px;
    padding: 14px 16px; margin-bottom: 12px;
}
#egw-cookie-prefs .egw-cat-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 6px;
}
#egw-cookie-prefs .egw-cat strong { font-size: 15px; }
#egw-cookie-prefs .egw-cat small { color: #666; font-size: 13px; }

/* Toggle switch */
.egw-toggle { position: relative; display: inline-block; width: 42px; height: 22px; }
.egw-toggle input { opacity: 0; width: 0; height: 0; }
.egw-toggle-slider {
    position: absolute; cursor: pointer; inset: 0;
    background: #ccc; border-radius: 22px; transition: .2s;
}
.egw-toggle-slider:before {
    content: ''; position: absolute; height: 16px; width: 16px;
    left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s;
}
.egw-toggle input:checked + .egw-toggle-slider { background: #0066cc; }
.egw-toggle input:checked + .egw-toggle-slider:before { transform: translateX(20px); }
.egw-toggle input:disabled + .egw-toggle-slider { background: #4caf50; cursor: not-allowed; }

#egw-cookie-prefs .egw-prefs-btns {
    display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px;
    flex-wrap: wrap;
}
#egw-cookie-prefs button {
    border: 0; padding: 10px 18px; border-radius: 6px;
    font-size: 14px; font-weight: 500; cursor: pointer;
}

/* Mobile */
@media (max-width: 600px) {
    #egw-cookie-banner { left: 10px; right: 10px; bottom: 10px; padding: 18px; }
    #egw-cookie-banner .egw-btns { justify-content: stretch; }
    #egw-cookie-banner .egw-btns button { flex: 1; }
}
