/*** Cookie consent banner and preferences panel (js/cookie-consent.js) ***/

.cookie-banner {
    position: fixed;
    left: 20px;
    right: 20px;
    bottom: 20px;
    z-index: 1080;
    max-width: 1100px;
    margin: 0 auto;
    background: #FFFFFF;
    border: 1px solid rgba(24, 28, 46, .08);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(24, 28, 46, .18);
    opacity: 0;
    transform: translateY(calc(100% + 30px));
    transition: opacity .35s ease, transform .45s cubic-bezier(.2, .8, .2, 1);
    pointer-events: none;
}

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

.cookie-banner-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
}

.cookie-banner-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(75, 94, 252, .1);
    color: var(--primary);
    font-size: 22px;
}

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

.cookie-banner-text strong {
    display: block;
    color: var(--dark);
    font-size: 16px;
    margin-bottom: 2px;
}

.cookie-banner-text p {
    margin: 0;
    color: var(--secondary);
    font-size: 14px;
    line-height: 1.55;
}

.cookie-banner-text a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-banner-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cookie-btn {
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.cookie-btn:focus-visible {
    outline: 3px solid rgba(75, 94, 252, .35);
    outline-offset: 2px;
}

.cookie-btn-primary {
    background: var(--primary);
    color: #FFFFFF;
}

.cookie-btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 10px 22px rgba(75, 94, 252, .3);
}

.cookie-btn-outline {
    background: #FFFFFF;
    border-color: rgba(24, 28, 46, .18);
    color: var(--dark);
}

.cookie-btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.cookie-btn-link {
    background: transparent;
    color: var(--secondary);
    padding-left: 10px;
    padding-right: 10px;
}

.cookie-btn-link:hover {
    color: var(--primary);
}

/* Preferences panel */
.cookie-modal {
    position: fixed;
    inset: 0;
    z-index: 1090;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    visibility: hidden;
    opacity: 0;
    transition: opacity .25s ease, visibility .25s;
}

.cookie-modal.is-open {
    visibility: visible;
    opacity: 1;
}

.cookie-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(24, 28, 46, .55);
}

.cookie-modal-box {
    position: relative;
    width: 100%;
    max-width: 540px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: #FFFFFF;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 30px 80px rgba(24, 28, 46, .3);
    transform: translateY(16px);
    transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}

.cookie-modal.is-open .cookie-modal-box {
    transform: translateY(0);
}

.cookie-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: var(--light);
    color: var(--dark);
    cursor: pointer;
}

.cookie-modal-close:hover {
    background: rgba(75, 94, 252, .1);
    color: var(--primary);
}

.cookie-modal-box h2 {
    font-size: 24px;
    color: var(--dark);
    margin: 0 40px 8px 0;
}

.cookie-modal-lead {
    color: var(--secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

.cookie-category {
    border: 1px solid rgba(24, 28, 46, .08);
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 12px;
}

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

.cookie-category-head label {
    font-weight: 700;
    color: var(--dark);
    margin: 0;
    cursor: pointer;
}

.cookie-category p {
    margin: 6px 0 0;
    color: var(--secondary);
    font-size: 13px;
    line-height: 1.55;
}

/* Toggle switch */
.cookie-switch {
    position: relative;
    flex-shrink: 0;
    width: 46px;
    height: 26px;
}

.cookie-switch input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.cookie-switch input:disabled {
    cursor: not-allowed;
}

.cookie-switch-track {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #D5D7E0;
    transition: background-color .2s ease;
}

.cookie-switch-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 2px 4px rgba(24, 28, 46, .2);
    transition: transform .2s ease;
}

.cookie-switch input:checked + .cookie-switch-track {
    background: var(--primary);
}

.cookie-switch input:checked + .cookie-switch-track::after {
    transform: translateX(20px);
}

.cookie-switch input:disabled + .cookie-switch-track {
    opacity: .55;
}

.cookie-switch input:focus-visible + .cookie-switch-track {
    box-shadow: 0 0 0 3px rgba(75, 94, 252, .35);
}

.cookie-modal-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

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

/* Footer "Cookie Settings" link is a button, styled to match the other legal links */
.site-footer-legal button {
    background: none;
    border: 0;
    padding: 0;
    color: rgba(255, 255, 255, .6);
    font: inherit;
    cursor: pointer;
}

.site-footer-legal button:hover {
    color: #FFFFFF;
}

@media (max-width: 991.98px) {
    .cookie-banner-inner {
        flex-wrap: wrap;
    }
    .cookie-banner-text {
        flex-basis: calc(100% - 68px);
    }
    .cookie-banner-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 575.98px) {
    .cookie-banner {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }
    .cookie-banner-inner {
        padding: 18px;
        gap: 14px;
    }
    .cookie-banner-icon {
        display: none;
    }
    .cookie-banner-text {
        flex-basis: 100%;
    }
    .cookie-banner-actions {
        flex-wrap: wrap;
    }
    .cookie-banner-actions .cookie-btn-primary,
    .cookie-banner-actions .cookie-btn-outline {
        flex: 1;
    }
    .cookie-banner-actions .cookie-btn-link {
        order: 3;
        width: 100%;
    }
    .cookie-modal-box {
        padding: 24px 20px;
    }
    .cookie-modal-actions .cookie-btn {
        flex: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cookie-banner,
    .cookie-modal,
    .cookie-modal-box {
        transition: none;
    }
}
