/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Microsoft YaHei', 'Segoe UI', 'Roboto', sans-serif;
    background: url('../images/login/loginbg.jpg') no-repeat center center;
    background-size: cover;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

/* 顶部Logo */
.page-header {
    width: 100%;
    max-width: 1200px;
    margin-bottom: 20px;
    padding: 0 20px;
    text-align: center;
}

.page-header .header-logo {
    max-width: 800px;
    height: auto;
}

/* 登录容器 */
.login-container {
    display: flex;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* 左侧插图区 */
.login-left {
    flex-shrink: 0;
    display: flex;
}

.login-illustration {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
}

/* 右侧表单区 */
.login-right {
    flex: 0 0 520px;
    background: white;
    display: flex;
    flex-direction: column;
    padding: 50px 60px;
    justify-content: center;
}

/* 表单包装器 */
.login-form-wrapper,
.forgot-password-wrapper {
    width: 100%;
    transition: opacity 0.3s ease-in-out;
}

.login-form-wrapper.fade-out,
.forgot-password-wrapper.fade-out {
    opacity: 0;
}

.login-form-wrapper.fade-in,
.forgot-password-wrapper.fade-in {
    opacity: 1;
}

.form-title {
    font-size: 28px;
    font-weight: 600;
    color: #333;
    margin-bottom: 40px;
}

/* 表单样式 */
.login-form,
.forgot-password-form {
    width: 100%;
}

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

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 14px 16px;
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: #4a90e2;
    background: white;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.input-icon {
    color: #4a90e2;
    font-size: 18px;
    margin-right: 12px;
    min-width: 20px;
}

.form-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 15px;
    color: #333;
}

.form-input::placeholder {
    color: #999;
}

.toggle-password {
    color: #999;
    font-size: 18px;
    cursor: pointer;
    transition: color 0.3s ease;
    padding-left: 10px;
}

.toggle-password:hover {
    color: #4a90e2;
}

/* 验证码组 */
.captcha-group {
    display: flex;
    gap: 12px;
    width: 100%;
}

.captcha-input-wrapper {
    flex: 1;
}

.captcha-input {
    width: 100%;
}

.captcha-code {
    flex: 0 0 120px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid #e0e0e0;
    transition: transform 0.2s ease;
}

.captcha-code:hover {
    transform: scale(1.05);
}

#captchaCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* 表单操作区 */
.form-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 32px;
}

.login-button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.login-button:hover {
    background: linear-gradient(135deg, #357abd 0%, #2868a8 100%);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
    transform: translateY(-2px);
}

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

.forgot-password {
    color: #4a90e2;
    font-size: 14px;
    text-decoration: none;
    text-align: right;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: #357abd;
    text-decoration: underline;
}

.forgot-password-link,
.back-to-login-link {
    color: #4a90e2;
    font-size: 14px;
    text-decoration: none;
    text-align: right;
    transition: color 0.3s ease;
}

.forgot-password-link:hover,
.back-to-login-link:hover {
    color: #357abd;
    text-decoration: underline;
}

/* 验证码发送按钮 */
.verification-group {
    display: flex;
    gap: 12px;
    width: 100%;
}

.verification-input-wrapper {
    flex: 1;
}

.verification-input {
    width: 100%;
}

.send-code-button {
    flex: 0 0 120px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.send-code-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #f57c00 0%, #e65100 100%);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.send-code-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* 密码强度提示 */
.password-strength-wrapper {
    margin-bottom: 24px;
}

.password-strength-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.password-strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.password-strength-fill.weak {
    width: 33.33%;
    background: linear-gradient(90deg, #f44336 0%, #e53935 100%);
}

.password-strength-fill.medium {
    width: 66.66%;
    background: linear-gradient(90deg, #ff9800 0%, #fb8c00 100%);
}

.password-strength-fill.strong {
    width: 100%;
    background: linear-gradient(90deg, #4caf50 0%, #43a047 100%);
}

.password-strength-text {
    font-size: 13px;
    color: #666;
}

.password-strength-text.weak {
    color: #f44336;
}

.password-strength-text.medium {
    color: #ff9800;
}

.password-strength-text.strong {
    color: #4caf50;
}

/* 响应式设计 */
@media (max-width: 968px) {
    .login-container {
        flex-direction: column;
        max-width: 500px;
    }

    .login-left {
        width: 100%;
    }

    .login-illustration {
        width: 100%;
        height: auto;
    }

    .login-right {
        flex: 1 1 auto;
        padding: 40px 30px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .login-right {
        padding: 30px 20px;
    }

    .form-title {
        font-size: 24px;
        margin-bottom: 30px;
    }

    .captcha-group {
        flex-direction: column;
    }

    .captcha-code {
        width: 100%;
    }
}