/* 基础重置和全局字体 */
* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    /* 1. 使用 Google Font 字体 */
    font-family: 'Roboto', sans-serif;

    /* 2. 好看的渐变背景 */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

    /* 3. 使用 Flexbox 居中 */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* 登录卡片容器 */
.login-container {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    margin: 1rem;

    /* 4. 卡片样式 */
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);

    /* 5. 漂亮的动画效果 */
    transform: scale(0.95);
    opacity: 0;
    animation: fadeIn 0.5s ease-out 0.1s forwards;
}

@keyframes fadeIn {
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* 登录表单 */
.login-form h2 {
    text-align: center;
    color: #333;
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

/* 6. 带图标的输入框组 */
.input-group {
    position: relative;
    margin-bottom: 1.25rem;
}

.input-group .icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    font-size: 0.9em; /* 图标大小 */
}

.input-group input {
    width: 100%;
    padding: 12px 15px 12px 40px; /* 左侧留出图标空间 */
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus {
    /* 7. 输入框获取焦点时的效果 */
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.3);
}

/* 表单选项：记住我 & 忘记密码 */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.9em;
    color: #555;
}

.form-options label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.form-options input[type="checkbox"] {
    margin-right: 0.5rem;
}

.form-options a {
    color: #667eea;
    text-decoration: none;
}

.form-options a:hover {
    text-decoration: underline;
}

/* 登录按钮 */
.btn-login {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 5px;

    /* 8. 按钮的渐变背景 */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;

    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-login:hover {
    /* 9. 鼠标悬停时的效果 */
    opacity: 0.9;
    box-shadow: 0 5px 15px rgba(118, 75, 162, 0.4);
    transform: translateY(-2px);
}

/* 错误/成功提示框 */
.alert {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    text-align: center;
    font-size: 0.9em;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

#captcha-box {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

/* 当 captcha-box 有内容时自动显示并居中 */
#captcha-box:not(:empty) {
    display: flex !important;
    justify-content: center;
    align-items: center;
}
