:root {
    --brand: #3b82f6;
    --brand-2: #60a5fa;
    --brand-grad: linear-gradient(165deg, #3b82f6 0%, #5b9bd5 60%, #93c5fd 100%);
    --ink: #1e293b;
    --text: #334155;
    --muted: #94a3b8;
    --line: rgba(148, 163, 184, 0.22);
    --bg: #e8f0fe;
    --card: rgba(255,255,255,0.70);
    --danger: #ef4444;
    --danger-soft: #fef2f2;
    --r: 18px;
    --r-sm: 11px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', Roboto, sans-serif;
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    background: linear-gradient(135deg, #dae8fc 0%, #e8f0fe 30%, #f0f5ff 60%, #eef4ff 100%);
    background-attachment: fixed;
    position: relative;
    overflow-x: hidden;
}
svg { display: block; }

/* Soft decorative highlights — same family as the user center gradient */
body::before, body::after {
    content: ''; position: fixed; border-radius: 50%;
    background: rgba(255, 255, 255, .08); pointer-events: none; z-index: 0;
}
body::before { width: 460px; height: 460px; top: -160px; right: -120px; }
body::after { width: 380px; height: 380px; bottom: -150px; left: -120px; }

/* ===================== Layout ===================== */
.login-container {
    position: relative; z-index: 1;
    min-height: 100vh; display: flex; flex-direction: column;
    align-items: center; justify-content: center; padding: 24px;
}
.login-card {
    width: 100%; max-width: 420px;
    background: var(--card); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-radius: var(--r); overflow: hidden;
    box-shadow: 0 22px 60px rgba(59, 130, 246, .18);
    border: 1px solid rgba(255,255,255,.5);
}

/* ----- Brand header band (matches the sidebar gradient) ----- */
.login-head { background: rgba(59, 130, 246, 0.72); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); color: #fff; padding: 32px 34px 26px; }
.login-brand { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 800; letter-spacing: .2px; margin-bottom: 18px; opacity: .96; }
.login-brand::before { content: ''; width: 12px; height: 12px; border-radius: 5px; background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .18); flex-shrink: 0; }
.login-head h1 { font-size: 23px; font-weight: 800; margin-bottom: 6px; letter-spacing: -.2px; }
.login-head .subtitle { color: rgba(255, 255, 255, .82); font-size: 13.5px; }

.login-body { padding: 28px 34px 32px; }

/* ===================== Form ===================== */
.form-group { margin-bottom: 16px; text-align: left; }
.form-group label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 7px; color: var(--ink); }
.form-control { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 14px; background: rgba(255,255,255,0.55); color: var(--text); transition: border-color .15s, box-shadow .15s, background .15s; }
.form-control::placeholder { color: #94a3b8; }
.form-control:focus { outline: none; border-color: var(--brand); background: rgba(255,255,255,0.85); box-shadow: 0 0 0 3px rgba(59, 130, 246, .15); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; padding: 12px; border: 1px solid transparent; border-radius: var(--r-sm);
    font-size: 15px; font-weight: 700; cursor: pointer;
    transition: opacity .15s, background .15s, border-color .15s, color .15s;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--brand-grad); color: #fff; }
.btn-primary:hover:not(:disabled) { opacity: .93; }
.btn-secondary { width: auto; white-space: nowrap; padding: 11px 15px; font-size: 13.5px; background: rgba(255,255,255,0.6); color: var(--brand); border-color: var(--line); }
.btn-secondary:hover:not(:disabled) { border-color: var(--brand); background: rgba(255,255,255,0.85); }

.code-row { display: flex; gap: 8px; align-items: stretch; }
.code-row .form-control { flex: 1; }

.switch-line { margin-top: 16px; text-align: center; font-size: 13px; color: var(--muted); }
.link-muted { color: var(--brand); font-weight: 700; text-decoration: none; }
.link-muted:hover { text-decoration: underline; }

.login-error {
    color: var(--danger); background: var(--danger-soft); border: 1px solid #f5cdd2;
    font-size: 13px; margin-top: 14px; padding: 10px 12px; border-radius: var(--r-sm);
    display: none; text-align: center;
}

.login-hint {
    color: #1a7f37; background: #e8f6ec; border: 1px solid #b7e0c2;
    font-size: 13px; line-height: 1.6; margin-top: 14px; padding: 10px 12px;
    border-radius: var(--r-sm); display: none; text-align: left;
}

/* 重置密码成功后，复用 .login-error 元素展示绿色成功提示 */
.login-error.login-success {
    color: #1a7f37; background: #e8f6ec; border-color: #b7e0c2;
}

/* ===================== Responsive ===================== */
@media (max-width: 480px) {
    .login-head { padding: 28px 22px 22px; }
    .login-body { padding: 24px 22px 28px; }
    .login-head h1 { font-size: 21px; }
}
