/**
 * TOTP 로그인 모달 - CSS
 * 
 * [3D] 계층 : frontend > login > totp_modal_styles
 * 
 * @package     YUMEDI
 * @subpackage  Frontend/Login/TOTP/Styles
 * @author      YUMEDI Dev Team
 * @version     1.0.0 (Phase 3-2)
 * @since       2025-01-09
 */

/* ═══════════════════════════════════════════════════════════════════════════════════════════════ */
/* 1️⃣ 오버레이 (배경) */
/* ═══════════════════════════════════════════════════════════════════════════════════════════════ */

.ym-totp-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    backdrop-filter: blur(2px);
    animation: ym-totp-fadeIn 0.3s ease-in;
}

@keyframes ym-totp-fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════════════════════ */
/* 2️⃣ 모달 컨테이너 */
/* ═══════════════════════════════════════════════════════════════════════════════════════════════ */

.ym-totp-modal {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 420px;
    width: 90%;
    animation: ym-totp-slideUp 0.3s ease-out;
    overflow: hidden;
}

@keyframes ym-totp-slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════════════════════ */
/* 3️⃣ 모달 헤더 */
/* ═══════════════════════════════════════════════════════════════════════════════════════════════ */

.ym-totp-modal-header {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: #fff;
    padding: 20px;
    border-bottom: 1px solid #ddd;
}

.ym-totp-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════════════════════════ */
/* 4️⃣ 모달 바디 */
/* ═══════════════════════════════════════════════════════════════════════════════════════════════ */

.ym-totp-modal-body {
    padding: 30px 20px;
    min-height: 150px;
}

.ym-totp-description {
    font-size: 14px;
    color: #555;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════════════════════════════════════ */
/* 5️⃣ 담당자 선택 리스트 */
/* ═══════════════════════════════════════════════════════════════════════════════════════════════ */

.ym-totp-staff-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ym-totp-staff-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 2px solid #e5e5e5;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ym-totp-staff-item:hover {
    border-color: #0073aa;
    background-color: #f0f7ff;
}

.ym-totp-staff-item input[type="radio"] {
    cursor: pointer;
    accent-color: #0073aa;
}

.ym-totp-staff-item input[type="radio"]:checked {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.ym-totp-staff-name {
    font-weight: 600;
    color: #1d2327;
    font-size: 15px;
}

.ym-totp-staff-phone {
    font-size: 13px;
    color: #999;
    margin-left: auto;
}

/* ═══════════════════════════════════════════════════════════════════════════════════════════════ */
/* 6️⃣ 코드 입력 필드 */
/* ═══════════════════════════════════════════════════════════════════════════════════════════════ */

.ym-totp-code-input-group {
    margin: 20px 0;
}

.ym-totp-code-input {
    width: 100%;
    padding: 15px;
    font-size: 24px;
    letter-spacing: 8px;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    transition: border-color 0.3s ease;
}

.ym-totp-code-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.ym-totp-code-input::placeholder {
    color: #ccc;
    letter-spacing: normal;
}

/* ═══════════════════════════════════════════════════════════════════════════════════════════════ */
/* 7️⃣ 타이머 */
/* ═══════════════════════════════════════════════════════════════════════════════════════════════ */

.ym-totp-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background-color: #fff8f0;
    border-left: 4px solid #ff9800;
    border-radius: 4px;
    margin: 15px 0;
}

.ym-totp-timer-icon {
    font-size: 18px;
}

.ym-totp-timer-text {
    font-size: 14px;
    color: #555;
}

.ym-totp-timer-text strong {
    color: #ff9800;
    font-weight: 700;
    font-size: 16px;
}

/* ═══════════════════════════════════════════════════════════════════════════════════════════════ */
/* 8️⃣ 시도 횟수 정보 */
/* ═══════════════════════════════════════════════════════════════════════════════════════════════ */

.ym-totp-attempt-info {
    font-size: 12px;
    color: #999;
    margin: 10px 0 0 0;
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════════════════════════════════════════ */
/* 9️⃣ 모달 푸터 & 버튼 */
/* ═══════════════════════════════════════════════════════════════════════════════════════════════ */

.ym-totp-modal-footer {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #e5e5e5;
    background-color: #f9f9f9;
}

.ym-totp-btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ym-totp-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.2);
}

.ym-totp-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Primary 버튼 */
.ym-totp-btn-primary {
    background-color: #0073aa;
    color: #fff;
}

.ym-totp-btn-primary:hover:not(:disabled) {
    background-color: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.ym-totp-btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

/* Secondary 버튼 */
.ym-totp-btn-secondary {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
}

.ym-totp-btn-secondary:hover:not(:disabled) {
    background-color: #e5e5e5;
    border-color: #999;
}

/* Cancel 버튼 */
.ym-totp-btn-cancel {
    background-color: #f9f9f9;
    color: #666;
    border: 1px solid #ddd;
}

.ym-totp-btn-cancel:hover:not(:disabled) {
    background-color: #f0f0f0;
    border-color: #999;
}

/* ═══════════════════════════════════════════════════════════════════════════════════════════════ */
/* 🔟 반응형 설계 */
/* ═══════════════════════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
    .ym-totp-modal {
        max-width: 100%;
        width: 95%;
        border-radius: 12px;
    }
    
    .ym-totp-modal-header h3 {
        font-size: 18px;
    }
    
    .ym-totp-modal-body {
        padding: 20px 15px;
    }
    
    .ym-totp-btn {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .ym-totp-code-input {
        font-size: 20px;
        letter-spacing: 6px;
        padding: 12px;
    }
    
    .ym-totp-staff-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .ym-totp-staff-phone {
        margin-left: 0;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════════════════════ */
/* 1️⃣1️⃣ 접근성 (A11y) */
/* ═══════════════════════════════════════════════════════════════════════════════════════════════ */

.ym-totp-btn:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.ym-totp-code-input:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* 검색 엔진에 숨김 */
@media (prefers-reduced-motion: reduce) {
    .ym-totp-overlay,
    .ym-totp-modal {
        animation: none;
    }
}
