/* ═══════════════════════════════════════════════════════════════════════
   Login Page Styles — same tokens as the dashboard (style.css)
   ═══════════════════════════════════════════════════════════════════════ */
:root {
    color-scheme: light;
    --bg:            #f6f7f9;
    --surface:       #ffffff;
    --surface-2:     #f9fafb;
    --surface-hover: #f3f4f6;
    --border:        #e6e8ec;
    --border-strong: #d5d8de;
    --text:          #0f1419;
    --text-2:        #4b5563;
    --text-muted:    #8a909a;
    --accent:        #2a78d6;
    --accent-hover:  #256abf;
    --accent-soft:   #eaf2fc;
    --accent-ink:    #1c5cab;
    --critical:      #d03b3b;
    --critical-soft: #fcecec;
    --shadow:        0 1px 3px rgba(16, 24, 40, 0.06), 0 12px 32px -12px rgba(16, 24, 40, 0.14);
    --ring:          0 0 0 3px rgba(42, 120, 214, 0.18);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg:            #0f1012;
        --surface:       #17181b;
        --surface-2:     #1c1d21;
        --surface-hover: #222428;
        --border:        #2a2c31;
        --border-strong: #383a40;
        --text:          #f0efec;
        --text-2:        #c3c2b7;
        --text-muted:    #8f8d86;
        --accent:        #3987e5;
        --accent-hover:  #5598e7;
        --accent-soft:   rgba(57, 135, 229, 0.14);
        --accent-ink:    #86b6ef;
        --critical:      #e66767;
        --critical-soft: rgba(230, 103, 103, 0.14);
        --shadow:        none;
        --ring:          0 0 0 3px rgba(57, 135, 229, 0.3);
    }
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg:            #0f1012;
    --surface:       #17181b;
    --surface-2:     #1c1d21;
    --surface-hover: #222428;
    --border:        #2a2c31;
    --border-strong: #383a40;
    --text:          #f0efec;
    --text-2:        #c3c2b7;
    --text-muted:    #8f8d86;
    --accent:        #3987e5;
    --accent-hover:  #5598e7;
    --accent-soft:   rgba(57, 135, 229, 0.14);
    --accent-ink:    #86b6ef;
    --critical:      #e66767;
    --critical-soft: rgba(230, 103, 103, 0.14);
    --shadow:        none;
    --ring:          0 0 0 3px rgba(57, 135, 229, 0.3);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    -webkit-font-smoothing: antialiased;
}

/* Decorative blobs from the old theme are not part of the clean look */
.bg-glow { display: none; }

.hidden { display: none !important; }

/* ─── Card ────────────────────────────────────────────────────────── */
.login-wrapper { width: 100%; max-width: 400px; }

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 36px 32px 28px;
}

.login-logo { text-align: center; margin-bottom: 28px; }

.logo-circle {
    width: 44px; height: 44px;
    margin: 0 auto 14px;
    display: grid; place-items: center;
    border-radius: 12px;
    background: var(--accent);
    color: #ffffff;
}
.logo-circle svg { width: 24px; height: 24px; }

.login-logo h1 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.login-logo p { margin-top: 4px; font-size: 14px; color: var(--text-muted); }

/* ─── Form ────────────────────────────────────────────────────────── */
#login-form { display: flex; flex-direction: column; gap: 16px; }

.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-group label { font-size: 13px; font-weight: 500; }

.input-wrapper { position: relative; }

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px; height: 16px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.15s;
}

.input-wrapper input {
    width: 100%;
    height: 42px;
    padding: 0 12px 0 38px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.input-wrapper input::placeholder { color: var(--text-muted); }
.input-wrapper input:focus { border-color: var(--accent); box-shadow: var(--ring); }
.input-wrapper:focus-within .input-icon { color: var(--accent); }

.error-message {
    display: none;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--critical-soft);
    color: var(--critical);
    font-size: 13px;
}
.error-message:not(:empty) { display: block; }

.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    margin-top: 4px;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: #ffffff;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-login:hover { background: var(--accent-hover); }
.btn-login:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-login:disabled { opacity: 0.65; cursor: not-allowed; }

.spinner { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
