/* Login Page Styles */

.login-page {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.login-container {
    width: 100%;
    max-width: 520px;
}

.login-box {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    padding: 48px 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 32px;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.login-header p {
    font-size: 16px;
    color: #666;
}

/* Account Type Tabs */
.account-type-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
}

.account-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 20px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.account-tab i {
    font-size: 18px;
}

.account-tab:hover {
    background: #f0f0f0;
    border-color: #ddd;
}

.account-tab.active {
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.1) 0%, rgba(0, 180, 216, 0.1) 100%);
    border-color: var(--primary, #00D4AA);
    color: var(--primary, #00D4AA);
}

.account-tab.active i {
    color: var(--primary, #00D4AA);
}

/* Form Styles */
.login-form {
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper > i {
    position: absolute;
    left: 18px;
    color: #aaa;
    font-size: 18px;
    transition: color 0.2s;
}

.toggle-password i {
    position: static;
    left: auto;
    font-size: 16px;
}

.input-wrapper input {
    width: 100%;
    padding: 16px 18px 16px 48px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s;
    background: #fafafa;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary, #00D4AA);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.input-wrapper input:focus + i,
.input-wrapper:focus-within i:first-child {
    color: var(--primary, #00D4AA);
}

.input-wrapper input::placeholder {
    color: #aaa;
}

/* Field Hint */
.field-hint {
    margin: 8px 0 0;
    font-size: 12px;
    color: #888;
    line-height: 1.4;
}

/* Admin Only Field */
.admin-only-field {
    padding: 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    margin-bottom: 20px;
}

.admin-only-field label {
    color: #6366f1;
}

.admin-only-field .input-wrapper i:first-child {
    color: #6366f1;
}

.admin-only-field .input-wrapper input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: #666;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.checkbox-wrapper input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 4px;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.checkbox-wrapper input:checked + .checkmark {
    background: var(--primary, #00D4AA);
    border-color: var(--primary, #00D4AA);
}

.checkbox-wrapper input:checked + .checkmark::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 10px;
    color: #fff;
}

.label-text {
    font-size: 14px;
    color: #666;
}

/* Login Button */
.btn-login {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #00D4AA 0%, #00B4D8 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 212, 170, 0.3);
}

.btn-login:active {
    transform: translateY(0);
}

/* Login Links */
.login-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.login-links a {
    font-size: 15px;
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}

.login-links a:hover {
    color: var(--primary, #00D4AA);
}

.login-links .divider {
    color: #ddd;
    font-size: 12px;
}

/* Legacy User Section (하이호스트 회원 안내) */
.legacy-user-section {
    margin-top: 24px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(139, 92, 246, 0.06) 100%);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 12px;
    text-align: center;
}

.legacy-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 12px;
}

.legacy-badge i {
    font-size: 11px;
}

.legacy-user-text {
    font-size: 15px;
    color: #333;
    margin-bottom: 8px;
}

.legacy-user-text strong {
    color: #6366f1;
    font-weight: 700;
}

.legacy-user-hint {
    font-size: 13px;
    color: #666;
    margin-bottom: 14px;
    line-height: 1.6;
}

.legacy-user-hint strong {
    color: #6366f1;
    font-weight: 600;
}

.btn-find-email {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #fff;
    color: #555;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-find-email:hover {
    border-color: var(--primary, #00D4AA);
    color: var(--primary, #00D4AA);
}

.btn-find-email i {
    font-size: 13px;
}

/* Signup Promo */
.signup-promo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 24px;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.08) 0%, rgba(0, 180, 216, 0.08) 100%);
    border: 1px solid rgba(0, 212, 170, 0.2);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
}

.signup-promo:hover {
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.15) 0%, rgba(0, 180, 216, 0.15) 100%);
    border-color: rgba(0, 212, 170, 0.4);
    transform: translateY(-2px);
}

.signup-promo .promo-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.signup-promo .promo-content i {
    font-size: 24px;
    color: var(--primary, #00D4AA);
}

.signup-promo .promo-content p {
    font-size: 15px;
    color: #333;
    margin: 0;
}

.signup-promo .promo-content p strong {
    color: var(--primary, #00D4AA);
    font-weight: 600;
}

.signup-promo .promo-arrow {
    color: var(--primary, #00D4AA);
    font-size: 14px;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    transform: translateY(20px);
    transition: transform 0.3s;
    margin: 20px;
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    color: #666;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #eee;
    color: #333;
}

.modal-body {
    padding: 28px;
}

.modal-description {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    text-align: center;
    margin-bottom: 24px;
}

.modal-body .form-group {
    margin-bottom: 16px;
}

.btn-check-email {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #00D4AA 0%, #00B4D8 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 8px;
}

.btn-check-email:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 212, 170, 0.3);
}

.btn-check-email:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Email Result */
.email-result {
    text-align: center;
    padding: 24px;
    background: #f0fdf9;
    border-radius: 12px;
    margin-top: 20px;
}

.email-result .result-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #00D4AA 0%, #00B4D8 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.email-result .result-icon i {
    font-size: 24px;
    color: #fff;
}

.email-result .result-label {
    font-size: 13px;
    color: #888;
    margin-bottom: 8px;
}

.email-result .result-email {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 12px;
    word-break: break-all;
}

.email-result .result-hint {
    font-size: 13px;
    color: #00D4AA;
}

/* Error Message */
.error-message,
.form-error {
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
    font-size: 14px;
    text-align: center;
    margin-top: 16px;
}

.form-error {
    margin-bottom: 16px;
}

/* Button Loading State */
.btn-login .btn-loading,
.btn-verify-2fa .btn-loading {
    display: none;
}

.btn-login.loading .btn-text,
.btn-verify-2fa.loading .btn-text {
    display: none;
}

.btn-login.loading .btn-loading,
.btn-verify-2fa.loading .btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-login:disabled,
.btn-verify-2fa:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

/* Two Factor Modal */
.two-factor-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #00D4AA 0%, #00B4D8 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.two-factor-icon i {
    font-size: 36px;
    color: #fff;
}

#twoFactorModal .modal-description {
    margin-bottom: 28px;
}

#twoFactorModal .modal-description strong {
    color: var(--primary, #00D4AA);
    font-size: 15px;
}

.btn-verify-2fa {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #00D4AA 0%, #00B4D8 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 8px;
}

.btn-verify-2fa:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 212, 170, 0.3);
}

.two-factor-options {
    margin-top: 20px;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.btn-resend-code,
.btn-change-method {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 8px;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-resend-code:hover:not(:disabled),
.btn-change-method:hover:not(:disabled) {
    border-color: var(--primary, #00D4AA);
    color: var(--primary, #00D4AA);
}

.btn-resend-code:disabled,
.btn-change-method:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 인증 방법 선택 버튼 */
.method-select-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

.btn-method {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 20px 24px;
    background: #f8fafb;
    border: 2px solid #e5e8eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.btn-method:hover:not(:disabled) {
    border-color: var(--primary, #00D4AA);
    background: #f0fdf9;
}

.btn-method:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
}

.btn-method .method-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #00D4AA 0%, #00B4D8 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-method:disabled .method-icon {
    background: #ccc;
}

.btn-method .method-icon i {
    font-size: 20px;
    color: #fff;
}

.btn-method .method-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.btn-method .method-title {
    font-size: 16px;
    font-weight: 600;
    color: #191f28;
}

.btn-method:disabled .method-title {
    color: #999;
}

.btn-method .method-target {
    font-size: 14px;
    color: var(--primary, #00D4AA);
}

.btn-method:disabled .method-target {
    color: #999;
}

/* 인증 방법 안내 (버튼 내부) */
.btn-method .method-notice {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #8b95a1;
    font-weight: 400;
}

/* Verification Timer */
.verification-timer {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    font-weight: 600;
    color: #dc2626;
}

/* Responsive */
@media (max-width: 480px) {
    .login-box {
        padding: 32px 24px;
    }

    .login-header h1 {
        font-size: 24px;
    }

    .login-links {
        flex-wrap: wrap;
        gap: 8px;
    }
}
