/* Nasscord Signal Lab: sign-in page.
   The brand panel is always dark (it is the brand surface); the form side follows the theme. */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --field: #ffffff;
  --field-hover: #fbfbfd;
  --field-border: #d7dae2;
  --field-border-hover: #b9bec9;
  --ink: #0c0e14;
  --ink-2: #4a5060;
  --muted: #646b7b;
  --line: rgba(16, 24, 40, 0.09);
  --brand: #5146e6;
  --brand-2: #6559f5;
  --brand-ink: #4338ca;
  --focus: rgba(81, 70, 230, 0.28);
  --crit: #d03b3b;
  --crit-wash: #fdf1f1;
  --crit-line: rgba(208, 59, 59, 0.28);
  --crit-ink: #b42323;
  --warn: #d99206;
  --warn-ink: #7a4f00;
  --warn-wash: #fff8e8;
  --warn-line: rgba(214, 150, 10, 0.35);
  --good: #0ca30c;
  --good-wash: #f0faf1;
  --good-line: rgba(12, 163, 12, 0.25);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0c10; --surface: #13151b; --field: #0f1116; --field-hover: #12141a;
    --field-border: #2a2e38; --field-border-hover: #3a3f4b;
    --ink: #f3f4f7; --ink-2: #b8bdc8; --muted: #8f95a4; --line: rgba(255, 255, 255, 0.08);
    --brand: #6559f5; --brand-2: #776cff; --brand-ink: #b4adff; --focus: rgba(119, 108, 255, 0.38);
    --crit-wash: rgba(208, 59, 59, 0.12); --crit-line: rgba(240, 120, 120, 0.3); --crit-ink: #f28b8b;
    --warn: #fab219; --warn-ink: #fbc75a; --warn-wash: rgba(250, 178, 25, 0.10); --warn-line: rgba(250, 178, 25, 0.3);
    --good-wash: rgba(12, 163, 12, 0.12); --good-line: rgba(12, 163, 12, 0.3);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0c10; --surface: #13151b; --field: #0f1116; --field-hover: #12141a;
  --field-border: #2a2e38; --field-border-hover: #3a3f4b;
  --ink: #f3f4f7; --ink-2: #b8bdc8; --muted: #8f95a4; --line: rgba(255, 255, 255, 0.08);
  --brand: #6559f5; --brand-2: #776cff; --brand-ink: #b4adff; --focus: rgba(119, 108, 255, 0.38);
  --crit-wash: rgba(208, 59, 59, 0.12); --crit-line: rgba(240, 120, 120, 0.3); --crit-ink: #f28b8b;
  --warn: #fab219; --warn-ink: #fbc75a; --warn-wash: rgba(250, 178, 25, 0.10); --warn-line: rgba(250, 178, 25, 0.3);
  --good-wash: rgba(12, 163, 12, 0.12); --good-line: rgba(12, 163, 12, 0.3);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font: 400 15px/1.5 "Geist", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.shell { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); min-height: 100vh; }

/* ---------- Brand panel ---------- */
.brand-panel {
  position: relative; overflow: hidden; isolation: isolate;
  color: #e9ebf5; background: #090b14;
  padding: 40px 56px 32px; display: flex; flex-direction: column; gap: 28px;
}
.glow { position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(560px 420px at 8% 0%, rgba(99, 92, 255, 0.30), transparent 70%),
    radial-gradient(720px 420px at 100% 100%, rgba(57, 135, 229, 0.16), transparent 70%); }
.gridlines { position: absolute; inset: 0; z-index: -1; opacity: .55; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 85% 75% at 50% 45%, #000 35%, transparent 80%);
  mask-image: radial-gradient(ellipse 85% 75% at 50% 45%, #000 35%, transparent 80%); }

.wordmark { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; width: max-content; }
.wordmark .name { font-size: 17px; letter-spacing: -0.01em; font-weight: 500; color: rgba(233, 235, 245, .8); }
.wordmark .name b { font-weight: 650; color: #fff; }
.mark { flex: none; filter: drop-shadow(0 6px 18px rgba(81, 70, 230, .5)); }

.pitch { max-width: 540px; margin-top: auto; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: rgba(225, 228, 250, .8);
  padding: 6px 12px 6px 10px; border-radius: 999px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .10); }
.eyebrow .pip { width: 6px; height: 6px; border-radius: 50%; background: #8f88ff; box-shadow: 0 0 0 3px rgba(143, 136, 255, .22); }
.pitch h2 { font-size: clamp(34px, 3.4vw, 50px); line-height: 1.04; letter-spacing: -0.035em; font-weight: 650; margin: 20px 0 14px; color: #fff; }
.pitch h2 span { background: linear-gradient(92deg, #d6d3ff 0%, #9fc3f5 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pitch p.lede { font-size: 16.5px; line-height: 1.55; color: rgba(226, 229, 248, .78); margin: 0 0 26px; max-width: 470px; }
.principles { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.principles li { display: grid; grid-template-columns: 34px 1fr; gap: 14px; align-items: start; padding: 12px 16px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03)); border: 1px solid rgba(255,255,255,.08); }
.principles .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.07); color: #cfcbff; border: 1px solid rgba(255,255,255,.09); }
.principles b { display: block; font-weight: 600; font-size: 14.5px; color: #fff; letter-spacing: -0.005em; }
.principles span { display: block; font-size: 13.5px; color: rgba(222, 226, 248, .72); line-height: 1.45; margin-top: 1px; }

/* sampled-paths illustration (drawn by login.js) */
.fan-wrap { margin: 0 -56px 0 0; position: relative; flex: 1 1 150px; min-height: 140px; max-height: 230px; display: flex; flex-direction: column; }
.fan { flex: 1; min-height: 120px; position: relative; }
.fan svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible;
  -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); }
.fan .now { stroke: rgba(255,255,255,.18); stroke-width: 1; }
.fan .past { fill: none; stroke: rgba(235, 237, 250, .7); stroke-width: 1.6; stroke-linejoin: round; }
.fan .p { fill: none; stroke: #7f9cf5; stroke-opacity: .22; stroke-width: 1; }
.fan .band { fill: #6d63ff; fill-opacity: .14; }
.fan .q { fill: none; stroke: #b3b0ff; stroke-opacity: .75; stroke-width: 1.4; }
.fan .dot { fill: #fff; }
.fan text { fill: rgba(225, 228, 250, .55); font: 500 10.5px/1 "Geist", system-ui, sans-serif; letter-spacing: .08em; }
.fan-wrap figcaption { font-size: 12px; color: rgba(222, 226, 248, .55); padding: 6px 56px 0 0; text-align: right; }

.brand-foot { display: flex; justify-content: space-between; gap: 16px; font-size: 12.5px; color: rgba(222, 226, 248, .55); }

/* ---------- Form side ---------- */
.form-side { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 32px 28px; gap: 28px; position: relative; }
.form-card { width: 100%; max-width: 400px; }
h1 { font-size: 30px; line-height: 1.15; letter-spacing: -0.03em; font-weight: 650; margin: 0 0 8px; }
.sub { margin: 0 0 26px; color: var(--ink-2); font-size: 15px; }

.alert { display: grid; grid-template-columns: 20px 1fr; gap: 10px; padding: 12px 14px; border-radius: 12px; margin: 0 0 20px; font-size: 14px; line-height: 1.45; color: var(--ink); }
.alert svg { margin-top: 1px; }
.alert b { display: block; font-weight: 600; }
.alert .meta { color: var(--ink-2); }
.alert.crit { background: var(--crit-wash); border: 1px solid var(--crit-line); }
.alert.crit svg { color: var(--crit); }
.alert.warn { background: var(--warn-wash); border: 1px solid var(--warn-line); }
.alert.warn svg { color: var(--warn); }
.alert.ok { background: var(--good-wash); border: 1px solid var(--good-line); }
.alert.ok svg { color: var(--good); }
.countdown { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); white-space: nowrap; }
h1, .pitch h2 { text-wrap: balance; }
.pitch p.lede, .sub, .principles span { text-wrap: pretty; }

form { display: grid; gap: 18px; }
.field label { display: block; font-size: 13.5px; font-weight: 550; margin: 0 0 7px; color: var(--ink); }
.control { position: relative; display: flex; align-items: center; }
.control > svg.lead { position: absolute; left: 14px; color: var(--muted); pointer-events: none; transition: color .15s; }
.control input {
  width: 100%; height: 48px; padding: 0 14px 0 42px; border-radius: 12px; font: inherit; font-size: 15px; color: var(--ink);
  background: var(--field); border: 1px solid var(--field-border); outline: none; box-shadow: 0 1px 2px rgba(16,24,40,.04);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.control input::placeholder { color: var(--muted); opacity: .85; }
.control input:hover:not(:disabled) { border-color: var(--field-border-hover); background: var(--field-hover); }
.control input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--focus); }
.control input:disabled { opacity: .6; cursor: not-allowed; }
.control:focus-within > svg.lead { color: var(--brand-ink); }
.control.has-reveal input { padding-right: 48px; }
.reveal { position: absolute; right: 6px; width: 36px; height: 36px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.reveal:hover:not(:disabled) { background: var(--line); color: var(--ink); }
.reveal:disabled { cursor: not-allowed; opacity: .5; }
.reveal:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.reveal .eye-off { display: none; }
.reveal[aria-pressed="true"] .eye-off { display: block; }
.reveal[aria-pressed="true"] .eye-open { display: none; }
.field.invalid input { border-color: var(--crit); }
.field.invalid input:focus { box-shadow: 0 0 0 4px rgba(208,59,59,.2); }
.hint { margin: 7px 0 0; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.hint[hidden] { display: none; }
.hint.err { color: var(--crit-ink); }
.hint.caps { color: var(--warn-ink); }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: -2px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--ink); user-select: none; position: relative; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--field-border-hover); display: grid; place-items: center; background: var(--field); transition: background .15s, border-color .15s, transform .12s; }
.check .box svg { opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s; color: #fff; }
.check input:checked + .box { background: var(--brand); border-color: var(--brand); }
.check input:checked + .box svg { opacity: 1; transform: scale(1); }
.check input:focus-visible + .box { box-shadow: 0 0 0 4px var(--focus); }
.check input:disabled + .box { opacity: .55; }
.check:active .box { transform: scale(.92); }
.row .note { font-size: 13px; color: var(--muted); }

.submit {
  position: relative; height: 50px; margin-top: 6px; border: 0; border-radius: 12px; cursor: pointer; font: inherit; font-size: 15.5px; font-weight: 600; letter-spacing: -0.005em;
  color: #fff; background: linear-gradient(180deg, var(--brand-2), var(--brand));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 1px 2px rgba(16,24,40,.12), 0 10px 24px -10px rgba(81,70,230,.75);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .12s ease, box-shadow .2s ease, filter .2s ease;
}
.submit:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); }
.submit:active:not(:disabled) { transform: translateY(0); filter: brightness(.98); }
.submit:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.submit .arrow { transition: transform .2s ease; }
.submit:hover .arrow { transform: translateX(3px); }
.submit .lock, .submit .spin { display: none; }
.submit .spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .7s linear infinite; }
.submit.loading .spin { display: block; }
.submit.loading .arrow { display: none; }
.submit:disabled { cursor: not-allowed; background: var(--field-border); color: var(--ink-2); box-shadow: none; transform: none; }
body[data-state="locked"] .submit .arrow { display: none; }
body[data-state="locked"] .submit .lock { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.fine { margin: 22px 0 0; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; justify-content: center; text-align: center; }
.legal { margin: 0; font-size: 12.5px; color: var(--muted); text-align: center; }
.legal a { color: inherit; }

.shake { animation: shake .42s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shake { 15%, 85% { transform: translateX(-2px); } 30%, 70% { transform: translateX(4px); } 45%, 55% { transform: translateX(-5px); } }
.rise { animation: rise .6s cubic-bezier(.2,.7,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.theme-btn { position: absolute; top: 20px; right: 20px; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; }
.theme-btn:hover { color: var(--ink); }
.theme-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: block; }
:root[data-theme="dark"] .theme-btn .moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-btn .sun { display: block; } :root:not([data-theme="light"]) .theme-btn .moon { display: none; } }

/* ---------- Responsive ---------- */
@media (max-height: 820px) and (min-width: 961px) {
  .principles span { display: none; }
  .principles li { align-items: center; }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .brand-panel { padding: 24px 20px 14px; gap: 16px; }
  .pitch { margin-top: 6px; }
  .pitch h2 { font-size: 31px; margin: 14px 0 8px; }
  .pitch p.lede { font-size: 15px; margin-bottom: 0; }
  .eyebrow { font-size: 12px; }
  .principles, .brand-foot { display: none; }
  .fan-wrap { flex: none; height: 116px; min-height: 0; margin: 0 -20px 0 -20px; }
  .fan { min-height: 0; }
  .fan-wrap figcaption { padding: 4px 20px 0; font-size: 11.5px; }
  .form-side { padding: 28px 16px 28px; justify-content: flex-start; position: static; }
  .shell { position: relative; }
  .theme-btn { top: 18px; right: 16px; background: rgba(255, 255, 255, .06); color: #e9ebf5; border-color: rgba(255,255,255,.14); }
  .theme-btn:hover { color: #fff; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
