/* ============================================================
   COOKIE CONSENT
   ============================================================ */

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

.cookie-consent {
    position: fixed;

    left: 18px;
    right: 18px;
    bottom: 18px;

    z-index: 1200;

    max-width: 1180px;

    margin: 0 auto;

    padding: 24px;

    background: rgba(255,255,255,.97);

    border: 1px solid var(--line);
    border-radius: 14px;

    box-shadow:
        0 20px 60px rgba(20,30,55,.16);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.cookie-consent-inner {
    display: grid;
    grid-template-columns: 1fr auto;

    gap: 40px;

    align-items: center;
}

.cookie-consent-copy {
    max-width: 720px;
}

.cookie-consent-eyebrow {
    color: var(--blue);

    font-size: .62rem;
    font-weight: 800;

    letter-spacing: .12em;
}

.cookie-consent h2,
.cookie-settings h2 {
    margin: 7px 0 10px;

    font-size: 1.5rem;
    line-height: 1.05;

    letter-spacing: -.035em;
}

.cookie-consent p {
    margin: 0;

    color: var(--muted);

    font-size: .88rem;
    line-height: 1.55;
}

.cookie-consent-actions {
    display: flex;
    flex-wrap: wrap;

    gap: 8px;

    align-items: center;
    justify-content: flex-end;
}

.cookie-consent-settings-button {
    padding: 10px 12px;

    border: 0;

    background: transparent;

    color: var(--blue);

    cursor: pointer;

    font: inherit;
    font-size: .78rem;
    font-weight: 700;
}


/* Settings modal */

.cookie-settings {
    position: fixed;

    inset: 0;

    z-index: 1300;

    display: none;
}

.cookie-settings.is-open {
    display: block;
}

.cookie-settings-backdrop {
    position: absolute;

    inset: 0;

    background: rgba(5,12,28,.56);
}

.cookie-settings-panel {
    position: absolute;

    top: 50%;
    left: 50%;

    width: min(620px, calc(100% - 32px));

    max-height: calc(100vh - 40px);

    overflow-y: auto;

    transform: translate(-50%, -50%);

    padding: 32px;

    background: var(--bg);

    border: 1px solid var(--line);
    border-radius: 14px;

    box-shadow:
        0 28px 80px rgba(0,0,0,.25);
}

.cookie-settings-close {
    position: absolute;

    top: 15px;
    right: 17px;

    width: 42px;
    height: 42px;

    border: 0;

    background: transparent;

    color: var(--text);

    cursor: pointer;

    font-size: 1.6rem;
}

.cookie-category {
    display: grid;
    grid-template-columns: 1fr auto;

    gap: 25px;

    align-items: center;

    padding: 22px 0;

    border-top: 1px solid var(--line);
}

.cookie-category strong {
    display: block;

    margin-bottom: 6px;
}

.cookie-category p {
    max-width: 470px;

    margin: 0;

    color: var(--muted);

    font-size: .88rem;
    line-height: 1.5;
}

.cookie-category-required {
    color: var(--muted);

    font-size: .7rem;
    font-weight: 700;
}


/* Toggle */

.cookie-switch {
    position: relative;

    display: inline-block;

    width: 48px;
    height: 28px;
}

.cookie-switch input {
    position: absolute;

    opacity: 0;
}

.cookie-switch > span:not(.sr-only) {
    position: absolute;

    inset: 0;

    border-radius: 999px;

    background: var(--line);

    cursor: pointer;

    transition: background .2s ease;
}

.cookie-switch > span:not(.sr-only)::after {
    content: "";

    position: absolute;

    top: 4px;
    left: 4px;

    width: 20px;
    height: 20px;

    border-radius: 50%;

    background: #fff;

    box-shadow:
        0 2px 7px rgba(0,0,0,.18);

    transition: transform .2s ease;
}

.cookie-switch input:checked +
span:not(.sr-only) {
    background: var(--blue);
}

.cookie-switch input:checked +
span:not(.sr-only)::after {
    transform: translateX(20px);
}

.cookie-settings-actions {
    padding-top: 20px;

    border-top: 1px solid var(--line);
}


/* Dark */

[data-theme="dark"] .cookie-consent {
    background: rgba(8,17,38,.97);
}


/* Mobile */

@media (max-width: 760px) {

    .cookie-consent {
        left: 10px;
        right: 10px;

        bottom: calc(
            76px +
            env(safe-area-inset-bottom)
        );

        padding: 20px;
    }

    .cookie-consent-inner {
        grid-template-columns: 1fr;

        gap: 20px;
    }

    .cookie-consent-actions {
        justify-content: flex-start;
    }

    .cookie-settings-panel {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;

        width: 100%;

        max-height: 88vh;

        transform: none;

        border-radius: 18px 18px 0 0;

        padding-bottom:
            calc(
                30px +
                env(safe-area-inset-bottom)
            );
    }

}

.footer-cookie-settings {
    width: 46px;
    height: 46px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 1px solid transparent;
    border-radius: 999px;

    background: transparent;

    color: inherit;

    cursor: pointer;

    font: inherit;

    transition:
        background .2s ease,
        border-color .2s ease,
        color .2s ease,
        transform .2s ease;
}

.footer-cookie-settings:hover {
    background: rgba(113, 152, 255, .08);
    border-color: var(--line);
    color: var(--blue);
}

.footer-cookie-settings:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

.footer-cookie-settings svg {
    width: 26px;
    height: 26px;

    display: block;

    fill: currentColor;
}

.cookie-policy-links {
    display: flex;
    flex-wrap: wrap;

    gap: 16px;

    padding: 18px 0;
}

.cookie-policy-links a {
    color: var(--blue);

    font-size: .78rem;
    font-weight: 700;
}
