:root {
    color-scheme: dark;
    --font-ui: "Google Sans Flex", "Google Sans Code", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --bg-main: #070b12;
    --bg-secondary: #0f1624;
    --panel: rgba(255, 255, 255, 0.05);
    --panel-strong: rgba(255, 255, 255, 0.08);
    --line: rgba(255, 255, 255, 0.15);
    --text: #f6f8ff;
    --muted: #a9b3c9;
    --accent: #4f8cff;
    --accent-2: #56d6b9;
    --danger: #ff8b98;
    --success: #69dd99;
    --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.45);
    --focus: rgba(79, 140, 255, 0.34);
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg-main: #eef2f8;
    --bg-secondary: #dce5f3;
    --panel: rgba(255, 255, 255, 0.65);
    --panel-strong: rgba(255, 255, 255, 0.82);
    --line: rgba(15, 23, 42, 0.12);
    --text: #0f172a;
    --muted: #52607a;
    --accent: #1665f5;
    --accent-2: #0fa886;
    --danger: #d3263f;
    --success: #198754;
    --shadow-lg: 0 26px 70px rgba(20, 37, 63, 0.18);
    --focus: rgba(22, 101, 245, 0.26);
}

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

html, body { min-height: 100%; }

body {
    font-family: var(--font-ui);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    color: var(--text);
    background: radial-gradient(1300px 500px at -10% -20%, rgba(79, 140, 255, 0.26), transparent 55%), radial-gradient(1000px 600px at 110% 120%, rgba(86, 214, 185, 0.22), transparent 55%), linear-gradient(140deg, var(--bg-main) 0%, var(--bg-secondary) 100%);
    overflow: hidden;
}

.bg-orb {
    position: fixed;
    border-radius: 999px;
    pointer-events: none;
    filter: blur(72px);
    opacity: 0.55;
    animation: float 14s ease-in-out infinite;
}

.orb-a { width: 340px; height: 340px; left: -110px; top: -120px; background: rgba(89, 136, 255, 0.58); }
.orb-b { width: 420px; height: 420px; right: -140px; bottom: -160px; background: rgba(83, 228, 197, 0.5); animation-delay: -7s; }

.bg-grid {
    position: fixed;
    inset: 0;
    opacity: 0.16;
    pointer-events: none;
    background-image: linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(circle at center, black 28%, transparent 84%);
}

.layout-shell {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
}

.showcase-panel {
    padding: 56px;
    display: grid;
    align-items: end;
}

.showcase-inner {
    border: 1px solid var(--line);
    border-radius: 32px;
    padding: 42px;
    background: linear-gradient(155deg, var(--panel-strong), var(--panel));
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(28px);
    animation: reveal 760ms cubic-bezier(.2,.8,.2,1);
}

.brand-kicker { color: var(--muted); font-size: 0.74rem; letter-spacing: 0.16em; font-weight: 600; }
.brand-title { margin-top: 18px; font-size: clamp(2rem, 3.6vw, 3rem); letter-spacing: -0.03em; line-height: 1.06; }
.brand-copy { margin-top: 16px; color: var(--muted); font-size: 1rem; line-height: 1.65; max-width: 50ch; }

.stat-grid { margin-top: 28px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat-grid article { border: 1px solid var(--line); border-radius: 16px; padding: 12px; background: rgba(255, 255, 255, 0.04); }
.stat-grid strong { display: block; font-size: 1rem; }
.stat-grid span { color: var(--muted); font-size: 0.78rem; }

.form-panel {
    display: grid;
    place-items: center;
    padding: 28px;
}

.login-shell { width: min(100%, 450px); animation: reveal 760ms cubic-bezier(.2,.8,.2,1); }
.app-topbar { display: flex; justify-content: flex-end; margin-bottom: 12px; }

.theme-toggle {
    border: 1px solid var(--line);
    background: var(--panel-strong);
    color: var(--text);
    border-radius: 999px;
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.theme-toggle__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.theme-toggle__label { font-size: 0.78rem; font-weight: 600; }

.login-card {
    border: 1px solid var(--line);
    background: linear-gradient(155deg, var(--panel-strong), var(--panel));
    border-radius: 26px;
    padding: 26px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(26px);
}

.eyebrow { color: var(--muted); font-size: 0.74rem; letter-spacing: 0.14em; font-weight: 600; text-transform: uppercase; }
.title { margin-top: 12px; font-size: clamp(1.8rem, 2.8vw, 2.2rem); letter-spacing: -0.02em; }
.subtitle { margin-top: 8px; color: var(--muted); font-size: 0.94rem; line-height: 1.55; }

.feedback-stack { margin-top: 14px; min-height: 34px; }
.feedback { padding: 10px 12px; border-radius: 12px; border: 1px solid transparent; font-size: 0.84rem; }
.feedback--error { background: rgba(255, 139, 152, 0.14); color: var(--danger); border-color: rgba(255, 139, 152, 0.38); }
.feedback--success { background: rgba(105, 221, 153, 0.14); color: var(--success); border-color: rgba(105, 221, 153, 0.38); }

.form { margin-top: 10px; display: grid; gap: 14px; }
.field { display: grid; gap: 7px; }
.field label { color: var(--muted); font-size: 0.84rem; font-weight: 600; }

.input-wrap, .password-wrap { position: relative; }
.field-icon { position: absolute; left: 12px; top: 15px; color: var(--muted); font-size: 0.9rem; }

.control {
    width: 100%;
    height: 50px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    padding: 0 14px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease, transform 180ms ease;
}

.input-wrap .control { padding-left: 34px; }
.password-wrap .control { padding-right: 86px; }

.control::placeholder { color: rgba(169, 179, 201, 0.72); }
.control:hover { background: rgba(255, 255, 255, 0.06); }
.control:focus { border-color: rgba(79, 140, 255, 0.7); box-shadow: 0 0 0 4px var(--focus); transform: translateY(-1px); }

.inline-action {
    position: absolute;
    right: 8px;
    top: 8px;
    border: 0;
    border-radius: 10px;
    padding: 8px 12px;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
}

.error-text { min-height: 14px; color: var(--danger); font-size: 0.78rem; }
.form-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

.remember { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.84rem; }
.remember input { accent-color: var(--accent); }
.forgot { color: var(--accent); text-decoration: none; font-size: 0.84rem; }
.forgot:hover { text-decoration: underline; }

.button {
    border: 0;
    height: 50px;
    border-radius: 14px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 64%, var(--accent-2)));
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 14px 26px rgba(79, 140, 255, 0.32);
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.button:hover { transform: translateY(-1px); filter: brightness(1.04); }
.button:active { transform: translateY(1px); }
.button.is-loading { pointer-events: none; opacity: 0.9; }

.button__loader {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    display: none;
    animation: spin .7s linear infinite;
}

.button.is-loading .button__loader { display: inline-block; }

.divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 0.78rem;
}

.divider::before, .divider::after { content: ""; height: 1px; background: var(--line); }

.social-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.social-btn {
    border: 1px solid var(--line);
    border-radius: 12px;
    height: 46px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.86rem;
    transition: transform 160ms ease, background 160ms ease;
}

.social-btn:hover { transform: translateY(-1px); background: rgba(255, 255, 255, 0.08); }

.footnote { margin-top: 12px; text-align: center; color: var(--muted); font-size: 0.76rem; }

.toast-wrap { position: fixed; right: 14px; bottom: 14px; display: grid; gap: 8px; z-index: 80; }
.toast { border: 1px solid var(--line); border-radius: 12px; background: var(--panel-strong); padding: 10px 12px; backdrop-filter: blur(22px); font-size: 0.82rem; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); animation: toast-in 300ms ease; }

@keyframes float { 0%,100% { transform: translate3d(0,0,0); } 50% { transform: translate3d(0,20px,0); } }
@keyframes reveal { from { opacity: 0; transform: translateY(16px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 980px) {
    .layout-shell { grid-template-columns: 1fr; }
    .showcase-panel { display: none; }
    .form-panel { padding: 20px 14px; }
}

@media (max-width: 560px) {
    .login-card { padding: 20px 16px; border-radius: 20px; }
    .social-grid { grid-template-columns: 1fr; }
}
