/* =========================
   공통 팝업
   ========================= */
body.site_popup_open {
    overflow: hidden;
    position: relative;
    z-index: 29999;
    isolation: isolate;
}

.site_popup {
    position: fixed;
    inset: 0;
    z-index: 30000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .28s ease, visibility .28s ease;
}

.site_popup.is_open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.site_popup_dim {
    position: absolute;
    inset: 0;
    background: rgba(9, 12, 18, 0.58);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* 팝업 프레임 */
.site_popup_frame {
    position: relative;
    z-index: 1;
    width: min(920px, 100%);
    padding-top: 56px;
}

/* 팝업 박스 */
.site_popup_dialog {
    width: 100%;
    max-height: min(calc(100dvh - 104px), 900px);
    background: #fff;
    border-radius: 30px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
    overflow: hidden;
    transform: translateY(18px) scale(.985);
    transition: transform .32s cubic-bezier(0.22, 1, 0.36, 1);
}

.site_popup.is_open .site_popup_dialog {
    transform: translateY(0) scale(1);
}

/* 팝업 박스 바깥 우측 상단 닫기 버튼 */
.site_popup_close {
    position: absolute;
    top: 0;
    right: 0;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    cursor: pointer;
    z-index: 3;
    transition: transform .2s ease, opacity .2s ease;
}

.site_popup_close:hover {
    transform: rotate(90deg);
    opacity: .85;
}

.site_popup_close span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 28px;
    height: 2px;
    border-radius: 999px;
    background: #fff;
}

.site_popup_close span:first-child {
    transform: translate(-50%, -50%) rotate(45deg);
}

.site_popup_close span:last-child {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.site_popup_body {
    max-height: min(calc(100dvh - 150px), 900px);
    overflow-y: auto;
    padding: clamp(30px, 3vw, 40px);
}

.site_popup_inner {
    width: 100%;
}

.site_popup_title {
    margin: 0 0 24px;
    color: var(--gray_2);
    font-size: var(--fs_32);
    line-height: 1.3;
    font-weight: 700;
    word-break: keep-all;
}

/* 이미지형 */
.site_popup_image_wrap {
    padding: clamp(14px, 2vw, 22px);
    border: 1px solid var(--gray_e6);
    border-radius: 24px;
    background: var(--gray_f8);
}

.site_popup_image {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 auto;
}

/* 텍스트형 */
.site_popup_terms {
    color: var(--gray_4);
    font-size: var(--fs_18);
    line-height: 1.85;
    word-break: keep-all;
}

.site_popup_terms_intro {
    padding: clamp(18px, 2vw, 26px);
    border-radius: 22px;
    background: var(--sub_lighter);
}

.site_popup_terms_company {
    margin: 0 0 10px;
    color: var(--point);
    font-size: var(--fs_24);
    line-height: 1.4;
}

.site_popup_terms_intro p:last-child {
    margin-bottom: 0;
}

.site_popup_terms_section {
    margin-top: clamp(24px, 2vw, 30px);
}

.site_popup_terms_section h4 {
    margin: 0 0 10px;
    color: var(--gray_2);
    font-size: var(--fs_22);
    line-height: 1.45;
    font-weight: 700;
}

.site_popup_terms_section p {
    margin: 0;
}

.site_popup_terms_section p + p {
    margin-top: 6px;
}

@media (max-width: 991px) {
    .site_popup {
        padding: 20px;
    }

    .site_popup_frame {
        width: min(100%, 860px);
    }
}

@media (max-width: 767px) {
    .site_popup {
        padding: 14px;
    }

    .site_popup_frame {
        width: 100%;
        padding-top: 48px;
    }

    .site_popup_dialog {
        max-height: calc(100dvh - 76px);
        border-radius: 24px;
    }

    .site_popup_close {
        width: 40px;
        height: 40px;
    }

    .site_popup_close span {
        width: 24px;
    }

    .site_popup_body {
        max-height: calc(100dvh - 120px);
        padding: 22px 18px 24px;
    }

    .site_popup_title {
        margin-bottom: 18px;
        font-size: var(--fs_24);
    }

    .site_popup_image_wrap {
        padding: 10px;
        border-radius: 18px;
    }

    .site_popup_terms {
        font-size: var(--fs_16);
        line-height: 1.75;
    }

    .site_popup_terms_company {
        font-size: var(--fs_20);
    }

    .site_popup_terms_section h4 {
        font-size: var(--fs_18);
    }
}
