/* 认证页面样式 */
.auth-body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px 0;
    overflow-y: auto;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    box-sizing: border-box;
    margin: 0 auto;
    min-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.auth-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: calc(100vh - 40px);
}

.auth-header {
    margin-bottom: 30px;
}

.auth-header h1 {
    color: #333;
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.auth-header p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

.auth-form {
    text-align: left;
    flex: 1;
    overflow-y: auto;
    padding-right: 5px; /* 为滚动条留出空间 */
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

.error-message {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.error-message.show {
    display: block;
}

.field-hint {
    color: #999;
    font-size: 12px;
    margin-top: 4px;
}

.password-requirements {
    margin-top: 8px;
}

.requirement {
    font-size: 12px;
    margin: 2px 0;
    color: #999;
    transition: color 0.3s ease;
}

.requirement.valid {
    color: #27ae60;
}

.requirement.invalid {
    color: #e74c3c;
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.checkbox-label {
    display: inline-flex !important;
    align-items: center !important;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    line-height: 1.4;
    user-select: none;
    position: relative;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    display: inline-block !important;
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s ease;
    background-color: white;
    vertical-align: middle;
}

.checkbox-label:hover .checkmark {
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"]:checked ~ .checkmark {
    background-color: #667eea;
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"]:checked ~ .checkmark::after {
    content: '';
    position: absolute;
    display: block;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.terms-link {
    color: #667eea;
    text-decoration: none;
}

.terms-link:hover {
    text-decoration: underline;
}

.auth-button {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.auth-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.auth-button:active {
    transform: translateY(0);
}

.auth-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.button-loading {
    display: none;
}

.auth-button.loading .button-text {
    display: none;
}

.auth-button.loading .button-loading {
    display: inline;
}

.auth-links {
    margin-top: 20px;
    text-align: center;
}

.auth-link {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    margin: 0 8px;
    transition: color 0.3s ease;
}

.auth-link:hover {
    color: #5a6fd8;
    text-decoration: underline;
}

.auth-link-separator {
    color: #999;
    margin: 0 8px;
    font-size: 14px;
}

.auth-footer {
    text-align: center;
    margin-top: 30px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
}

/* 模态框样式 */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none; /* 默认隐藏 */
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 0;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

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

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.close {
    color: #999;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 20px 24px 24px;
    color: #666;
    line-height: 1.5;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .auth-body {
        padding: 10px 0;
        align-items: flex-start;
    }
    
    .auth-container {
        padding: 10px;
        min-height: calc(100vh - 20px);
    }
    
    .auth-card {
        padding: 20px 15px;
        max-height: calc(100vh - 20px);
        border-radius: 8px;
    }
    
    .auth-header h1 {
        font-size: 20px;
    }
    
    .auth-header {
        margin-bottom: 20px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .password-requirements {
        font-size: 11px;
    }
    
    .requirement {
        margin: 1px 0;
    }
}

/* 超小屏幕优化 */
@media (max-width: 360px) {
    .auth-card {
        padding: 15px 10px;
        margin: 5px;
    }
    
    .auth-header h1 {
        font-size: 18px;
    }
    
    .form-group input {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .auth-button {
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* 成功/错误状态 */
.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
    font-size: 14px;
}

.error-message.global {
    background-color: #f8d7da;
    color: #721c24;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
    font-size: 14px;
}

/* 滚动条样式优化 */
.auth-form::-webkit-scrollbar {
    width: 6px;
}

.auth-form::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.auth-form::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.auth-form::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 确保内容可以滚动 */
.auth-card {
    scroll-behavior: smooth;
}

/* 加载动画 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.button-loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

/* 邮箱输入组样式 */
.email-input-group {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.email-input-group input {
    flex: 1;
}

.send-code-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 100px;
}

.send-code-btn:hover:not(:disabled) {
    background: #0056b3;
    transform: translateY(-1px);
}

.send-code-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.send-code-btn.loading {
    background: #6c757d;
    cursor: not-allowed;
}

.send-code-btn .btn-loading {
    display: none;
}

.send-code-btn.loading .btn-text {
    display: none;
}

.send-code-btn.loading .btn-loading {
    display: inline;
}

/* 验证码相关样式 */
.verification-hint {
    margin-top: 8px;
    font-size: 14px;
    color: #666;
}

.verification-hint a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.verification-hint a:hover {
    text-decoration: underline;
}

#codeTimer {
    color: #28a745;
    font-weight: 500;
}

#countdown {
    color: #dc3545;
    font-weight: bold;
}

/* 验证码输入框样式 */
#verification_code {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 2px;
    font-family: 'Courier New', monospace;
}

/* 响应式设计 - 验证码 */
@media (max-width: 768px) {
    .email-input-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .send-code-btn {
        width: 100%;
        min-width: auto;
    }
}


/* 验证码输入区域样式 */
.verification-section {
    margin-top: 30px;
    padding: 25px;
    background-color: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.verification-header {
    text-align: center;
    margin-bottom: 25px;
}

.verification-header .success-icon {
    font-size: 40px;
    margin-bottom: 15px;
    color: #667eea;
}

.verification-header h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 20px;
}

.verification-header p {
    color: #666;
    margin-bottom: 0;
    line-height: 1.5;
}

.verification-code-section {
    text-align: center;
    padding: 30px 20px;
}

.verification-code-section .success-icon {
    font-size: 48px;
    margin-bottom: 20px;
    color: #667eea;
}

.verification-code-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 24px;
}

.verification-code-section p {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
}

.verification-hint {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    text-align: left;
}

.verification-hint p {
    margin: 0 0 10px 0;
    color: #856404;
    font-weight: 500;
}

.verification-hint ul {
    margin: 10px 0;
    padding-left: 20px;
    color: #856404;
}

.verification-hint li {
    margin-bottom: 5px;
}

/* 验证码输入框特殊样式 */
#verificationCode {
    text-align: center;
    font-size: 24px;
    letter-spacing: 0.5em;
    font-weight: bold;
}

/* 次要按钮样式 */
.auth-button.secondary {
    background-color: #6c757d;
    border-color: #6c757d;
}

.auth-button.secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

.auth-button.secondary:focus {
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.25);
}


.success-steps {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
}

.success-steps h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 16px;
}

.success-steps ol {
    margin: 0;
    padding-left: 20px;
    color: #666;
    line-height: 1.8;
}

.success-steps li {
    margin-bottom: 8px;
}

.success-hint {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    text-align: left;
}

.success-hint p {
    margin: 0 0 10px 0;
    color: #856404;
    font-weight: 500;
}

.success-hint ul {
    margin: 10px 0;
    padding-left: 20px;
    color: #856404;
}

.success-hint li {
    margin-bottom: 5px;
}


/* 模态框动画 */
.modal {
    animation: fadeIn 0.3s ease;
}

.modal-content {
    animation: slideIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* 重置密码页面特殊样式 */
.verification-input-group {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.verification-input-group input {
    flex: 1;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 2px;
    font-family: 'Courier New', monospace;
}

.resend-button {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 120px;
}

.resend-button:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-1px);
}

.resend-button:disabled {
    background: #adb5bd;
    cursor: not-allowed;
    transform: none;
}

/* 密码强度指示器 */
.password-strength {
    margin-top: 8px;
    font-size: 12px;
}

.strength-weak {
    color: #dc3545;
}

.strength-medium {
    color: #ffc107;
}

.strength-strong {
    color: #28a745;
}

/* 只读输入框样式 */
.form-group input[readonly] {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

/* 响应式设计 - 重置密码页面 */
@media (max-width: 768px) {
    .verification-input-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .resend-button {
        width: 100%;
        min-width: auto;
    }
    
    .verification-input-group input {
        font-size: 16px;
        letter-spacing: 1px;
    }
}

