/* Shared cookie consent card, styled to match V3 */
.cookie-consent-banner {
    position: fixed;
    z-index: 10000;
    left: auto;
    right: 24px;
    bottom: 24px;
    width: min(510px, calc(100vw - 48px));
    max-height: min(84vh, 780px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(29, 32, 39, .98), rgba(17, 19, 24, .985));
    box-shadow: 0 20px 70px rgba(0, 0, 0, .48), 0 4px 18px rgba(0, 0, 0, .25);
    color: #f9f9f9;
    font-family: var(--v3-font, Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
    transform: translateY(calc(100% + 36px));
    opacity: 0;
    transition: transform .32s cubic-bezier(.2, .75, .25, 1), opacity .24s ease;
    backdrop-filter: blur(20px) saturate(130%);
    -webkit-backdrop-filter: blur(20px) saturate(130%);
}

.cookie-consent-banner.active {
    transform: translateY(0);
    opacity: 1;
}

.cookie-consent-content {
    display: grid;
    max-width: none;
    gap: 13px;
    margin: 0;
}

.cookie-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cookie-heading-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: none;
    place-items: center;
    border: 1px solid rgba(24, 117, 229, .3);
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(24, 117, 229, .22), rgba(24, 117, 229, .08));
    color: #69adff;
}

.cookie-heading-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.cookie-heading-copy {
    display: grid;
    gap: 2px;
}

.cookie-eyebrow {
    color: #8f9aa8;
    font-size: 9px;
    font-weight: 750;
    letter-spacing: .14em;
    line-height: 1.3;
    text-transform: uppercase;
}

.cookie-heading h2 {
    margin: 0;
    color: #f9f9f9;
    font-size: 17px;
    font-weight: 680;
    letter-spacing: -.02em;
    line-height: 1.25;
}

.cookie-text {
    margin: 0;
}

.cookie-text p {
    margin: 0;
    color: #b7bec8;
    font-size: 13px;
    line-height: 1.6;
}

.cookie-text a {
    color: #72b2ff !important;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(114, 178, 255, .45);
    text-underline-offset: 3px;
}

.cookie-text a:hover {
    color: #a7d1ff !important;
    text-decoration-color: currentColor;
}

.cookie-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.cookie-btn {
    display: inline-flex;
    min-width: 0;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: 9px;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.3;
    text-align: center;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.cookie-btn:hover {
    transform: translateY(-1px);
}

.cookie-btn:focus-visible,
.cookie-toggle:focus-visible + .slider {
    outline: 2px solid #8abfff;
    outline-offset: 3px;
}

.cookie-accept-all,
.cookie-settings #save-preferences {
    border-color: #1875e5;
    background: #1875e5;
    color: #fff;
}

.cookie-accept-all:hover,
.cookie-settings #save-preferences:hover {
    border-color: #3489ed;
    background: #3489ed;
}

.cookie-reject {
    border-color: rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .06);
    color: #e2e6ec;
}

.cookie-reject:hover {
    border-color: rgba(255, 255, 255, .24);
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

.cookie-customize {
    grid-column: 1 / -1;
    min-height: 34px;
    border-color: transparent;
    background: transparent;
    color: #a8b0bc;
}

.cookie-customize:hover {
    border-color: rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .045);
    color: #fff;
}

.cookie-settings {
    display: none;
    margin: 0;
    padding: 7px 13px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    background: rgba(12, 14, 18, .64);
}

.cookie-setting-item {
    display: flex;
    min-height: 62px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.cookie-setting-item:last-child {
    border-bottom: 0;
}

.cookie-setting-item > div {
    min-width: 0;
}

.cookie-setting-item strong {
    color: #e9edf2;
    font-size: 12px;
    font-weight: 650;
}

.cookie-setting-item p {
    margin: 3px 0 0;
    color: #929ba7;
    font-size: 11px;
    line-height: 1.45;
}

.toggle-switch {
    position: relative;
    display: inline-flex;
    width: 44px;
    height: 25px;
    flex: none;
    align-items: center;
    cursor: pointer;
}

.cookie-toggle {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.slider {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 24px;
    background: #343a44;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease;
}

.slider::before {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #d7dce3;
    content: "";
    transition: transform .2s ease, background-color .2s ease;
}

.cookie-toggle:checked + .slider {
    border-color: rgba(24, 117, 229, .75);
    background: #1875e5;
}

.cookie-toggle:checked + .slider::before {
    transform: translateX(19px);
    background: #fff;
}

.required-cookie {
    cursor: not-allowed;
}

.required-cookie .slider {
    border-color: rgba(255, 255, 255, .08);
    background: #515865;
    cursor: not-allowed;
}

.required-cookie .cookie-toggle:checked + .slider {
    border-color: rgba(255, 255, 255, .08);
    background: #515865;
}

.required-cookie .slider::before {
    background: #e3e6ea;
}

.cookie-settings-save {
    display: flex;
    justify-content: flex-end;
    padding: 10px 0 6px;
}

.cookie-settings #save-preferences {
    min-height: 38px;
    padding-inline: 16px;
}

@media (max-width: 520px) {
    .cookie-consent-banner {
        right: 12px;
        bottom: max(12px, env(safe-area-inset-bottom));
        left: 12px;
        width: auto;
        max-height: min(88vh, 820px);
        padding: 17px;
        border-radius: 14px;
    }

    .cookie-consent-content {
        gap: 11px;
    }

    .cookie-heading-icon {
        width: 39px;
        height: 39px;
    }

    .cookie-heading h2 {
        font-size: 16px;
    }

    .cookie-buttons {
        grid-template-columns: minmax(0, 1fr);
        gap: 7px;
    }

    .cookie-btn,
    .cookie-customize {
        grid-column: 1;
        width: 100%;
    }

    .cookie-customize {
        min-height: 38px;
    }

    .cookie-setting-item {
        gap: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cookie-consent-banner,
    .cookie-btn,
    .slider,
    .slider::before {
        transition-duration: .01ms;
    }
}
