.scf-popup,
.scf-popup * {
    box-sizing: border-box;
}

.scf-popup[hidden] {
    display: none !important;
}

.scf-popup {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: grid;
    place-items: center;
    padding: clamp(16px, 4vw, 48px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 180ms ease, visibility 180ms ease;
}

.scf-popup.is-open {
    opacity: 1;
    visibility: visible;
}

.scf-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.64);
    backdrop-filter: blur(1px);
}

.scf-popup__dialog {
    position: relative;
    z-index: 1;
    width: auto;
    max-width: min(92vw, 1200px);
    max-height: calc(92vh - 32px);
    overflow: visible;
    transform: translateY(10px) scale(0.985);
    transition: transform 220ms cubic-bezier(.2, .8, .2, 1);
}

.scf-popup.is-open .scf-popup__dialog {
    transform: translateY(0) scale(1);
}

.scf-popup__content {
    max-height: calc(92vh - 32px);
    overflow: hidden;
    text-align: center;
    line-height: 0;
    border-radius: 2px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.scf-popup__content img,
.scf-popup__content video,
.scf-popup__content iframe {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: calc(92vh - 32px);
    margin: 0 auto;
}

.scf-popup__content a {
    display: inline-block;
    max-width: 100%;
}

.scf-popup__close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    color: #fff;
    font: 400 26px/38px Arial, sans-serif;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
    transition: transform 150ms ease, background 150ms ease;
}

.scf-popup__close:hover {
    background: rgba(15, 23, 42, 1);
    transform: scale(1.06);
}

.scf-popup__close:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.92);
    outline-offset: 3px;
}

html.scf-popup-lock,
html.scf-popup-lock body {
    overflow: hidden !important;
}

@media (max-width: 640px) {
    .scf-popup {
        padding: 12px;
    }

    .scf-popup__dialog,
    .scf-popup__content {
        max-height: calc(100vh - 24px);
    }

    .scf-popup__close {
        top: 10px;
        right: 10px;
        width: 38px;
        height: 38px;
        font-size: 24px;
        line-height: 36px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .scf-popup,
    .scf-popup__dialog,
    .scf-popup__close {
        transition: none;
    }
}
