/* AfterContext — auth pages (sign in / sign up). Split: dark brand aside + light form. */
:root {
  --bg:#fbfbfd; --surface:#ffffff; --border:#e4e4ec; --border-strong:#d2d2dd; --field:#fcfcfe;
  --text:#14141b; --muted:#5d5d6c; --faint:#8b8b9a;
  --accent:#6366f1; --accent-hover:#4f52e8; --accent-ring:rgba(99,102,241,.18);
  --dark-bg:#0e0e15; --dark-surface:#15151f; --dark-border:#26263a; --dark-text:#f2f2f7; --dark-muted:#9b9bae; --dark-faint:#6c6c80;
  --code-bg:#12121b; --code-border:#272739; --code-key:#8a83f5; --code-str:#c7c7d6; --code-num:#7fd0a8; --code-cmt:#62627a; --code-hint:#7fd0a8;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: "Space Grotesk", sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: inherit; }

.auth { display: grid; grid-template-columns: 1.04fr 1fr; min-height: 100vh; }

/* ---------- dark brand aside ---------- */
.auth-aside { position: relative; overflow: hidden; background: var(--dark-bg); color: var(--dark-text);
  display: flex; flex-direction: column; justify-content: space-between; padding: 44px 56px 48px; }
.auth-aside::before { content: ""; position: absolute; inset: 0; z-index: 0;
  background-image: linear-gradient(to right, rgba(138,131,245,.06) 1px, transparent 1px), linear-gradient(to bottom, rgba(138,131,245,.06) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 30% 20%, #000 30%, transparent 80%); mask-image: radial-gradient(ellipse 80% 60% at 30% 20%, #000 30%, transparent 80%); }
.auth-aside::after { content: ""; position: absolute; z-index: 0; top: -200px; left: -120px; width: 680px; height: 520px;
  background: radial-gradient(ellipse at center, rgba(91,81,234,.40), rgba(91,81,234,0) 64%); filter: blur(20px); }
.auth-aside > * { position: relative; z-index: 1; }
.auth-logo { height: 26px; display: block; width: fit-content; }
.aside-body { display: flex; flex-direction: column; gap: 26px; max-width: 460px; margin: auto 0; }
.aside-kicker { font-family: "JetBrains Mono", monospace; font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin: 0; }
.aside-head { font-size: 40px; line-height: 1.08; font-weight: 700; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
.aside-head .em { color: #8a83f5; }
.aside-sub { font-size: 16px; line-height: 1.6; color: var(--dark-muted); margin: 0; text-wrap: pretty; }

.aside-code { background: var(--code-bg); border: 1px solid var(--code-border); border-radius: 11px; overflow: hidden; margin-top: 4px; }
.aside-code .bar { display: flex; align-items: center; justify-content: space-between; padding: 9px 14px; border-bottom: 1px solid var(--code-border); }
.aside-code .bar .t { font-family: "JetBrains Mono", monospace; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #9b9bae; }
.aside-code .bar .tag { font-family: "JetBrains Mono", monospace; font-size: 10.5px; color: var(--code-hint); border: 1px solid rgba(127,208,168,.3); padding: 2px 7px; border-radius: 99px; }
.aside-code pre { margin: 0; padding: 14px 16px; font: 400 12.5px/1.6 "JetBrains Mono", monospace; color: #e8e8f0; white-space: pre-wrap; }
.aside-code .k { color: var(--code-key); } .aside-code .s { color: var(--code-str); } .aside-code .n { color: var(--code-num); } .aside-code .c { color: var(--code-cmt); } .aside-code .h { color: var(--code-hint); }
.aside-foot { font-family: "JetBrains Mono", monospace; font-size: 12.5px; color: var(--dark-faint); }
.aside-foot b { color: var(--dark-muted); font-weight: 500; }

/* ---------- form side ---------- */
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 40px; position: relative; }
.auth-card { width: 100%; max-width: 396px; }
.auth-card .topbar { position: absolute; top: 28px; right: 40px; font-size: 14px; color: var(--muted); }
.auth-card .topbar a { color: var(--accent); text-decoration: none; font-weight: 600; }
.auth-eyebrow { font-family: "JetBrains Mono", monospace; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }
.auth-title { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 8px; }
.auth-desc { font-size: 15.5px; line-height: 1.55; color: var(--muted); margin: 0 0 30px; text-wrap: pretty; }

.sso { display: flex; flex-direction: column; gap: 10px; }
.sso-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 12px 16px;
  font: 600 14.5px/1 "Space Grotesk", sans-serif; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 9px; cursor: pointer; text-decoration: none; transition: border-color .15s, background .15s; }
.sso-btn:hover { border-color: #b9b9c8; background: #fafafd; }
.sso-btn svg { width: 18px; height: 18px; display: block; }

.divider { display: flex; align-items: center; gap: 14px; margin: 22px 0; color: var(--faint);
  font: 400 11.5px/1 "JetBrains Mono", monospace; letter-spacing: .12em; text-transform: uppercase; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--border); }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { font-family: "JetBrains Mono", monospace; font-size: 11.5px; letter-spacing: .04em; color: var(--muted); display: flex; justify-content: space-between; align-items: baseline; }
.field label a { color: var(--accent); text-decoration: none; text-transform: none; letter-spacing: 0; font-weight: 500; }
.field input { width: 100%; padding: 12px 14px; font: 400 15px/1.2 "Space Grotesk", sans-serif; color: var(--text);
  background: var(--field); border: 1px solid var(--border-strong); border-radius: 9px; outline: none; transition: border-color .15s, box-shadow .15s; }
.field input::placeholder { color: #b3b3c0; }
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); background: #fff; }
.field .hint { font-size: 12px; color: var(--faint); margin: 0; }

.submit { width: 100%; padding: 13px 16px; margin-top: 6px; font: 600 15px/1 "Space Grotesk", sans-serif;
  color: #fff; background: var(--accent); border: 1px solid var(--accent); border-radius: 9px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: background .15s; }
.submit:hover { background: var(--accent-hover); }
.submit .mono { font-family: "JetBrains Mono", monospace; font-weight: 400; font-size: 13px; opacity: .72; }

.fineprint { font-size: 12.5px; line-height: 1.55; color: var(--faint); margin: 16px 0 0; text-align: center; text-wrap: pretty; }
.fineprint a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.auth-alt { font-size: 14.5px; color: var(--muted); margin: 26px 0 0; text-align: center; }
.auth-alt a { color: var(--accent); text-decoration: none; font-weight: 600; }

/* Turnstile widget is a fixed-width iframe; center it like the rest of the form */
.cf-turnstile { display: flex; justify-content: center; margin: 0 0 16px; }

/* server-rendered status messages (login error, signup flash) */
.auth-card .error, .auth-card .flash { font-size: 13.5px; line-height: 1.5; border-radius: 9px; padding: 11px 14px; margin: 0 0 18px; text-wrap: pretty; }
.auth-card .error { color: #b4231f; background: #fdecec; border: 1px solid #f4c7c5; }
.auth-card .flash { color: #1f5132; background: #ecf7f0; border: 1px solid #c5e6d2; }

/* responsive: drop the brand aside on narrow screens */
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-main { padding: 64px 24px; }
  .auth-card .topbar { right: 24px; }
}
