/* Sign-in, 2FA and account messages, in the same look as Forge's sign-in: soft canvas with a dot grid, white card,
   pill steps, glossy button, 6-box code entry. Light by default; follows the system theme, or the dashboard's saved
   Theme setting (<html data-theme="light|dark">). Accent colors are the --accent* tokens: change them to re-tint. */
:root {
  --bg: #f2f2f2;
  --panel: #ffffff;
  --panel-2: #f6f6f6;
  --line: #e8e8e8;
  --line-2: #dcdcdc;
  --text: #0d0d0d;
  --text-2: #3f3f3f;
  --muted: #6f6f6f;
  --accent: #1667ff;
  --accent-2: #0b4fd6;
  --accent-soft: rgba(22, 103, 255, .09);
  --accent-text: #0b4fd6;
  --ink-1: #2c2c2c;
  --ink-2: #0a0a0a;
  --ok: #17a34a;
  --ok-soft: #e6f6ec;
  --bad: #c92f2f;
  --bad-soft: #fdecec;
  --glow: rgba(22, 103, 255, .10);
  --dot: #dadada;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 10px 30px -14px rgba(0, 0, 0, .16);
  --shadow-lg: 0 1px 2px rgba(0, 0, 0, .04), 0 40px 80px -36px rgba(0, 0, 0, .3);
  --font: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0b0c; --panel: #141416; --panel-2: #1a1a1d; --line: #232327; --line-2: #2e2e33;
    --text: #f2f2f2; --text-2: #c9c9cc; --muted: #8b8b92;
    --accent: #3b82ff; --accent-2: #1f66f0; --accent-soft: rgba(59, 130, 255, .14); --accent-text: #7fb0ff;
    --ink-1: #f4f4f4; --ink-2: #d6d6d6;
    --ok: #4ade80; --ok-soft: rgba(74, 222, 128, .12); --bad: #ff7a7a; --bad-soft: rgba(255, 122, 122, .12);
    --glow: rgba(59, 130, 255, .14); --dot: #1f1f23;
    --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 12px 30px -18px rgba(0, 0, 0, .8);
    --shadow-lg: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 40px 100px -30px #000;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0b0c; --panel: #141416; --panel-2: #1a1a1d; --line: #232327; --line-2: #2e2e33;
  --text: #f2f2f2; --text-2: #c9c9cc; --muted: #8b8b92;
  --accent: #3b82ff; --accent-2: #1f66f0; --accent-soft: rgba(59, 130, 255, .14); --accent-text: #7fb0ff;
  --ink-1: #f4f4f4; --ink-2: #d6d6d6;
  --ok: #4ade80; --ok-soft: rgba(74, 222, 128, .12); --bad: #ff7a7a; --bad-soft: rgba(255, 122, 122, .12);
  --glow: rgba(59, 130, 255, .14); --dot: #1f1f23;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 12px 30px -18px rgba(0, 0, 0, .8);
  --shadow-lg: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 40px 100px -30px #000;
  color-scheme: dark;
}
:root[data-contrast="high"] { --muted: var(--text-2); --line-2: var(--muted); }

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body.auth { margin: 0; color: var(--text); font: calc(15px * var(--font-scale, 1))/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden;
  background: radial-gradient(900px 480px at 30% -10%, var(--glow), transparent 70%), radial-gradient(var(--dot) 1px, transparent 1px) 0 0 / 22px 22px, var(--bg); }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1240px; margin: 0 auto; padding: 22px 40px 0; }
.mark { display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: 17px; letter-spacing: -.03em; }
.mark-eye { width: 28px; height: 28px; flex: none; display: block; color: var(--text); }
.mark-eye .pupil { fill: var(--accent); stroke: none; }
.mark em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--accent-text); background: var(--accent-soft); padding: 2px 8px; border-radius: 99px; letter-spacing: .02em; }
.top-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 500; color: var(--text-2); background: var(--panel); border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; box-shadow: var(--shadow); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); flex: none; }

.stage { min-height: calc(100vh - 70px); min-height: calc(100dvh - 70px); display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(360px, 430px); align-items: center; gap: 56px; max-width: 1240px; margin: 0 auto; padding: 32px 40px 48px; }

/* left: headline + a sketch of the dashboard (generic placeholders; this page is public) */
.art { display: grid; gap: 18px; min-width: 0; }
.art h1 { margin: 6px 0 0; font-size: clamp(36px, 4.4vw, 60px); line-height: 1.04; letter-spacing: -.05em; font-weight: 600; }
.swap { position: relative; display: inline-block; height: 1.1em; overflow: hidden; vertical-align: bottom; color: var(--accent); }
.swap span { display: block; height: 1.1em; animation: swap 12.5s cubic-bezier(.7, 0, .2, 1) infinite; }
@keyframes swap {
  0%, 16% { transform: translateY(0); } 20%, 36% { transform: translateY(-100%); } 40%, 56% { transform: translateY(-200%); }
  60%, 76% { transform: translateY(-300%); } 80%, 96% { transform: translateY(-400%); } 100% { transform: translateY(-500%); }
}
.lede { margin: 0; max-width: 520px; font-size: 16px; color: var(--muted); }

.mock { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 12px; margin-top: 10px; padding: 12px; max-width: 640px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg); }
.mock-chat { display: grid; gap: 10px; align-content: start; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; min-width: 0; }
.bubble.you { justify-self: end; max-width: 92%; font-size: 12px; line-height: 1.4; color: var(--bg); background: linear-gradient(180deg, var(--ink-1), var(--ink-2)); padding: 8px 11px; border-radius: 13px 13px 4px 13px; }
.rows { list-style: none; margin: 0; padding: 4px; display: grid; gap: 2px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; font-size: 11.5px; color: var(--text-2); min-width: 0; }
.rows li { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 7px; align-items: center; padding: 5px 6px; border-radius: 8px; white-space: nowrap; overflow: hidden; animation: row 9s var(--d) ease-in-out infinite both; }
.rows li i { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 6px; font-style: normal; font-family: var(--mono); font-size: 10.5px; color: var(--accent-text); background: var(--accent-soft); }
.rows li b { font-size: 10px; font-weight: 600; color: var(--ok); background: var(--ok-soft); padding: 1px 7px; border-radius: 99px; animation: done 9s var(--d) ease-in-out infinite both; }
@keyframes row { 0%, 4% { opacity: 0; transform: translateY(4px); } 9%, 88% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; } }
@keyframes done { 0%, 12% { opacity: 0; } 16%, 88% { opacity: 1; } 96%, 100% { opacity: 0; } }

.mock-dash { display: grid; gap: 10px; align-content: start; padding: 0 12px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; min-width: 0; }
.bar3 { display: flex; gap: 5px; margin: 0 -12px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.bar3 span { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.md-top, .md-lines i, .md-tiles i, .md-spark i { animation: build 9s ease-in-out infinite both; }
.md-top { display: grid; grid-template-columns: 54px 1fr; gap: 12px; align-items: center; padding-top: 4px; animation-delay: .5s; }
.md-ring { width: 54px; height: 54px; display: block; }
.md-ring circle { fill: none; stroke-width: 7; }
.md-ring .tr { stroke: var(--line); }
.md-ring .ar { stroke: var(--ok); stroke-linecap: round; stroke-dasharray: 118 151; transform: rotate(-90deg); transform-origin: 30px 30px; }
.md-lines { display: grid; gap: 7px; }
.md-lines i { display: block; height: 8px; border-radius: 5px; background: var(--line-2); }
.md-lines i:nth-child(1) { width: 78%; background: var(--text); animation-delay: 1.2s; }
.md-lines i:nth-child(2) { width: 52%; animation-delay: 1.5s; }
.md-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.md-tiles i { height: 34px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); position: relative; }
.md-tiles i::after { content: ""; position: absolute; left: 8px; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.md-tiles i:nth-child(1) { animation-delay: 2s; } .md-tiles i:nth-child(2) { animation-delay: 2.2s; } .md-tiles i:nth-child(3) { animation-delay: 2.4s; }
.md-spark { display: flex; align-items: flex-end; gap: 4px; height: 52px; padding: 0 2px; }
.md-spark i { flex: 1; display: block; border-radius: 4px 4px 2px 2px; background: color-mix(in srgb, var(--accent) 70%, var(--panel)); }
.md-spark i:nth-child(1) { height: 40%; animation-delay: 2.8s; } .md-spark i:nth-child(2) { height: 62%; animation-delay: 2.9s; }
.md-spark i:nth-child(3) { height: 48%; animation-delay: 3s; } .md-spark i:nth-child(4) { height: 78%; animation-delay: 3.1s; }
.md-spark i:nth-child(5) { height: 55%; animation-delay: 3.2s; } .md-spark i:nth-child(6) { height: 90%; animation-delay: 3.3s; }
.md-spark i:nth-child(7) { height: 66%; animation-delay: 3.4s; } .md-spark i:nth-child(8) { height: 44%; animation-delay: 3.5s; }
@keyframes build { 0%, 3% { opacity: 0; transform: scale(.94); } 8%, 88% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; } }

/* right: the sign-in card */
.card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 28px 28px 20px; box-shadow: var(--shadow-lg); }
.card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.card-head h2 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -.035em; }
.sub { margin: 1px 0 0; color: var(--muted); font-size: 13.5px; }
.lock { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(180deg, var(--ink-1), var(--ink-2)); flex: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 6px 16px -8px rgba(0, 0, 0, .5); }
.lock i { position: relative; width: 14px; height: 11px; border-radius: 3px; background: var(--accent); margin-top: 6px; }
.lock i::before { content: ""; position: absolute; left: 2px; right: 2px; top: -8px; height: 10px; border: 2px solid var(--bg); border-bottom: 0; border-radius: 6px 6px 0 0; }
.unlocked .lock i::before { transform: translateX(5px) rotate(12deg); transform-origin: right bottom; transition: transform .3s; }
.is-error .lock i { background: var(--bad); }
.is-error .card-head h2 { color: var(--bad); }
.steps { list-style: none; display: flex; gap: 4px; margin: 0 0 20px; padding: 4px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 99px; counter-reset: s; }
.steps li { flex: 1; text-align: center; font-size: 12.5px; font-weight: 500; color: var(--muted); padding: 5px 8px; border-radius: 99px; counter-increment: s; }
.steps li::before { content: counter(s) ". "; }
.steps li.on { color: var(--text); background: var(--panel); box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }
.steps li.done { color: var(--ok); }
.steps li.done::before { content: "✓ "; }

.step { display: grid; gap: 14px; animation: in .3s ease-out; margin: 0; }
@keyframes in { from { opacity: 0; transform: translateY(6px); } }
.field { display: grid; gap: 6px; }
.field > span:first-child { font-size: 12.5px; color: var(--text-2); font-weight: 550; }
.field input, .pw-wrap { width: 100%; height: 46px; border-radius: 13px; border: 1px solid var(--line-2); background: var(--panel); padding: 0 14px; outline: 0; font-size: 15px; transition: border-color .15s, box-shadow .15s; }
.field input:focus, .pw-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field input.code-input { font-family: var(--mono); font-size: 22px; letter-spacing: .5em; text-align: center; padding-left: calc(14px + .5em); height: 54px; }
.pw-wrap { display: flex; align-items: center; padding: 0 6px 0 0; }
.pw-wrap input { flex: 1; border: 0; height: 100%; background: none; box-shadow: none !important; }
.peek { background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); font-size: 11.5px; font-weight: 500; padding: 3px 10px; border-radius: 99px; cursor: pointer; }
.peek:hover { color: var(--text); }

.go { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 10px; height: 48px; border: 1px solid var(--accent-2); border-radius: 99px; color: #fff; font-weight: 600; font-size: 15px; cursor: pointer; margin-top: 4px; text-decoration: none; transition: transform .1s, box-shadow .2s;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 80%, white), var(--accent) 45%, var(--accent-2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 1px 2px rgba(0, 0, 0, .12), 0 10px 24px -10px color-mix(in srgb, var(--accent) 80%, transparent); }
.go:hover .arrow { transform: translateX(4px); }
.go:active { transform: translateY(1px); }
.go .arrow { transition: transform .2s; }
.go::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .3) 50%, transparent 70%); transform: translateX(-100%); }
.go:hover::after { animation: sheen .8s ease; }
@keyframes sheen { to { transform: translateX(100%); } }
.go.busy { pointer-events: none; }
.go.busy .label::after { content: ""; display: inline-block; width: 14px; height: 14px; margin-left: 10px; vertical-align: -2px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .7s linear infinite; }
.go.busy .arrow { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.sent { margin: 0; color: var(--text-2); font-size: 14px; }
.sent b { color: var(--text); font-family: var(--mono); font-weight: 500; overflow-wrap: anywhere; }
.otp { display: flex; align-items: center; gap: 8px; }
.otp input { width: 100%; min-width: 0; height: 58px; text-align: center; font-family: var(--mono); font-size: 24px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--panel); outline: 0; caret-color: var(--accent); transition: border-color .15s, transform .15s, box-shadow .15s; }
.otp input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); transform: translateY(-2px); }
.otp input.filled { background: var(--panel-2); }
.otp .dash { width: 12px; height: 2px; background: var(--line-2); flex: none; }
.otp.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.code-meta { display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.text-link { color: var(--accent-text); font-size: 13px; text-decoration: none; font-weight: 550; }
.text-link:hover { text-decoration: underline; }
.back { justify-self: start; color: var(--muted); font-weight: 400; }
.back:hover { color: var(--text); }
.msg { margin: 14px 0 0; font-size: 13.5px; color: var(--bad); }
.msg:empty { display: none; }
.msg.ok { color: var(--ok); }
.foot { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.foot .dot { margin-top: 5px; }

@media (max-width: 960px) {
  .top { padding: 16px 16px 0; }
  .top-pill { display: none; }
  .stage { grid-template-columns: 1fr; gap: 24px; padding: 20px 16px 40px; align-content: start; min-height: 0; }
  .mock { display: none; }
  .art h1 { font-size: 34px; }
  .lede { font-size: 15px; }
  .card { padding: 22px 18px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
:root[data-motion="reduced"] *, :root[data-motion="reduced"] *::before, :root[data-motion="reduced"] *::after { animation: none !important; transition: none !important; }
