/* --- Variables & Reset --- */
:root {
    --primary: #3b82f6;
    --primary-dark: #1e40af;
    --text-main: #1e293b;
    --text-light: #64748b;
    --bg-overlay: rgba(15, 23, 42, 0.6); /* 深蓝色遮罩 */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.5);
    --input-bg: #f1f5f9;
    --radius: 16px;
    --transition: all 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body, html {
    height: 100%;
    font-family: 'Noto Sans SC', sans-serif;
}

body {
    background-image: url('img/Mount_and_Blade_2_background.jpg'); /* 确保路径正确 */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* 背景遮罩 */
.bg-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-overlay);
    backdrop-filter: blur(3px); /* 背景轻微模糊 */
    z-index: 0;
}

.login-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 20px;
    animation: fadeInUp 0.5s ease-out;
}

/* 返回主页链接 */
.back-home {
    display: inline-block;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}
.back-home:hover { color: white; transform: translateX(-5px); }

/* --- Glass Container --- */
.login-container {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.login-header { margin-bottom: 30px; }
.logo-icon { font-size: 2.5rem; color: var(--primary); margin-bottom: 10px; }
.login-header h1 { font-size: 1.8rem; color: var(--text-main); font-weight: 700; margin-bottom: 5px; }
.login-header p { color: var(--text-light); font-size: 0.95rem; }

/* --- Form Styles --- */
.form-group { margin-bottom: 20px; text-align: left; }
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: #94a3b8;
    font-size: 1rem;
    z-index: 2;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 12px 12px 12px 44px; /* 左侧留出图标位置 */
    border: 2px solid transparent;
    background-color: var(--input-bg);
    border-radius: 10px;
    font-size: 1rem;
    color: var(--text-main);
    outline: none;
    transition: var(--transition);
}

.login-form input:focus {
    background-color: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.form-footer { margin-top: 24px; font-size: 0.9rem; color: var(--text-light); }
.form-footer a { color: var(--primary); font-weight: 600; text-decoration: none; }
.form-footer a:hover { text-decoration: underline; color: var(--primary-dark); }

/* --- Flash Messages --- */
.flash-messages { margin-bottom: 20px; text-align: left; }
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideIn 0.3s ease;
}
.alert.error { background-color: #fef2f2; color: #ef4444; border: 1px solid #fecaca; }
.alert.success { background-color: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.alert.info { background-color: #eff6ff; color: #3b82f6; border: 1px solid #bfdbfe; }

/* --- Animations --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .login-container { padding: 30px 20px; }
    .login-header h1 { font-size: 1.5rem; }
}