:root {
    --brand: #5145e6;
    --brand-2: #8b5cf6;
    --brand-grad: linear-gradient(165deg, #4f46e5 0%, #7c3aed 60%, #9333ea 100%);
    --ink: #181b2a;
    --text: #272b3a;
    --muted: #757b8c;
    --line: #e9eaf1;
    --bg: #f5f6fb;
    --card: #ffffff;
    --danger: #dc2b3a;
    --danger-soft: #fdecee;
    --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: var(--brand-grad);
    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); border-radius: var(--r); overflow: hidden;
    box-shadow: 0 22px 60px rgba(24, 20, 70, .30);
}

/* ----- Brand header band (matches the sidebar gradient) ----- */
.login-head { background: var(--brand-grad); 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: #fbfbfe; color: var(--text);
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.form-control::placeholder { color: #a7adbd; }
.form-control:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(81, 69, 230, .13); }

.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: #fff; color: var(--brand); border-color: var(--line); }
.btn-secondary:hover:not(:disabled) { border-color: var(--brand); }

.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;
}

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