﻿/* ===== 深蓝色主题变量 ===== */
:root {
    /* 颜色系统 */
    --primary-color: #0c4da2;
    --primary-dark: #08387a;
    --primary-light: #4a7bc3;
    --header-gradient-start: #0c4da2;
    --header-gradient-end: #08387a;
    --border-color: #dee2e6;
    --text-dark: #212529;
    --text-light: #ffffff;
    --menu-bg: #f0f5ff; /* 浅蓝色菜单背景 */
    --content-bg: #ffffff;
    --success-color: #28a745; /* 微信绿色 */
}

/* ===== 登录页面样式 ===== */
.login-page {
    display: flex;
    min-height: 100vh;
    background: var(--menu-bg);
    padding: 1rem;
}

.login-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.login-card {
    max-width: 450px;
    width: 100%;
    border-radius: 0.75rem;
    background: var(--content-bg);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

    .login-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    }

.login-header {
    background: linear-gradient(135deg, var(--header-gradient-start), var(--header-gradient-end));
    color: var(--text-light);
    padding: 2rem;
    text-align: center;
}

.login-logo {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.login-title {
    font-weight: 600;
    margin: 0;
    font-size: 1.75rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.login-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin-top: 0.5rem;
    font-weight: 400;
}

.login-body {
    padding: 2rem;
}

/* 表单元素 */
.form-label {
    display: flex;
    align-items: center;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

    .form-label i {
        margin-right: 0.75rem;
        font-size: 1.1rem;
        color: var(--primary-color);
    }

.form-control {
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

    .form-control:focus {
        border-color: var(--primary-light);
        box-shadow: 0 0 0 0.25rem rgba(12, 77, 162, 0.15);
    }

/* 密码输入框容器 */
.password-input-container {
    position: relative;
    margin-bottom: 1.5rem;
}

/* 密码输入组 */
.password-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

/* 密码可见性切换按钮 */
.password-toggle {
    position: absolute;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    cursor: pointer;
    color: #6c757d;
    font-size: 1.25rem;
    background: none;
    border: none;
    padding: 0 8px;
    z-index: 5;
    transition: color 0.2s ease;
}

    .password-toggle:hover {
        color: var(--primary-color);
    }

/* 记住我 */
.form-check {
    margin-bottom: 1.5rem;
}

.form-check-input {
    width: 1.2em;
    height: 1.2em;
    margin-top: 0.2em;
}

.form-check-label {
    display: flex;
    align-items: center;
    font-weight: 500;
}

    .form-check-label i {
        margin-right: 0.5rem;
        font-size: 1.1rem;
        color: var(--primary-color);
    }

/* 登录按钮 */
.btn-login {
    background: linear-gradient(135deg, var(--header-gradient-start), var(--header-gradient-end));
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.75rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    width: 100%;
    box-shadow: 0 4px 6px rgba(12, 77, 162, 0.2);
}

    .btn-login:hover {
        background: linear-gradient(135deg, var(--primary-dark), var(--header-gradient-end));
        color: white; /* 确保文字为白色 */
        transform: translateY(-2px);
        box-shadow: 0 6px 10px rgba(12, 77, 162, 0.25);
    }

    .btn-login:active {
        transform: translateY(0);
    }

/* 微信登录按钮 */
.btn-wechat {
    background: linear-gradient(135deg, #28a745, #218838);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.75rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 1rem;
    box-shadow: 0 4px 6px rgba(40, 167, 69, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none; /* 因为是a标签，去掉下划线 */
}

    .btn-wechat:hover {
        background: linear-gradient(135deg, #218838, #1e7e34);
        color: white; /* 确保文字为白色 */
        transform: translateY(-2px);
        box-shadow: 0 6px 10px rgba(40, 167, 69, 0.25);
        text-decoration: none; /* 鼠标悬停时去掉下划线 */
    }

    .btn-wechat:active {
        transform: translateY(0);
    }

    .btn-wechat i {
        font-size: 1.5rem;
        margin-right: 0.75rem;
    }

/* 底部链接 */
.login-footer {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.login-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    transition: color 0.2s ease;
}

    .login-link:hover {
        color: var(--primary-dark);
        text-decoration: underline;
    }

    .login-link i {
        margin-right: 0.5rem;
        font-size: 0.9rem;
    }

.divider {
    color: #6c757d;
    padding: 0 0.5rem;
}

/* 加载状态 */
.spinner-container {
    display: inline-block;
    width: 1.5rem;
    margin-left: 0.5rem;
}

#spinner {
    vertical-align: middle;
}

/* 密码强度指示器 */
.password-strength {
    height: 4px;
    background-color: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.5rem;
}

    .password-strength::after {
        content: '';
        display: block;
        height: 100%;
        width: 0;
        background-color: #dc3545;
        transition: width 0.3s, background-color 0.3s;
    }

    .password-strength.weak::after {
        width: 33%;
        background-color: #dc3545;
    }

    .password-strength.medium::after {
        width: 66%;
        background-color: #fd7e14;
    }

    .password-strength.strong::after {
        width: 100%;
        background-color: #28a745;
    }

/* 验证码发送按钮 */
.send-code-btn {
    position: absolute;
    right: 1px;
    top: 1px;
    height: calc(100% - 2px);
    border-radius: 0 0.5rem 0.5rem 0;
    min-width: 110px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    border: none;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
}

    .send-code-btn:hover {
        background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
        color: white;
    }

    .send-code-btn:disabled {
        background: linear-gradient(135deg, #c1c1c1, #a8a8a8);
        opacity: 0.7;
    }

.input-group-verification {
    position: relative;
}

.verification-input {
    padding-right: 120px;
}

/* 响应式调整 */
@media (max-width: 576px) {
    .login-card {
        border-radius: 0.5rem;
    }

    .login-header {
        padding: 1.5rem;
    }

    .login-body {
        padding: 1.5rem;
    }

    .login-title {
        font-size: 1.5rem;
    }

    .login-subtitle {
        font-size: 0.9rem;
    }
}

@media (max-width: 400px) {
    .login-footer {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .divider {
        display: none;
    }
}
