/* --- 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 {
    /* 请确保图片路径正确，与 login.css 一致 */
    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;
}

.register-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px; /* 比登录框稍宽一点，适应更多输入框 */
    padding: 20px;
    animation: fadeInUp 0.5s ease-out;
}

.back-link {
    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-link:hover { color: white; transform: translateX(-5px); }

/* --- Glass Container --- */
.register-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);
}

.register-header { text-align: center; margin-bottom: 30px; }
.logo-icon { font-size: 2.5rem; color: var(--primary); margin-bottom: 10px; }
.register-header h1 { font-size: 1.8rem; color: var(--text-main); font-weight: 700; margin-bottom: 5px; }
.register-header p { color: var(--text-light); font-size: 0.9rem; }

/* --- Form Styles --- */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    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: 14px;
    color: #94a3b8;
    font-size: 0.95rem;
    z-index: 2;
}

.register-form input {
    width: 100%;
    padding: 12px 12px 12px 42px; /* 左侧留出图标位置 */
    border: 2px solid transparent;
    background-color: var(--input-bg);
    border-radius: 10px;
    font-size: 0.95rem;
    color: var(--text-main);
    outline: none;
    transition: var(--transition);
}

.register-form input:focus {
    background-color: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.form-action { margin-top: 24px; }

.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: 20px;
    text-align: center;
    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 (Errors) --- */
.flash-messages { margin-bottom: 20px; }
.alert {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideIn 0.3s ease;
}
/* 如果后端没有传 category，默认为红色警告，因为注册页通常显示错误信息 */
.alert, .alert.error { background-color: #fef2f2; color: #ef4444; border: 1px solid #fecaca; }
.alert.success { background-color: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }

/* --- 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) {
    .register-container { padding: 30px 20px; }
    .register-header h1 { font-size: 1.5rem; }
}