/* 火币风格的登录注册界面样式 */

/* 高优先级规则 - 确保宽度设置不被覆盖 */
body .auth-container,
html .auth-container,
.auth-container {
    max-width: 380px !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: visible;
    width: 100%;
    max-width: 380px !important; /* 添加!important提高优先级 */
    position: relative;
    height: auto;
    min-height: auto;
}

.auth-header {
    background: linear-gradient(135deg, #f0b90b 0%, #f8d12f 100%);
    padding: 30px 40px;
    text-align: center;
    color: #1a1a1a;
}

.auth-header h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
}

.auth-header p {
    font-size: 14px;
    opacity: 0.8;
}

.auth-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.auth-tab {
    flex: 1;
    padding: 16px;
    text-align: center;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.auth-tab.active {
    color: #f0b90b;
    background: #ffffff;
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #f0b90b;
}

.auth-form {
    padding: 40px;
}

.form-group {
    margin-bottom: 24px;
    position: relative;
}

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

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #ffffff;
}

.form-input:focus {
    outline: none;
    border-color: #f0b90b;
    box-shadow: 0 0 0 3px rgba(240, 185, 11, 0.1);
}

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

.input-group {
    position: relative;
}

.input-addon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
}

.captcha-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.captcha-input {
    flex: 1;
}

.captcha-image {
    height: 50px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.captcha-image:hover {
    border-color: #f0b90b;
}

.verification-group {
    display: flex;
    gap: 12px;
}

.verification-input {
    flex: 1;
}

.send-code-btn {
    padding: 14px 20px;
    background: #f0b90b;
    color: #1a1a1a;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

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

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

.auth-button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #f0b90b 0%, #f8d12f 100%);
    color: #1a1a1a;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.auth-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(240, 185, 11, 0.3);
}

.auth-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.auth-links {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e9ecef;
}

.auth-link {
    color: #f0b90b;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin: 0 12px;
    transition: color 0.3s ease;
}

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

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 24px;
}

.checkbox-input {
    margin-top: 2px;
}

.checkbox-label {
    font-size: 14px;
    color: #6c757d;
    line-height: 1.4;
}

.checkbox-label a {
    color: #f0b90b;
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

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

.success-message {
    color: #28a745;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.password-strength {
    margin-top: 8px;
    font-size: 12px;
}

.strength-bar {
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    margin: 4px 0;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-weak .strength-fill {
    width: 33%;
    background: #dc3545;
}

.strength-medium .strength-fill {
    width: 66%;
    background: #ffc107;
}

.strength-strong .strength-fill {
    width: 100%;
    background: #28a745;
}

/* 响应式设计 */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .auth-container {
        max-width: 100%;
    }
    
    .auth-header {
        padding: 24px 20px;
    }
    
    .auth-header h1 {
        font-size: 24px;
    }
    
    .auth-form {
        padding: 24px 20px;
    }
    
    .verification-group {
        flex-direction: column;
    }
    
    .send-code-btn {
        width: 100%;
    }
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* 提示消息样式 */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid transparent;
}

.alert-success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

/* 隐藏/显示密码图标 */
.password-toggle {
    cursor: pointer;
    color: #6c757d;
    transition: color 0.3s ease;
}

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

/* 响应式优化 */
@media (min-width: 768px) {
    .auth-container {
        max-width: 400px; /* 平板端稍微宽一点 */
    }
    
    .auth-header {
        padding: 30px 40px; /* 适中的头部内边距 */
    }
    
    .auth-header h1 {
        font-size: 28px; /* 适中的标题大小 */
    }
    
    .auth-form {
        padding: 40px; /* 适中的表单内边距 */
    }
    
    .send-code-btn {
        padding: 14px 20px; /* 适中的按钮内边距 */
        min-width: 120px;
    }
    
    .auth-button {
        padding: 16px; /* 适中的按钮高度 */
        font-size: 16px;
    }
}

@media (min-width: 1024px) {
    .auth-container {
        max-width: 420px; /* 桌面端适中的宽度 */
    }
    
    .auth-form {
        padding: 45px; /* 适中的表单内边距 */
    }
    
    .form-group {
        margin-bottom: 24px; /* 适中的表单项间距 */
    }
    
    .form-input {
        padding: 14px 16px; /* 适中的输入框内边距 */
        font-size: 16px;
    }
}

/* 移动端优化 */
@media (max-width: 767px) {
    .auth-container {
        max-width: 100%;
        margin: 10px;
        border-radius: 8px;
    }
    
    .auth-header {
        padding: 25px 30px;
    }
    
    .auth-header h1 {
        font-size: 24px;
    }
    
    .auth-form {
        padding: 30px 25px;
    }
    
    .captcha-group,
    .verification-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .captcha-image {
        width: 100%;
        height: 45px;
    }
    
    .send-code-btn {
        width: 100%;
        padding: 12px;
    }
}

/* 只隐藏注册页面的图形验证码 */
.auth-tab[data-tab="register"] ~ .auth-content .captcha-group,
.auth-tab[data-tab="register"] ~ .auth-content #registerVcode,
.auth-tab[data-tab="register"] ~ .auth-content .captcha-image,
.auth-tab[data-tab="register"] ~ .auth-content [id*="captcha"] {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* 只隐藏注册页面验证码的标签 */
.auth-tab[data-tab="register"] ~ .auth-content label[for="registerVcode"] {
    display: none !important;
}
