:root {
    color-scheme: light;
    --page-bg: #eef2f7;
    --surface: #ffffff;
    --border: #dce3ec;
    --text: #172033;
    --muted: #64748b;
    --accent: #315efb;
    --accent-dark: #2448cc;
    --danger: #b42318;
    --danger-bg: #fef3f2;
    --success: #027a48;
    --success-bg: #ecfdf3;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 15% 10%, rgba(49, 94, 251, .14), transparent 30rem),
        radial-gradient(circle at 90% 90%, rgba(124, 58, 237, .1), transparent 28rem),
        var(--page-bg);
    font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
}

body::before {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(148, 163, 184, .08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, .08) 1px, transparent 1px);
    background-size: 42px 42px;
    content: "";
}

.auth-shell {
    position: relative;
    z-index: 1;
    display: grid;
    min-height: 100vh;
    padding: 24px;
    place-items: center;
}

.auth-card {
    width: min(100%, 430px);
    padding: 42px;
    border: 1px solid rgba(220, 227, 236, .9);
    border-radius: 20px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 24px 70px rgba(15, 23, 42, .14);
    backdrop-filter: blur(14px);
}

.auth-brand {
    margin-bottom: 30px;
    text-align: center;
}

.auth-logo {
    display: grid;
    width: 58px;
    height: 58px;
    margin: 0 auto 18px;
    place-items: center;
    border-radius: 16px;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    box-shadow: 0 14px 32px rgba(49, 94, 251, .28);
    font-size: 1.45rem;
}

.auth-eyebrow {
    margin: 0 0 7px;
    color: var(--accent);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.auth-brand h1 {
    margin: 0;
    font-size: 1.85rem;
    letter-spacing: -.04em;
}

.auth-brand > p:last-child {
    margin: 9px auto 0;
    max-width: 310px;
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.55;
}

.auth-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 20px;
    padding: 12px 14px;
    border: 1px solid;
    border-radius: 11px;
    font-size: .82rem;
    line-height: 1.45;
}

.auth-alert i { margin-top: 1px; }
.auth-alert-error { border-color: #fecdca; color: var(--danger); background: var(--danger-bg); }
.auth-alert-success { border-color: #abefc6; color: var(--success); background: var(--success-bg); }

.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-size: .78rem;
    font-weight: 700;
}

.input-wrap { position: relative; }

.input-wrap > i {
    position: absolute;
    top: 50%;
    left: 14px;
    color: #94a3b8;
    transform: translateY(-50%);
}

.input-wrap input {
    width: 100%;
    height: 48px;
    padding: 0 44px 0 42px;
    border: 1px solid var(--border);
    border-radius: 11px;
    outline: none;
    color: var(--text);
    background: #fff;
    font: inherit;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.input-wrap input:focus {
    border-color: #8ea5ff;
    box-shadow: 0 0 0 4px rgba(49, 94, 251, .11);
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    display: grid;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 8px;
    color: #94a3b8;
    background: transparent;
    cursor: pointer;
    transform: translateY(-50%);
}

.password-toggle:hover { color: var(--text); background: #f1f5f9; }

.remember-option {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    margin: 0 0 22px;
    color: var(--muted);
    font-size: .8rem;
    cursor: pointer;
}

.remember-option input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

.submit-button {
    display: flex;
    width: 100%;
    height: 49px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 11px;
    color: #fff;
    background: var(--accent);
    box-shadow: 0 11px 26px rgba(49, 94, 251, .25);
    cursor: pointer;
    font: inherit;
    font-size: .88rem;
    font-weight: 750;
    transition: background .18s ease, transform .18s ease;
}

.submit-button:hover { background: var(--accent-dark); transform: translateY(-1px); }
.submit-button:disabled { opacity: .72; cursor: wait; transform: none; }

.auth-security {
    display: flex;
    gap: 7px;
    align-items: flex-start;
    justify-content: center;
    margin: 24px 0 0;
    color: #94a3b8;
    font-size: .7rem;
    line-height: 1.45;
    text-align: center;
}

.auth-security i { color: #16a34a; }

@media (max-width: 520px) {
    .auth-shell { padding: 14px; }
    .auth-card { padding: 32px 23px; border-radius: 16px; }
}
