/* login.css - 登录页面样式 */

/* 登录页面主体 */
.login-main {
    padding-top: 100px;
    /* 为固定头部留出空间 */
    min-height: 100vh;
}

.login-bg {
    background: linear-gradient(135deg, #fdf6f6 0%, #f8f0f0 100%);
    min-height: calc(100vh - 100px);
    display: flex;
    align-items: center;
    padding: 40px 0;
}

.login-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    min-height: 600px;
}

/* 左侧装饰区域 */
.login-decoration {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.decoration-content {
    text-align: center;
    max-width: 400px;
}

.site-branding {
    margin-bottom: 40px;
}

.brand-logo {
    margin-bottom: 20px;
}

.brand-logo img {
    max-width: 120px;
    height: auto;
}

.brand-title {
    font-size: 28px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 10px;
    line-height: 1.4;
}

.brand-subtitle {
    font-size: 16px;
    color: #666;
    margin-bottom: 0;
}

.decoration-features {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); */
    border: 1px solid #e0e0e0;
    animation-delay: 0.2s;
}

.feature-item:nth-child(2) {
    animation-delay: 0.4s;
}

.feature-item:nth-child(3) {
    animation-delay: 0.6s;
}

.feature-item i {
    font-size: 20px;
    color: var(--primary-color);
    min-width: 24px;
}

.feature-item span {
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

/* 右侧登录表单区域 */
.login-form-section {
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-form-container {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    animation-delay: 0.3s;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h2 {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.login-header p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* 表单样式 */
.login-form {
    width: 100%;
}

.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.form-group label i {
    font-size: 16px;
    color: var(--primary-color);
    min-width: 16px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    background: #fff;
    transition: all 0.3s ease;
    outline: none;
}

.form-group input:focus {
    /* border-color: var(--primary-color); */
    box-shadow: 0 0 0 3px rgba(199, 0, 11, 0.1);
}

.form-group input::placeholder {
    color: #999;
}

.input-border {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.form-group input:focus+.input-border {
    width: 100%;
}

/* 密码输入框特殊样式 */
.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    padding-right: 50px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: var(--primary-color);
}

/* 表单选项 */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    user-select: none;
}

.remember-me input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

.remember-me input[type="checkbox"]:checked+.checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.remember-me input[type="checkbox"]:checked+.checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.forgot-password {
    font-size: 14px;
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: var(--hover-color);
    text-decoration: underline;
}

/* 登录按钮 */
.login-btn {

    padding: 8px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}




.login-btn:hover {
    background: var(--hover-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(199, 0, 11, 0.3);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-loading {
    margin-left: 8px;
}

/* 分割线 */
.login-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.login-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e0e0e0;
}

.login-divider span {
    background: #fff;
    padding: 0 16px;
    color: #999;
    font-size: 14px;
    position: relative;
    z-index: 1;
}

/* 社交登录 */
.social-login {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.social-btn {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.social-btn:hover {
    border-color: #ccc;
    background: #f9f9f9;
}

.wechat-btn:hover {
    border-color: #07c160;
    color: #07c160;
}

.qq-btn:hover {
    border-color: #12b7f5;
    color: #12b7f5;
}

.social-btn i {
    font-size: 16px;
}

/* 注册链接 */
.register-link {
    text-align: center;
    font-size: 14px;
    color: #666;
}

.register-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    margin-left: 4px;
}

.register-link a:hover {
    color: var(--hover-color);
    text-decoration: underline;
}

/* 错误和成功消息 */
.error-message,
.success-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    animation: slideDown 0.3s ease;
}

.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.success-message {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
}

.error-message i,
.success-message i {
    font-size: 16px;
}

/* 忘记密码模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 0;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 0 24px 24px;
}

.reset-btn {
    width: 100%;
    padding: 12px 20px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 16px;
}

.reset-btn:hover {
    background: var(--hover-color);
}

.reset-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 动画 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .login-container {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 0 15px;
    }

    .login-decoration {
        order: 2;
        padding: 20px;
    }

    .decoration-features {
        flex-direction: row;
        justify-content: space-around;
        flex-wrap: wrap;
    }

    .feature-item {
        flex: 0 0 calc(50% - 10px);
        justify-content: center;
        padding: 12px 16px;
    }

    .login-form-container {
        padding: 30px 20px;
        margin: 0 10px;
    }

    .brand-title {
        font-size: 24px;
    }

    .social-login {
        flex-direction: column;
    }

    .modal-content {
        margin: 0 10px;
    }
}

@media (max-width: 480px) {
    .login-bg {
        padding: 20px 0;
    }

    .login-form-container {
        padding: 24px 16px;
        border-radius: 12px;
    }

    .brand-title {
        font-size: 20px;
    }

    .brand-subtitle {
        font-size: 14px;
    }

    .decoration-features {
        flex-direction: column;
    }

    .feature-item {
        flex: none;
    }
}

/* 输入框错
误样式 */
.form-group input.error {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.input-error {
    color: #dc2626;
    font-size: 12px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.input-error::before {
    content: '⚠';
    font-size: 14px;
}

/* 表单组焦点状态 */
.form-group.focused label {
    color: var(--primary-color);
}

.form-group.focused .input-border {
    width: 100%;
}

/* 加载状态优化 */
.login-btn:disabled .btn-text {
    opacity: 0.7;
}

.reset-btn:disabled .btn-text {
    opacity: 0.7;
}

/* 社交登录按钮禁用状态 */
.social-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 模态框动画优化 */
.modal-overlay {
    animation: fadeIn 0.3s ease;
}

.modal-content.animate__fadeInUp {
    animation-duration: 0.4s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* 无障碍访问优化 */
.form-group input:focus {
    outline: none;
}

.login-btn:focus,
.reset-btn:focus,
.social-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .form-group input {
        border-width: 2px;
    }

    .login-btn,
    .reset-btn {
        border: 2px solid var(--primary-color);
    }

    .social-btn {
        border-width: 2px;
    }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
    .animate__animated {
        animation: none;
    }

    .login-btn,
    .reset-btn,
    .social-btn {
        transition: none;
    }

    .form-group input,
    .input-border {
        transition: none;
    }
}