/* 登录注册页面专用CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Poppins', 'Noto Sans SC', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    width: 100%;
}

/* 认证容器 - 确保完全居中 */
.auth-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-height: calc(100vh - 200px);
    width: 100%;
    position: relative;
}

/* 认证卡片 - 修复居中和宽度问题 */
.auth-card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 450px;
    border: 1px solid var(--border-color);
    margin: 0 auto;
    position: relative;
    animation: slideUp 0.5s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.auth-logo {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.auth-title h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.auth-title p {
    color: var(--text-light);
    font-size: 1rem;
}

.auth-form {
    margin-bottom: 25px;
    width: 100%;
}

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

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.95rem;
}

.form-group label i {
    color: var(--primary-color);
    width: 20px;
}

.form-group input {
    width: 100%;
    padding: 14px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

/* 验证码输入容器 */
.input-with-button {
    display: flex;
    gap: 10px;
    width: 100%;
}

.input-with-button input {
    flex: 1;
    min-width: 0;
}

.send-code-btn {
    padding: 14px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    min-width: 120px;
    flex-shrink: 0;
    font-size: 0.95rem;
}

.send-code-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.send-code-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 记住我选项 */
.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-color);
    font-size: 0.95rem;
}

.remember-me input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
}

.forgot-password:hover {
    text-decoration: underline;
}

/* 密码输入框 */
.password-input {
    position: relative;
    width: 100%;
}

.password-input input {
    padding-right: 45px;
    width: 100%;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 5px;
    z-index: 2;
}

.toggle-password:hover {
    color: var(--primary-color);
}

/* 表单提示和错误信息 */
.form-hint {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 5px;
    line-height: 1.4;
}

.form-error {
    font-size: 0.85rem;
    color: #f44336;
    margin-top: 5px;
    display: none;
    line-height: 1.4;
}

/* 主要认证按钮 */
.auth-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.auth-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.2);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-loading {
    display: none;
}

/* 社交登录 */
.divider {
    display: flex;
    align-items: center;
    margin: 25px 0;
    color: var(--text-light);
    font-size: 0.9rem;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider span {
    padding: 0 15px;
}

.social-login {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.social-btn:hover {
    background: var(--bg-color);
    transform: translateY(-1px);
}

.social-btn.qq {
    border-color: #12b7f5;
    color: #12b7f5;
}

.social-btn.qq:hover {
    background: rgba(18, 183, 245, 0.1);
}

.social-btn.weixin {
    border-color: #07c160;
    color: #07c160;
}

.social-btn.weixin:hover {
    background: rgba(7, 193, 96, 0.1);
}

/* 认证页脚 */
.auth-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
}

.auth-footer p {
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.4;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* 成功模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.success-modal {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 40px;
    max-width: 450px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    margin: 0 auto;
}

.success-icon {
    font-size: 4rem;
    color: #4caf50;
    margin-bottom: 20px;
}

.success-modal h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--text-color);
}

.success-message {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 25px;
    line-height: 1.4;
}

.success-info {
    background: rgba(67, 97, 238, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 30px;
    text-align: left;
}

.success-info p {
    margin-bottom: 10px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.4;
}

.success-info p:last-child {
    margin-bottom: 0;
}

.success-info i {
    color: var(--primary-color);
    width: 20px;
    flex-shrink: 0;
}

.success-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.success-actions .auth-btn {
    flex: 1;
    min-width: 150px;
    text-decoration: none;
    margin-top: 0;
}

.login-btn {
    background: var(--gradient-primary);
}

.home-btn {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.home-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* 消息提示样式 */
.message-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--card-bg);
    border-radius: 8px;
    padding: 15px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 3000;
    animation: toastSlideUp 0.3s ease;
    max-width: 400px;
    width: calc(100% - 40px);
}

.message-toast.success {
    border-left: 4px solid #4caf50;
}

.message-toast.error {
    border-left: 4px solid #f44336;
}

.message-toast i {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.message-toast.success i {
    color: #4caf50;
}

.message-toast.error i {
    color: #f44336;
}

.message-toast span {
    flex: 1;
    font-weight: 500;
    line-height: 1.4;
}

.message-close {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    flex-shrink: 0;
}

/* 固定页脚位置 */
.main-footer.auth-footer {
    flex-shrink: 0;
    margin-top: auto;
    width: 100%;
}

/* 确保header正确显示 */
.main-header {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    
    .auth-container {
        padding: 15px;
        min-height: calc(100vh - 150px);
        width: 100%;
    }
    
    .auth-card {
        padding: 25px 20px;
        max-width: 100%;
        width: 100%;
        margin: 0 auto;
        border-radius: 12px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }
    
    .auth-title h2 {
        font-size: 1.5rem;
    }
    
    .auth-logo {
        font-size: 2.5rem;
    }
    
    .login-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .input-with-button {
        flex-direction: column;
        gap: 10px;
    }
    
    .send-code-btn {
        width: 100%;
        min-width: unset;
        padding: 14px;
    }
    
    .form-group input {
        padding: 16px 15px;
        font-size: 16px;
    }
    
    .auth-btn {
        padding: 16px;
        font-size: 1.1rem;
    }
    
    .success-modal {
        padding: 30px 20px;
        max-width: 100%;
        width: 100%;
        margin: 0 auto;
    }
    
    .success-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .success-actions .auth-btn {
        width: 100%;
        min-width: unset;
    }
    
    .message-toast {
        width: calc(100% - 40px);
        max-width: 100%;
        padding: 15px 20px;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 10px;
        min-height: calc(100vh - 140px);
    }
    
    .auth-card {
        padding: 20px 15px;
        border-radius: 10px;
        margin: 0 auto;
    }
    
    .auth-title h2 {
        font-size: 1.4rem;
    }
    
    .auth-title p {
        font-size: 0.9rem;
    }
    
    .auth-logo {
        font-size: 2.2rem;
    }
    
    .form-group input {
        padding: 14px 12px;
    }
    
    .auth-btn {
        padding: 14px;
        font-size: 1rem;
    }
    
    .success-modal {
        padding: 25px 15px;
        width: 100%;
        margin: 0 auto;
    }
    
    .success-modal h2 {
        font-size: 1.4rem;
    }
    
    .success-icon {
        font-size: 3rem;
    }
}

/* 平板设备 */
@media (min-width: 769px) and (max-width: 1024px) {
    .auth-card {
        max-width: 450px;
        padding: 35px;
        margin: 0 auto;
    }
}

/* 大屏电脑 */
@media (min-width: 1200px) {
    .auth-card {
        max-width: 500px;
        padding: 45px;
        margin: 0 auto;
    }
    
    .auth-title h2 {
        font-size: 2rem;
    }
    
    .auth-logo {
        font-size: 3.5rem;
    }
}

/* 防止iOS缩放 */
@media screen and (max-width: 768px) {
    input, textarea, select {
        font-size: 16px !important;
    }
}

@keyframes toastSlideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 30px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}