/* Sign-in and register: same look as the public site (dark, mint accent, Unbounded + Inter). */
:root {
  --bg: #05060a; --panel: rgba(16, 19, 27, 0.78); --field: #0b0e15; --line: rgba(255, 255, 255, 0.08); --line-2: rgba(255, 255, 255, 0.16);
  --ink: #eef1f6; --muted: #8b93a3; --accent: #5cf2c4; --accent-ink: #04140f; --accent-soft: rgba(92, 242, 196, 0.12);
  --danger: #ff6b55; --ok: #5cf2c4;
  --display: "Unbounded", system-ui, sans-serif; --text: "Inter", system-ui, sans-serif; --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; min-height: 100vh; min-height: 100svh; background: var(--bg); color: var(--ink); font: 1rem/1.55 var(--text); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }

.auth { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; min-height: 100svh; }

/* left: the brand side, a sealed core in slow orbit */
.auth-art { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 2rem clamp(1.5rem, 4vw, 3.5rem); background: radial-gradient(60% 50% at 50% 55%, rgba(92, 242, 196, 0.09), transparent 70%), #04050a; border-right: 1px solid var(--line); }
.brand { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; font: 700 1.25rem var(--display); letter-spacing: -0.03em; }
.brand svg { width: 1.8rem; height: 1.8rem; }
#auth-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.2s ease; }
.gl-on #auth-gl { opacity: 1; }
.gl-on .orbit { display: none; }
.auth-art::after { content: ""; position: absolute; inset: auto 0 0; height: 40%; background: linear-gradient(to top, #04050a 15%, transparent); pointer-events: none; }
.orbit { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.orbit svg { width: min(78%, 34rem); height: auto; overflow: visible; }
.orbit .ring { fill: none; stroke: rgba(255, 255, 255, 0.09); stroke-width: 1; transform-origin: 200px 200px; }
.orbit .r1 { animation: spin 38s linear infinite; }
.orbit .r2 { animation: spin 26s linear infinite reverse; stroke-dasharray: 3 9; }
.orbit .r3 { animation: spin 60s linear infinite; stroke: rgba(92, 242, 196, 0.18); stroke-dasharray: 90 40; }
.orbit .sat { fill: var(--accent); }
.orbit .shield { fill: none; stroke: var(--ink); stroke-width: 5; stroke-linejoin: round; }
.orbit .core { fill: var(--accent); animation: breathe 3.6s ease-in-out infinite; transform-origin: 200px 196px; }
.orbit .glow { fill: url(#g); }
.orbit .glyphs text { fill: rgba(139, 147, 163, 0.55); font: 11px var(--mono); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { transform: scale(1.12); opacity: 0.8; } }
.art-copy { position: relative; z-index: 2; max-width: 26rem; pointer-events: none; }
.art-copy h2 { margin: 0; font: 700 clamp(1.8rem, 1.2rem + 2vw, 2.8rem)/1 var(--display); letter-spacing: -0.045em; }
.art-copy p { margin: 0.9rem 0 0; color: var(--muted); }

/* right: the form */
.auth-main { display: flex; flex-direction: column; justify-content: center; padding: 2rem clamp(1.25rem, 5vw, 4.5rem); }
.auth-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: auto; padding-bottom: 2rem; font-size: 0.875rem; color: var(--muted); }
.auth-top .brand { display: none; color: var(--ink); }
.auth-top a.link { color: var(--ink); text-decoration: none; }
.auth-top a.link:hover { color: var(--accent); }
.auth-form-wrap { width: 100%; max-width: 26rem; margin: 0 auto auto; animation: rise 0.9s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } }
.auth-form-wrap h1 { margin: 0; font: 700 clamp(1.9rem, 1.5rem + 1.4vw, 2.6rem)/1.02 var(--display); letter-spacing: -0.045em; }
.auth-form-wrap .lead { margin: 0.8rem 0 0; color: var(--muted); }

form { margin-top: 2rem; display: grid; gap: 1.15rem; }
.field label { display: block; margin-bottom: 0.45rem; font-size: 0.875rem; font-weight: 500; }
.control { position: relative; }
.field input { width: 100%; min-height: 3.1rem; padding: 0 1rem; border-radius: 12px; border: 1px solid var(--line-2); background: var(--field); color: var(--ink); font: 0.975rem var(--text); outline: none; transition: border-color 0.25s, box-shadow 0.25s; }
.field input.mono { font-family: var(--mono); font-size: 0.9rem; letter-spacing: 0.01em; }
.field input::placeholder { color: #545c6b; }
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.control.has-toggle input { padding-right: 3.2rem; }
.peek { position: absolute; top: 50%; right: 0.45rem; transform: translateY(-50%); width: 2.3rem; height: 2.3rem; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.peek:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); }
.peek svg { width: 1.15rem; height: 1.15rem; }
.hint { margin-top: 0.45rem; font-size: 0.8125rem; color: var(--muted); }
.hint code { font: 0.78rem var(--mono); padding: 0.05rem 0.3rem; border-radius: 4px; background: rgba(255, 255, 255, 0.06); color: #cfd5df; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem; width: 100%; min-height: 3.25rem; margin-top: 0.4rem; border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 600 1rem var(--text); text-decoration: none; cursor: pointer; transition: transform 0.4s var(--ease), box-shadow 0.4s, filter 0.2s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 30px -10px rgba(92, 242, 196, 0.55); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .peek:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn svg { width: 1.1rem; height: 1.1rem; }
.btn[disabled] { filter: saturate(0.4) brightness(0.8); cursor: progress; }

.alert { display: flex; gap: 0.7rem; margin-top: 1.6rem; padding: 0.85rem 1rem; border-radius: 12px; font-size: 0.9rem; line-height: 1.45; }
.alert svg { flex: none; width: 1.15rem; height: 1.15rem; margin-top: 0.1rem; }
.alert-error { background: rgba(255, 107, 85, 0.09); box-shadow: inset 0 0 0 1px rgba(255, 107, 85, 0.35); color: #ffd3cc; }
.alert-error svg { color: var(--danger); }
.alert-success { background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(92, 242, 196, 0.35); color: #d7fff2; }
.alert-success svg { color: var(--ok); }
.apikey-inline { display: block; margin-top: 0.6rem; padding: 0.6rem 0.75rem; border-radius: 8px; background: var(--field); border: 1px solid var(--line-2); font: 0.85rem var(--mono); color: var(--accent); word-break: break-all; user-select: all; }

.switch { margin-top: 1.6rem; font-size: 0.9rem; color: var(--muted); text-align: center; }
.switch a { color: var(--ink); font-weight: 500; text-decoration-color: rgba(92, 242, 196, 0.5); text-underline-offset: 3px; }
.switch a:hover { color: var(--accent); }
.auth-foot { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; justify-content: center; margin-top: auto; padding-top: 2rem; font-size: 0.8125rem; color: #5c6473; }
.auth-foot a { text-decoration: none; } .auth-foot a:hover { color: var(--ink); }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-top .brand { position: relative; z-index: 2; display: inline-flex; }
  .auth-main { justify-content: flex-start; }
  .auth-form-wrap { margin-top: 1rem; }
}
@media (max-width: 560px) { .auth-top .q { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .orbit *, .auth-form-wrap { animation: none !important; }
}

/* the core's attack (click-fx.js, shared with the homepage): count under the logo, hint by the cursor */
html.core-hover .auth-art { cursor: pointer; }
.fx-count { position: fixed; left: clamp(1.5rem, 4vw, 3.5rem); top: 5.4rem; z-index: 6; font: 500 0.75rem var(--mono); color: #ff9a7c; padding: 0.35rem 0.7rem; border-radius: 999px; background: rgba(40, 10, 6, 0.6); box-shadow: inset 0 0 0 1px rgba(255, 90, 60, 0.35); transform: translateY(6px); opacity: 0; visibility: hidden; transition: transform 0.3s, visibility 0.3s; }
.fx-count.on { visibility: visible; transform: none; }
.fx-count b { color: #ffd2c6; font-weight: 500; }
.fx-count i { font-style: normal; color: var(--accent); margin-left: 0.35rem; }
.fx-count.big { animation: fxpop 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes fxpop { 40% { transform: scale(1.12); } }
.fx-hint { position: fixed; left: 0; top: 0; z-index: 7; pointer-events: none; font: 500 0.72rem var(--mono); color: var(--accent); padding: 0.3rem 0.6rem; border-radius: 8px; background: rgba(6, 9, 14, 0.8); box-shadow: inset 0 0 0 1px rgba(92, 242, 196, 0.3); white-space: nowrap; opacity: 0; transition: opacity 0.25s; }
.fx-hint.on { opacity: 1; }
@media (max-width: 900px) { .fx-count, .fx-hint { display: none; } }

/* with scripts on, the drawn core stays hidden; it only shows if WebGL is unavailable */
.js .orbit { display: none; }
.js .gl-off .orbit { display: grid; }
