/* ============================================= */
/* COOKIE BANNER & PREFERENZE – Progetto Forense */
/* ============================================= */

.cookie-banner,
.cookie-modal,
.cookie-modal * {
    box-sizing: border-box;
}

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: linear-gradient(180deg, rgba(45, 45, 58, 0.98) 0%, rgba(30, 30, 40, 0.99) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(102, 126, 234, 0.5);
    padding: 24px 40px;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
    font-family: "Montserrat", sans-serif;
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    transition: transform 0.45s ease, opacity 0.35s ease, visibility 0.35s ease;
}

.cookie-banner.cookie-banner--hidden {
    transform: translateY(110%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.cookie-banner:not(.cookie-banner--hidden) {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

html.has-cookie-consent .cookie-banner {
    transform: translateY(110%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.cookie-banner__content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.cookie-banner__text {
    flex: 1;
    min-width: 0;
}

.cookie-banner__text p {
    margin: 0;
    font-family: "Montserrat", sans-serif;
    font-size: 0.88rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.75;
}

.cookie-banner__text a {
    color: #a5b4fc;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: opacity 0.25s ease;
}

.cookie-banner__text a:hover {
    opacity: 0.8;
}

.cookie-banner__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

.cookie-banner button.cookie-banner__btn,
.cookie-modal button.cookie-banner__btn {
    -webkit-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: "Montserrat", sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: 1.2;
    padding: 12px 22px;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: none;
    outline: none;
}

.cookie-banner button.cookie-banner__btn:focus-visible,
.cookie-modal button.cookie-banner__btn:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.cookie-banner button.cookie-banner__btn--accept,
.cookie-modal button.cookie-banner__btn--accept {
    background: #667eea;
    color: #ffffff;
    border: 1px solid #667eea;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.35);
}

.cookie-banner button.cookie-banner__btn--accept:hover,
.cookie-modal button.cookie-banner__btn--accept:hover {
    background: #5a6fd6;
    border-color: #5a6fd6;
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.45);
}

.cookie-banner button.cookie-banner__btn--reject,
.cookie-modal button.cookie-banner__btn--reject {
    background: transparent;
    color: #a5b4fc;
    border: 1px solid rgba(102, 126, 234, 0.6);
}

.cookie-banner button.cookie-banner__btn--reject:hover,
.cookie-modal button.cookie-banner__btn--reject:hover {
    background: rgba(102, 126, 234, 0.12);
    transform: translateY(-1px);
}

.cookie-banner button.cookie-banner__btn--prefs {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.cookie-banner button.cookie-banner__btn--prefs:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: #667eea;
    transform: translateY(-1px);
}

.cookie-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    font-family: "Montserrat", sans-serif;
}

.cookie-modal--hidden {
    display: none !important;
}

.cookie-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(30, 30, 40, 0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.cookie-modal__panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    background: #2d2d3a;
    border: 1px solid rgba(102, 126, 234, 0.4);
    border-radius: 16px;
    padding: 36px 32px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.cookie-modal__title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
    margin: 0 0 14px;
}

.cookie-modal__intro,
.cookie-modal__note {
    font-size: 0.85rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.75;
    margin: 0 0 22px;
}

.cookie-modal__note a {
    color: #a5b4fc;
    text-decoration: underline;
}

.cookie-modal__category {
    border: 1px solid rgba(102, 126, 234, 0.25);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 14px;
    background: rgba(255, 255, 255, 0.02);
}

.cookie-modal__category-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.cookie-modal__category h3 {
    font-size: 0.92rem;
    font-weight: 600;
    color: #a5b4fc;
    margin: 0 0 8px;
}

.cookie-modal__category p {
    font-size: 0.8rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.65;
    margin: 0;
}

.cookie-modal__always {
    font-size: 0.7rem;
    font-weight: 600;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    padding-top: 4px;
}

.cookie-modal__toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}

.cookie-modal__toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.cookie-modal__slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 28px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.cookie-modal__slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 3px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.cookie-modal__toggle input:checked + .cookie-modal__slider {
    background: #667eea;
    border-color: #667eea;
}

.cookie-modal__toggle input:checked + .cookie-modal__slider::before {
    transform: translateX(22px);
}

.cookie-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 12px;
}

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

button.footer__cookie-link {
    -webkit-appearance: none;
    appearance: none;
    display: block;
    width: 100%;
    max-width: 280px;
    margin: 12px auto 0;
    padding: 10px 18px;
    border: 1px solid rgba(102, 126, 234, 0.45);
    border-radius: 10px;
    background: rgba(102, 126, 234, 0.1);
    font-family: "Montserrat", sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #a5b4fc;
    line-height: 1.4;
    cursor: pointer;
    text-align: center;
    transition: background 0.3s ease, border-color 0.3s ease, transform 0.25s ease;
}

button.footer__cookie-link:hover {
    background: rgba(102, 126, 234, 0.22);
    border-color: #667eea;
    color: #ffffff;
    transform: translateY(-1px);
}

button.footer__cookie-link:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

button.legal__cookie-btn {
    -webkit-appearance: none;
    appearance: none;
    font-family: "Montserrat", sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 14px 28px;
    margin-top: 12px;
    border-radius: 10px;
    border: 1px solid #667eea;
    background: rgba(102, 126, 234, 0.15);
    color: #a5b4fc;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

button.legal__cookie-btn:hover {
    background: #667eea;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.35);
}

@media (max-width: 768px) {
    .cookie-banner {
        padding: 18px 20px;
    }

    .cookie-banner__content {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 18px;
    }

    .cookie-banner__actions {
        justify-content: center;
    }

    .cookie-banner button.cookie-banner__btn,
    .cookie-modal button.cookie-banner__btn {
        font-size: 0.7rem;
        padding: 11px 16px;
        flex: 1 1 auto;
        min-width: calc(50% - 6px);
    }

    .cookie-banner button.cookie-banner__btn--accept,
    .cookie-modal button.cookie-banner__btn--accept {
        min-width: 100%;
    }

    .cookie-modal__panel {
        padding: 28px 22px;
    }

    .cookie-modal__actions {
        flex-direction: column;
    }

    .cookie-modal__actions button.cookie-banner__btn {
        width: 100%;
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .cookie-banner button.cookie-banner__btn {
        min-width: 100%;
    }

    .cookie-banner__text p {
        font-size: 0.78rem;
    }
}
