/* Briefed cookie consent banner — Consent Mode v2.
   Pinned to bottom-right on desktop, full-width sheet on mobile. Uses the
   navy palette already in the rest of the app. */

/* Full-screen scrim — blocks clicks on the page behind so the user must
   actually choose. Body also gets `cookie-consent-open` class to lock scroll. */
.cookie-consent {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, .55);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    animation: cookieConsentFadeIn .18s ease-out;
}

.cookie-consent[hidden] { display: none; }

body.cookie-consent-open {
    overflow: hidden;
}

/* Docked variant — used on policy pages (/politica-cookies, /privacy, etc.)
   so the page text remains readable while the banner still requires a choice. */
.cookie-consent.cookie-consent-docked {
    inset: auto 0 0 0;
    align-items: stretch;
    justify-content: center;
    padding: 0;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    pointer-events: none;
    animation: none;
}

.cookie-consent.cookie-consent-docked .cookie-consent-card {
    pointer-events: auto;
    margin: 0 auto 16px;
    max-width: 720px;
    width: calc(100% - 24px);
    border: 1px solid #e5e7eb;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, .12), 0 -2px 8px rgba(15, 23, 42, .06);
    animation: cookieConsentSlideUp .22s ease-out;
}

body.cookie-consent-docked-open {
    /* No scroll lock in docked mode — leave room at the bottom so the banner
       doesn't cover the footer. */
    padding-bottom: 180px;
}

.cookie-consent-card {
    width: 100%;
    max-width: 560px;
    background: #fff;
    color: #1f2937;
    border-radius: 14px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, .45), 0 8px 24px rgba(15, 23, 42, .15);
    padding: 24px 26px;
    font-size: 14px;
    line-height: 1.5;
    animation: cookieConsentSlideUp .22s ease-out;
}

@keyframes cookieConsentFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes cookieConsentSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.cookie-consent-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 6px;
    color: #1E3A8A;
}

.cookie-consent-desc {
    margin: 0 0 14px;
    color: #374151;
}

.cookie-consent-desc a {
    color: #1E3A8A;
    text-decoration: underline;
}

.cookie-consent-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.cookie-consent-actions-prefs {
    margin-top: 14px;
}

.cookie-btn {
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s;
    line-height: 1.2;
}

.cookie-btn-primary {
    background: #1E3A8A;
    color: #fff;
}
.cookie-btn-primary:hover { background: #1d3370; }

.cookie-btn-secondary {
    background: #fff;
    color: #1E3A8A;
    border-color: #1E3A8A;
}
.cookie-btn-secondary:hover { background: #eef2ff; }

.cookie-btn-link {
    background: transparent;
    color: #475569;
    padding: 9px 8px;
}
.cookie-btn-link:hover { color: #1E3A8A; text-decoration: underline; }

.cookie-consent-prefs-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 6px;
    color: #1E3A8A;
}

.cookie-consent-prefs-desc {
    margin: 0 0 12px;
    color: #4b5563;
    font-size: 13px;
}

.cookie-consent-prefs-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid #e5e7eb;
}

.cookie-pref {
    border-bottom: 1px solid #e5e7eb;
}

.cookie-pref-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    margin: 0;
    cursor: pointer;
}

.cookie-pref-info {
    display: block;
    flex: 1;
}

.cookie-pref-info strong {
    display: block;
    font-size: 14px;
    color: #111827;
    margin-bottom: 2px;
}

.cookie-pref-info-desc {
    display: block;
    font-size: 12.5px;
    color: #6b7280;
}

.cookie-pref-toggle {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    accent-color: #1E3A8A;
    cursor: pointer;
}

.cookie-pref-toggle:disabled {
    opacity: .55;
    cursor: not-allowed;
}

@media (max-width: 575.98px) {
    .cookie-consent {
        padding: 12px;
    }
    .cookie-consent-card {
        padding: 18px 16px;
    }
    .cookie-consent-actions {
        justify-content: stretch;
    }
    .cookie-consent-actions .cookie-btn {
        flex: 1 1 auto;
    }
    .cookie-consent-actions .cookie-btn-link {
        flex: 0 0 100%;
        order: 3;
    }
}
