/**
 * NanoNside - 로그인 페이지 스타일 v2.0
 * 이메일 기반 로그인 + Google OAuth + 레거시 지원
 */

/* ===== 로그인 페이지 레이아웃 ===== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9fafb;
    padding: 1rem;
}

.auth-card {
    background-color: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
}

/* ===== 로고 ===== */
.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f59e0b;
    text-decoration: none;
    display: inline-block;
}

.auth-logo-text:hover {
    color: #d97706;
}

/* ===== 타이틀 ===== */
.auth-title {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1.5rem;
}

/* ===== 에러 메시지 박스 ===== */
.error-message {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    color: #dc2626;
    font-size: 0.875rem;
    line-height: 1.5;
}

.error-message.hidden {
    display: none;
}

.error-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

/* 계정 잠금 상태 박스 */
.error-message.error-locked {
    background-color: #fef3c7;
    border-color: #fde68a;
    color: #92400e;
}

.error-message.error-locked .error-icon {
    color: #d97706;
}

.error-content {
    flex: 1;
}

.error-title {
    font-weight: 600;
    margin: 0 0 0.25rem 0;
}

.error-detail {
    margin: 0;
    font-size: 0.8125rem;
}

#lockRemainingTime {
    font-weight: 600;
    color: #b45309;
}

/* 하위 호환성 유지 */
.auth-error {
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    color: #991b1b;
    font-size: 0.875rem;
    line-height: 1.5;
}

.auth-error.hidden {
    display: none;
}

.auth-locked {
    background-color: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    color: #92400e;
    font-size: 0.875rem;
}

/* ===== 폼 그룹 ===== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.625rem 1rem;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.form-input:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
    outline: none;
}

.form-input::placeholder {
    color: #9ca3af;
}

.form-input.error {
    border-color: #ef4444;
}

.form-input.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* ===== 로그인 유지 & 비밀번호 찾기 영역 ===== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: #f59e0b;
    cursor: pointer;
}

.find-password-link {
    font-size: 0.875rem;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
}

.find-password-link:hover {
    color: #f59e0b;
    text-decoration: underline;
}

/* 하위 호환성 유지 */
.auth-remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.auth-remember input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: #f59e0b;
    cursor: pointer;
}

.auth-remember label {
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
}

/* ===== 버튼 ===== */
.btn-primary {
    background-color: #f59e0b;
    color: white;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 1rem;
}

.btn-primary:hover {
    background-color: #d97706;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary.w-full {
    width: 100%;
}

.btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 1rem;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary.w-full {
    width: 100%;
}

/* ===== 구분선 ===== */
.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: #e5e7eb;
}

.divider span {
    padding: 0 1rem;
    color: #9ca3af;
    font-size: 0.875rem;
}

/* ===== Google 로그인 버튼 ===== */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background-color: #ffffff;
    border: 1px solid #dadce0;
    border-radius: 0.5rem;
    color: #3c4043;
    font-weight: 500;
    font-size: 1rem;
    text-decoration: none;
    transition: background-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.btn-google:hover {
    background-color: #f8fafc;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-google.w-full {
    width: 100%;
}

.google-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

/* ===== 레거시 로그인 링크 ===== */
.legacy-login-notice {
    text-align: center;
    margin-top: 1rem;
}

.legacy-login-notice a {
    font-size: 0.75rem;
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.2s;
}

.legacy-login-notice a:hover {
    color: #6b7280;
    text-decoration: underline;
}

/* ===== 회원가입 링크 ===== */
.register-link {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.register-link a {
    color: #f59e0b;
    font-weight: 500;
    text-decoration: none;
    margin-left: 0.25rem;
    transition: color 0.2s;
}

.register-link a:hover {
    color: #d97706;
    text-decoration: underline;
}

/* ===== 하단 링크 ===== */
.auth-links {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.auth-links a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
}

.auth-links a:hover {
    color: #f59e0b;
    text-decoration: underline;
}

.auth-links-divider {
    margin: 0 0.5rem;
    color: #d1d5db;
}

/* ===== 레거시 로그인 모달 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}

.modal-overlay.hidden {
    display: none;
}

.modal-content {
    background-color: white;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 1.5rem;
    width: 100%;
    max-width: 400px;
    animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #1f2937;
}

.modal-close svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* 경고 메시지 */
.warning-text {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background-color: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    color: #92400e;
    font-size: 0.8125rem;
    line-height: 1.5;
}

.warning-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
    color: #d97706;
}

.modal-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.modal-hint {
    font-size: 0.75rem;
    color: #6b7280;
    text-align: center;
    margin: 0;
}

/* ===== 반응형 ===== */
@media (max-width: 480px) {
    .auth-container {
        padding: 0.5rem;
    }

    .auth-card {
        padding: 1.5rem;
        border-radius: 0.75rem;
    }

    .auth-logo-text {
        font-size: 1.25rem;
    }

    .auth-title {
        font-size: 1.125rem;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .modal-content {
        padding: 1.25rem;
        border-radius: 0.75rem;
    }
}
