/* ──────────────────────────────
 * 인증 모달
 * ────────────────────────────── */
.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, .55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.auth-modal.open {
    display: flex;
}

.auth-dialog {
    width: 100%;
    max-width: 360px;
    background: #fff;
    border-radius: 12px;
    position: relative;
    padding: 20px 20px 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
    max-height: 90vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.auth-close {
    position: absolute;
    top: 10px;
    right: 10px;
    border: 0;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}

.auth-title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
}

.auth-desc {
    margin: 0 0 12px;
    font-size: 12px;
    color: #777;
}

.auth-hr {
    border: 0;
    border-top: 1px solid #e5e7eb;
    margin: 10px 0 14px;
}

.auth-label {
    display: block;
    font-size: 13px;
    margin: 8px 0 6px;
}

.auth-input,
.auth-select {
    height: 38px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0 10px;
    width: 100%;
    box-sizing: border-box;
    font-size: 16px;
}

.auth-phone {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr auto;
    gap: 8px;
    align-items: center;
}

/* 인증코드 영역 */
.auth-code {
    grid-column: 1 / -1;
    width: 100%;
}

.auth-code .auth-input {
    width: 100%;
    box-sizing: border-box;
}

.auth-dash {
    color: #aaa;
}

.auth-input:focus {
    border-color: #eee8ff;
    box-shadow: 0 0 0 3px #eee8ff;
    outline: none;
}

.auth-btn {
    grid-column: 1/-1;
    height: 38px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    background: #c9b7fb;
    color: #1f1f1f;
    font-weight: bold;
    margin-top: 4px;
}

/* ──────────────────────────────
 * 개인정보 처리방침 동의 영역
 * ────────────────────────────── */
.auth-consent {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 4px;
    font-size: 12px;
    flex-wrap: nowrap;
}

.auth-consent-left {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #555;
}

.auth-checkbox {
    width: 16px;
    height: 16px;
    accent-color: #c9b7fb;
}

.auth-policy-link {
    text-decoration: underline;
    color: #666;
}

.auth-policy-link:hover,
.auth-policy-link:focus {
    color: #333;
}

/* ──────────────────────────────
 * 반응형: 아주 좁은 화면 (≤360px)
 * - 하이픈 숨김, 3등분 그리드
 * - 터치 타겟/폰트 약간 확대
 * ────────────────────────────── */
@media (max-width: 360px) {
    .auth-dialog {
        padding: 16px 16px 20px;
        border-radius: 10px;
        max-width: 320px;
    }

    .auth-title {
        font-size: 15px;
    }

    .auth-desc {
        font-size: 11px;
    }

    .auth-phone {
        grid-template-columns: 1fr 1fr 1fr;
        /* 하이픈 제거 대비 */
        gap: 6px;
    }

    .auth-dash {
        display: none;
    }

    .auth-input {
        height: 40px;
        text-align: center;
        font-size: 14px;
    }

    .auth-btn {
        height: 42px;
        font-size: 14px;
    }

    .auth-consent {
        flex-wrap: wrap;
        row-gap: 4px;
    }
}

/* ──────────────────────────────
 * 반응형: 작은 화면 (≤400px)
 * - 여백/간격 미세 조정
 * ────────────────────────────── */
@media (max-width: 400px) {
    .auth-modal {
        padding: 16px;
    }

    .auth-phone {
        gap: 6px;
    }
}

/* ──────────────────────────────
 * 반응형: 세로 공간이 좁은 화면 (max-height: 500px)
 * - 모달을 위쪽 정렬 + 상단 여백
 * ────────────────────────────── */
@media (max-height: 500px) {
    .auth-modal {
        align-items: flex-start;
    }

    .auth-dialog {
        margin-top: 10px;  /* env 제거 */
        max-height: 92vh;
    }
}

/* ──────────────────────────────
 * 반응형: 태블릿 이상 (≥768px)
 * - 다이얼로그 너비 살짝 확장
 * - 입력 폰트/간격 소폭 확대
 * ────────────────────────────── */
@media (min-width: 768px) {
    .auth-dialog {
        max-width: 420px;
        padding: 24px 24px 28px;
    }

    .auth-input,
    .auth-select {
        height: 40px;
        font-size: 14px;
    }

    .auth-btn {
        height: 42px;
        font-size: 14px;
    }
}
