:root {
    --privacy-bg-color: #ede5d9;
    --privacy-overlay-color: rgba(24, 21, 18, 0.28);
    --privacy-panel-bg-light: rgba(255, 255, 255, 0.76);
    --privacy-panel-bg-dark: rgba(30, 30, 30, 0.58);
    --privacy-panel-border-light: rgba(255, 255, 255, 0.24);
    --privacy-panel-border-dark: rgba(255, 255, 255, 0.18);
    --privacy-text-light: #0b0b0c;
    --privacy-text-dark: #faf7f3;
    --privacy-muted-light: rgba(11, 11, 12, 0.82);
    --privacy-muted-dark: rgba(250, 247, 243, 0.92);
    --privacy-button-light: rgba(0, 0, 0, 0.07);
    --privacy-button-dark: rgba(255, 255, 255, 0.08);
    --privacy-button-light-active: rgba(0, 0, 0, 0.14);
    --privacy-button-dark-active: rgba(255, 255, 255, 0.15);
    --privacy-accent-color: #007aff;
    --privacy-popup-width-desktop: 260px;
    --privacy-popup-radius-desktop: 26px;
    --privacy-popup-radius-mobile: 34px;
    --privacy-popup-padding-desktop: 20px 16px 16px;
    --privacy-popup-padding-mobile: 24px 18px 18px;
    --privacy-icon-size-desktop: 64px;
    --privacy-icon-size-mobile: 66px;
    --privacy-app-icon: url("./assets/app-icon.png");
    --privacy-link-color: currentColor;
    --privacy-link-underline-color: currentColor;
    --privacy-link-underline-offset: 0.16em;
    --privacy-font-family: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.privacy-link,
.popup-trigger {
    appearance: none;
    border: 0;
    padding: 0;
    margin: 0;
    color: var(--privacy-link-color);
    background: transparent;
    font: inherit;
    font-weight: 700;
    line-height: inherit;
    cursor: pointer;
    position: relative;
    text-decoration: none;
    display: inline-block;
    padding-bottom: 2px;
}

.privacy-link::before,
.popup-trigger::before {
    content: "";
    display: block;
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: var(--privacy-link-underline-color);
    transform: scaleX(0);
    transform-origin: 100% 50%;
    transition: transform 0.4s cubic-bezier(0.83, 0, 0.17, 1);
    pointer-events: none;
}

.privacy-link:hover::before,
.privacy-link:focus-visible::before,
.popup-trigger:hover::before,
.popup-trigger:focus-visible::before {
    transform: scaleX(1);
    transform-origin: 0% 50%;
}

.privacy-link:focus-visible,
.popup-trigger:focus-visible {
    outline: none;
}

.optout-popup {
    position: fixed;
    inset: 0;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 240ms ease;
}

.optout-popup.is-active {
    opacity: 1;
    pointer-events: auto;
}

.optout-popup__scrim {
    position: absolute;
    inset: 0;
    background: var(--privacy-overlay-color);
}

.optout-popup__layout {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-family: var(--privacy-font-family);
    padding: 18px;
}

.optout-popup__spacer {
    flex: 1 1 auto;
    width: 100%;
}

.c-popup {
    position: relative;
    width: var(--privacy-popup-width-desktop);
    min-height: 256px;
    border-radius: var(--privacy-popup-radius-desktop);
    background: var(--privacy-panel-bg-light);
    border: 1px solid var(--privacy-panel-border-light);
    box-shadow:
        inset 0 0.5px 0.5px rgba(255, 255, 255, 0.45),
        0 0 1px rgba(0, 0, 0, 0.6),
        0 12px 30px rgba(0, 0, 0, 0.14),
        0 22px 56px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
    transform: scale(0.92);
    opacity: 0;
    cursor: default;
}

.optout-popup.is-active .c-popup {
    animation: privacy-popup-appear 360ms cubic-bezier(0.175, 0.885, 0.32, 1.1) forwards;
}

@keyframes privacy-popup-appear {
    from {
        transform: scale(0.92);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.c-popup-content {
    height: 100%;
    padding: var(--privacy-popup-padding-desktop);
}

.inside-popup {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.c-popup *,
.c-popup-content,
.inside-popup,
.app-icon,
.c-message,
.checkbox-container,
.checkbox-label {
    cursor: default;
}

.app-icon {
    width: var(--privacy-icon-size-desktop);
    height: var(--privacy-icon-size-desktop);
    margin: 0 auto 16px 0;
    background-image: var(--privacy-app-icon);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

.c-message {
    margin: 0 0 22px;
    color: var(--privacy-text-light);
    font-size: 13px;
    font-weight: 700;
    line-height: 16px;
    text-align: left;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    cursor: default;
}

.checkbox-container input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    margin: 1px 0 0;
    border: none;
    border-radius: 4px;
    background: var(--privacy-button-light);
    background-position: center;
    background-repeat: no-repeat;
    background-size: 16px 16px;
    flex-shrink: 0;
    cursor: default;
    transition: background-color 160ms ease;
}

.checkbox-container input[type="checkbox"]:checked {
    background-color: var(--privacy-accent-color);
    background-image: url("./assets/checkbox-a.svg");
}

.checkbox-label {
    color: var(--privacy-muted-light);
    font-size: 13px;
    font-weight: 510;
    line-height: 16px;
    letter-spacing: -0.2px;
    text-align: left;
}

.leave-button {
    width: 100%;
    height: 29px;
    margin-top: auto;
    border: 0;
    border-radius: 999px;
    background: var(--privacy-button-light);
    color: var(--privacy-text-light);
    font: inherit;
    font-size: 13px;
    font-weight: 510;
    letter-spacing: -0.2px;
    cursor: default;
    transition: none;
}

.leave-button:active {
    background: var(--privacy-button-light-active);
}

@media (prefers-color-scheme: dark) {
    .c-popup {
        background: var(--privacy-panel-bg-dark);
        border-color: var(--privacy-panel-border-dark);
    }

    .c-message {
        color: var(--privacy-text-dark);
    }

    .checkbox-label {
        color: var(--privacy-muted-dark);
        font-weight: 400;
    }

    .checkbox-container input[type="checkbox"] {
        background-color: var(--privacy-button-dark);
    }

    .leave-button {
        background: var(--privacy-button-dark);
        color: var(--privacy-text-dark);
    }

    .leave-button:active {
        background: var(--privacy-button-dark-active);
    }
}

@media (max-width: 600px) {
    .optout-popup__layout {
        padding: 14px;
    }

    .c-popup {
        width: min(320px, calc(100vw - 44px));
        min-height: 0;
        border-radius: var(--privacy-popup-radius-mobile);
        margin-inline: auto;
        box-shadow:
            inset 0 0 1px 1px rgba(255, 255, 255, 0.92),
            0 10px 60px rgba(0, 0, 0, 0.14),
            0 28px 120px rgba(0, 0, 0, 0.16);
    }

    .c-popup-content {
        padding: var(--privacy-popup-padding-mobile);
    }

    .app-icon {
        width: var(--privacy-icon-size-mobile);
        height: var(--privacy-icon-size-mobile);
        margin-bottom: 18px;
    }

    .c-message {
        font-size: 15px;
        line-height: 18px;
        margin-bottom: 24px;
    }

    .checkbox-container {
        gap: 12px;
        margin-bottom: 22px;
    }

    .checkbox-container input[type="checkbox"] {
        width: 18px;
        height: 18px;
        background-size: 18px 18px;
    }

    .checkbox-label {
        font-size: 15px;
        line-height: 19px;
    }

    .leave-button {
        height: 38px;
        font-size: 15px;
    }
}
