/* ka.join.passport-mask.css — 여권/신분증 사본 제출 & 마스킹 모듈 스타일
   passport-mask.js 와 함께 사용. ka.join.tokens.css 의 CSS 변수(--surface-*, --text-*, --border-*)에 의존하므로
   tokens.css 이후에 로드해야 함.
   외부 의존 버튼/모달 클래스(.btn-solid-black-large 등)와 충돌 회피를 위해 모듈 prefix(pm-) 사용. */

#pm-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    flex-direction: column;
    /* 호스트 페이지(마이페이지=Noto Sans 등) body 폰트 상속 방지 — 모달/알림을 어느 페이지서든 동일하게 */
    font-family: 'Pretendard', 'Apple SD Gothic Neo', sans-serif;
}
@media (min-width: 64rem) {
    #pm-overlay {
        background: rgba(0, 0, 0, 0.5);
        align-items: center;
        justify-content: center;
    }
}

#pm-modal {
    width: 100%;
    height: 100%;
    min-height: 0;
    background: var(--surface-white, #fff);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
@media (min-width: 64rem) {
    #pm-modal {
        width: calc(100% - 2.5rem);
        max-width: 75rem;
        height: calc(100vh - 5rem);
        max-height: 50rem;
        border-radius: 0.5rem;
        flex-direction: row;
        box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.08);
    }
}

.pm-pc-only {
    display: none !important;
}
@media (min-width: 64rem) {
    .pm-mobile-only {
        display: none !important;
    }
    .pm-pc-only {
        display: flex !important;
    }
}

/* 모달 헤더/X — 외부 .modal-header/.modal-title/.modal-close 와 동일 시각이지만 충돌 회피용 모듈 prefix */
.pm-modal-header {
    position: relative;
    display: flex;
    height: 3.5rem;
    padding: 0 1.25rem;
    align-items: center;
    flex-shrink: 0;
}
.pm-modal-title {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    max-width: calc(100% - 6rem); /* X 닫기 버튼과 겹치지 않도록 폭 제한(긴 영문 제목은 줄바꿈) */
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.008rem;
    text-align: center;
    line-height: 1.3;
    color: var(--text-default, #252525);
    width: 100%;
}

.pm-modal-title-en {
    font-size: 14px;
    line-height: 18px;
}
.pm-modal-close {
    margin-left: auto;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
}

/* PC 데스크탑 전용: 흰 도구 버튼(.btn-solid-white-medium2)에 외곽선 부여 */
@media (min-width: 64rem) {
    #pm-overlay .pm-tool-btn.btn-solid-white-medium2 {
        border: 1px solid var(--border-gray-dark2);
        transition: border-color 0.15s;
    }
    #pm-overlay .pm-tool-btn.btn-solid-white-medium2:hover {
        border-color: var(--border-gray-dark);
        background: var(--surface-white);
    }
}

.pm-notice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface-primary-lighter, #fff1e9);
    border-radius: 0.25rem;
    padding: 0.75rem 1rem;
    margin: 0.5rem 1.25rem 1.25rem;
}

.pm-notice .ty-body3 {
    flex: 1 1 0;
    min-width: 0;
    margin-bottom: 0;
    /* typography.css 미로드 페이지(마이페이지 등)에서도 동일 크기 보장 — .ty-body3 값 자체 명시 */
    font-size: 0.875rem;
    line-height: 1.25rem;
    letter-spacing: -0.007rem;
}

.pm-notice-em {
    color: var(--text-primary, #f76e33);
}
.pm-notice-break {
    display: none;
}
@media (min-width: 64rem) {
    .pm-notice-break {
        display: inline;
    }
}
.pm-notice-break-mo {
    display: inline;
}
@media (min-width: 64rem) {
    .pm-notice-break-mo {
        display: none;
    }
}
.pm-example-wrap {
    margin: 0 1.25rem;
    overflow: hidden;
    position: relative;
}
.pm-example-img {
    width: 100%;
    height: auto;
    display: block;
}
.pm-example-wrap .pm-ex-top {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    opacity: 0;
    transition: opacity 0.6s ease;
}
/* 예시 이미지 아래 파일형식 안내 (예시와 함께 PC 전용) */
.pm-format-hint {
    margin: 16px 20px 40px;
    color: var(--text-secondary);
}

#pm-after {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
@media (min-width: 64rem) {
    #pm-after {
        flex-direction: row;
        width: 100%;
    }
}

#pm-canvas-col {
    position: relative;
    flex: 1;
    min-height: 0;
    min-width: 0;
    background: var(--surface-gray-lighter1, #f3f3f3);
    border-right: 1px solid var(--divider-gray-light, #e5e5e5);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
#pm-canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
    cursor: crosshair;
    touch-action: none;
}
#pm-example-dim {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    pointer-events: none;
}
#pm-example-overlay {
    position: absolute;
    inset: 0;
    display: none;
    pointer-events: none;
}
#pm-example-overlay img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
#pm-example-overlay .pm-ex-top {
    opacity: 0;
    transition: opacity 0.6s ease;
}

#pm-right-after {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    background: var(--surface-white, #fff);
}
@media (min-width: 64rem) {
    #pm-right-after {
        width: 22.5rem;
        overflow: hidden;
    }
    #pm-right-after .pm-modal-header,
    #pm-right-after .pm-toolbar,
    #pm-right-after #pm-after-cta {
        flex-shrink: 0;
    }
    #pm-right-after #pm-after-guide {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
    }
}
@media (max-width: 63.9375rem) {
    #pm-after-guide .pm-example-wrap,
    #pm-after-guide .pm-format-hint {
        display: none;
    }

    /* 헤더 - 노티스 - 캔버스 - 툴바 - cta 순서로 재배치 */
    #pm-right-after {
        display: contents;
    }
    #pm-right-after .pm-modal-header {
        order: 1;
    }
    #pm-right-after #pm-after-guide {
        order: 2;
    }
    #pm-canvas-col {
        order: 3;
    }
    #pm-right-after .pm-toolbar {
        order: 4;
    }
    #pm-right-after #pm-after-cta {
        order: 5;
    }
}

.pm-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem 1.5rem;
    flex-shrink: 0;
}
@media (min-width: 64rem) {
    .pm-toolbar {
        padding: 0.625rem 1.25rem 0.25rem;
    }
}

.pm-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin: 0;
    margin-right: auto;
    cursor: pointer;
    font-size: 0.9375rem;
    color: var(--text-default, #252525);
    user-select: none;
}
.pm-toggle {
    width: 1.625rem;
    height: 1rem;
    border-radius: 999px;
    background: #d7d7d7;
    position: relative;
    transition: background 0.2s;
    padding: 0;
    flex-shrink: 0;
    border: none;
    cursor: pointer;
}
.pm-toggle.on {
    background: var(--surface-primary, #f76e33);
}
.pm-toggle-knob {
    position: absolute;
    top: 0.188rem;
    left: 0.188rem;
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s;
    display: block;
}
.pm-toggle.on .pm-toggle-knob {
    transform: translateX(0.625rem);
}

.pm-tool-btns {
    display: flex;
    gap: 0.25rem;
}

.pm-tool-btns .pm-tool-btn {
    line-height: normal;
}

@media (min-width: 64rem) {
    .pm-tool-btns {
        flex: 1;
        gap: 0.5rem;
    }
    .pm-tool-btns .pm-tool-btn {
        flex: 1;
        justify-content: center;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

#pm-after-cta {
    display: flex;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    padding-bottom: max(env(safe-area-inset-bottom, 0px), 0.625rem);
    flex-shrink: 0;
}
@media (min-width: 48rem) {
    #pm-after-cta {
        padding: 1.25rem;
        padding-bottom: max(env(safe-area-inset-bottom, 0px), 1.25rem);
    }
}
@media (min-width: 64rem) {
    #pm-after-cta {
        padding: 1rem 1.25rem;
        padding-bottom: 1rem;
    }
}
#pm-after-cta .btn-solid-black-large {
    flex: 1 1 0%;
    width: auto;
}

/* ── 마스킹 필수검증 알림 팝업 (마스크 모달 z-index 9000 위로) ── */
.pm-alert-overlay {
    position: fixed;
    inset: 0;
    z-index: 9100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 1.25rem;
}
.pm-alert-box {
    width: min(20rem, 100%);
    background: var(--surface-white);
    border-radius: 0.5rem;
    padding: 0 20px 16px;
    display: flex;
    flex-direction: column;
}
.pm-alert-msg {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--text-default);
    text-align: center;
    white-space: pre-line;
    padding: 40px 0;
}
.pm-alert-ok {
    width: 100%;
    font-size: 15px;
    font-weight: 600;
    height: 42px;
}

/* ka.join.common.css 의 버튼 클래스를 #pm-overlay 로 스코프 복제 — join 디자인시스템 미로드 페이지(마이페이지 등)에서도 단독 동작 */
#pm-overlay .btn-solid-black-large {
    display: flex;
    height: 3.25rem;
    padding: 0 1rem;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    width: 100%;
    border-radius: 0.375rem;
    background: var(--surface-default);
    color: var(--text-white);
    border: none;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.008rem;
    line-height: 1.5rem;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
}
#pm-overlay .btn-solid-black-large:hover:not(:disabled):not(.disabled) {
    background: var(--surface-gray-darker);
    color: #fff;
}

#pm-overlay .btn-solid-black-small {
    display: flex;
    height: 42px;
    padding: 0 1rem;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    width: 100%;
    border-radius: 0.375rem;
    background: var(--surface-default);
    color: var(--text-white);
    border: none;
    letter-spacing: -0.008rem;
    line-height: 1.5rem;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
}
#pm-overlay .btn-solid-black-small:hover:not(:disabled):not(.disabled) {
    background: var(--surface-gray-darker);
    color: #fff;
}

#pm-overlay .btn-solid-cancel-large {
    flex: 1;
    height: 3.25rem;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    border-radius: 0.375rem;
    background: var(--surface-gray-light);
    border: none;
    color: var(--text-gray-darker);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5rem;
    letter-spacing: -0.008rem;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
}

#pm-overlay .btn-solid-cancel-large:hover {
    background: var(--surface-gray);
}

#pm-overlay .btn-outlined-secondary-medium2 {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    height: 2.5rem;
    padding: 0 1rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-gray-dark2);
    background: var(--surface-white);
    color: var(--text-default);
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.008rem;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: border-color 0.15s;
    text-decoration: none;
}
#pm-overlay .btn-outlined-secondary-medium2:hover {
    border-color: var(--border-gray-dark);
}
#pm-overlay .btn-solid-white-medium2 {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    height: 2.5rem;
    padding: 0 1rem;
    border-radius: 0.375rem;
    border: none;
    background: var(--surface-white);
    color: var(--text-default);
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.008rem;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s;
    text-decoration: none;
}
#pm-overlay .btn-solid-white-medium2:hover {
    background: var(--surface-gray-lighter1);
}
#pm-overlay .btn-solid-primary-medium2 {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    height: 2.5rem;
    padding: 0 1rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-primary);
    background: var(--surface-primary);
    color: var(--text-white);
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.008rem;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
}
#pm-overlay .btn-solid-primary-medium2:hover {
    background: linear-gradient(rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.06)), var(--surface-primary);
}
