@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* Palette + fonts aligned with the frontend (library/ui/styles/theme.css) — neutral slate, Inter body,
   Space Grotesk display, JetBrains mono. */
:root {
  --bg:#0a0a0b; --card:#121214; --border:#222225; --border-soft:#161618;
  --text:#e8e8ea; --muted:#8c8c93; --faint:#5b5b62;
  --accent:#e2e8f0; --accent-ink:#0a0a0b; --error:#ef4444; --glint:rgba(255,255,255,.9);
  --input-bg:#070708; --ring:rgba(226,232,240,0.25);
  --font:'Inter',ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  --font-display:'Space Grotesk','Inter',ui-sans-serif,sans-serif;
  --font-mono:'JetBrains Mono',ui-monospace,SFMono-Regular,Menlo,monospace;
}
[data-theme="light"] {
  --bg:#f5f6f8; --card:#ffffff; --border:#e3e7ec; --border-soft:#ebeef2;
  --text:#0f172a; --muted:#5b6573; --faint:#98a0ab;
  --accent:#18181b; --accent-ink:#ffffff; --error:#ef4444; --glint:rgba(0,0,0,.85);
  --input-bg:#eef1f5; --ring:rgba(24,24,27,0.20);
}
* { box-sizing:border-box; }
body { margin:0; min-height:100vh; display:flex; padding:28px; color:var(--text); font-family:var(--font);
       background:radial-gradient(70% 50% at 50% -8%, rgba(255,255,255,0.03), transparent 60%), #08080a;
       -webkit-user-select:none; user-select:none;
       -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale; text-rendering:optimizeLegibility; }
[data-theme="light"] body { background:radial-gradient(70% 50% at 50% -8%, rgba(15,23,42,0.025), transparent 60%), #f5f6f8; }
@media (max-width:900px){ body{ padding:14px; } }

.shell { flex:1; display:flex; min-height:0; border-radius:9px; overflow:hidden;
         border:1px solid var(--border); box-shadow:inset 0 1px 0 rgba(255,255,255,.05); }

/* ── Left showcase — premium ────────────────────────────────────────── */
.brand {
  flex:1.1; display:none; position:relative; overflow:hidden;
  flex-direction:column; justify-content:flex-start; padding:60px 60px 44px;
  border-right:1px solid var(--border-soft);
  background:linear-gradient(165deg, #0e1117 0%, #0a0c0f 70%);
}
[data-theme="light"] .brand { background:linear-gradient(165deg, #eef1f6 0%, #f5f7fa 70%); }
/* Animated network topology (drawn by /net.js) — sits behind the brand content. */
.brand > * { position:relative; z-index:1; }
.brand > .net { position:absolute; inset:0; width:100%; height:100%; z-index:0; pointer-events:none; opacity:.55; }
.brand-logo { width:min(90%, 480px); height:auto; display:block; align-self:flex-start; }
.brand-body { margin-top:clamp(56px, 11vh, 130px); }
.brand-body h1 { font-family:var(--font-display); font-size:46px; line-height:1.16; letter-spacing:-0.03em; font-weight:600; margin:0 0 34px; }
.brand-body h1 span { color:var(--faint); }
.features { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:15px; }
.features li { display:flex; align-items:center; gap:12px; color:var(--muted); font-size:16px; }
.features svg { flex:none; color:var(--text); opacity:.85; }
.brand .foot { color:var(--faint); font-size:12px; margin-top:auto; }

/* ── Right form pane — centered card ────────────────────────────────── */
.pane { flex:1; display:flex; flex-direction:column; justify-content:center; align-items:center; position:relative; padding:40px 32px; background:var(--bg); }
@media (max-width:900px){ .brand{ display:none; } }
@media (min-width:900px){ .brand{ display:flex; } .pane{ flex:0 0 52%; } }

.auth-card {
  width:100%; max-width:468px; padding:44px 42px;
  background:var(--card); border:1px solid var(--border); border-radius:9px;
}
.pane-logo { width:min(96%, 500px); height:auto; display:block; margin:0 auto 40px; }
@media (min-width:900px){ .pane-logo{ display:none; } }

.auth-card h2 { font-family:var(--font-display); font-size:25px; margin:0 0 6px; text-align:center; letter-spacing:-0.01em; }
.sub { color:var(--muted); text-align:center; margin:0 0 30px; font-size:14.5px; }

/* Onboarding — a small icon badge above the heading (first-run "name your workspace"). Inverted fill:
   white-on-black in dark, black-on-white in light (the --accent / --accent-ink pair flips per theme). */
.onboard-badge { display:flex; width:72px; height:72px; margin:0 auto 24px; align-items:center; justify-content:center;
  border-radius:18px; background:var(--accent); color:var(--accent-ink); }
/* "Signed in as …" above the workspace field. */
.signed-in { margin:0 0 20px; text-align:center; color:var(--faint); font-size:12px; }
.signed-in code { font-family:var(--font-mono); color:var(--muted); }
/* Inline instruction next to a field label. */
.label-note { font-weight:400; color:var(--faint); font-size:11.5px; margin-left:6px; }
/* "Cancel and sign out" link under the onboarding button. */
.signout { display:block; text-align:center; margin-top:18px; color:var(--muted); font-size:13px;
  text-decoration:underline; text-underline-offset:3px; }
.signout:hover { color:var(--text); }

.field { margin-bottom:16px; }
.field label { display:block; font-size:12.5px; color:var(--muted); margin-bottom:8px; font-weight:600; }
input { width:100%; padding:10px 13px; background:var(--input-bg); border:1px solid var(--border); color:var(--text);
        border-radius:9px; font-size:14px; outline:none; transition:border-color .15s, box-shadow .15s;
        -webkit-user-select:text; user-select:text; }
input:focus { border-color:var(--muted); box-shadow:0 0 0 4px var(--ring); }
button[type=submit] { width:100%; margin-top:14px; padding:14px; border:0; border-radius:9px;
        background:var(--accent); color:var(--accent-ink); font-size:14px; font-weight:700; cursor:pointer; transition:opacity .15s; }
button[type=submit]:hover { opacity:.9; }

.err { margin:0 0 16px; padding:10px 12px; border-radius:9px; font-size:13px;
       background:rgba(255,107,107,.12); border:1px solid rgba(255,107,107,.32); color:var(--error); }
.hint { margin-top:20px; text-align:center; color:var(--faint); font-size:12px; }
.hint code { font-family:ui-monospace,SFMono-Regular,Menlo,monospace; color:var(--muted); }

/* ── Theme toggle ───────────────────────────────────────────────────── */
.toggle { position:absolute; top:22px; right:22px; display:flex; align-items:center; justify-content:center;
          width:36px; height:36px; padding:0; border:1px solid var(--border); border-radius:9px;
          background:transparent; color:var(--muted); cursor:pointer; transition:color .15s, border-color .15s; }
.toggle:hover { color:var(--text); border-color:var(--muted); }
[data-theme="dark"] .ico-sun { display:none; }
[data-theme="light"] .ico-moon { display:none; }

/* ── OTP code step ──────────────────────────────────────────────────── */
.code-input { text-align:center; letter-spacing:.45em; font-size:22px; font-weight:600; padding-left:.45em; }
.resend { margin-top:12px; text-align:center; }
.auth-card .linklike { width:auto; margin:0; padding:6px 10px; background:none; border:0; box-shadow:none;
  color:var(--muted); font-size:13px; font-weight:600; cursor:pointer; }
.auth-card .linklike:hover { color:var(--text); transform:none; }

/* ── Social login ───────────────────────────────────────────────────── */
.social { display:flex; flex-direction:column; gap:10px; }
.social-btn {
  display:flex; align-items:center; justify-content:center; gap:10px; padding:12px 14px;
  border:1px solid var(--border); border-radius:9px; background:var(--input-bg); color:var(--text);
  font-size:14px; font-weight:600; text-decoration:none; transition:border-color .15s, background .15s;
}
.social-btn:hover { border-color:var(--muted); }
.social-btn svg { flex:none; }
.divider { display:flex; align-items:center; gap:12px; margin:18px 0 6px; color:var(--muted); font-size:12px; }
.divider::before, .divider::after { content:""; flex:1; height:1px; background:var(--border); }

/* ── Error pages ────────────────────────────────────────────────────── */
.error-page { flex:1; display:flex; align-items:center; justify-content:center; padding:24px; }
.error-card { text-align:center; max-width:420px; }
.error-logo { width:min(80%, 360px); height:auto; display:block; margin:0 auto 28px; }
.error-code { font-size:56px; font-weight:700; line-height:1; letter-spacing:-0.02em; color:var(--text); margin-bottom:10px; }
.error-card h2 { margin:8px 0 6px; }
.error-back {
  display:inline-block; margin-top:22px; padding:9px 16px; border:1px solid var(--border); border-radius:9px;
  color:var(--muted); font-size:13px; text-decoration:none; transition:color .15s, border-color .15s;
}
.error-back:hover { color:var(--text); border-color:var(--muted); }
