:root {
  --paper: #12171C;
  --paper-2: #1A2128;
  --rule: #2C3640;
  --ink: #E6EAE8;
  --ink-2: #A8B2BA;
  --ink-3: #7A868E;
  --stop: #6B86E8;
  --ok: #4FA882;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: "Schibsted Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
html[data-theme="light"] {
  --paper: #EDF0EF;
  --paper-2: #E3E8E6;
  --rule: #C7CFCC;
  --ink: #0F1A24;
  --ink-2: #4B5760;
  --ink-3: #7A868E;
  --stop: #2440C4;
  --ok: #2F7D5B;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.5;
  min-height: 100vh;
}
.wrap { max-width: 640px; margin: 0 auto; padding: 28px 20px 64px; }
header { margin-bottom: 28px; }
.mark {
  font-family: var(--mono); font-weight: 600; font-size: 20px;
  letter-spacing: -0.02em; line-height: 1; margin: 0;
}
.mark .stop { color: var(--stop); }
.card {
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: 2px;
  padding: 20px; margin-bottom: 16px;
}
label.field { display: grid; gap: 8px; margin-bottom: 16px; }
label.field > span {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-3);
}
.help { font-size: 13px; color: var(--ink-2); margin: -8px 0 12px; }
#authHelp { margin-bottom: 4px; }
#authCard .actions { margin-top: 4px; }
#authCard .auth-remember { margin-top: 14px; border: 0; padding: 0; background: none; }
#authCard .auth-method {
  margin-top: 12px; border: 0; padding: 4px 0; background: none;
  text-transform: none; letter-spacing: 0;
}
#authErr:empty, #authOk:empty, .err:empty, .ok:empty { display: none; }
#loadingRecovery { font-size: 13px; color: var(--ink-2); }
#loadingRecovery a { color: inherit; }
input[type="text"], input[type="email"], input[type="password"] {
  font: inherit; font-family: var(--mono); font-size: 15px; color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule); border-radius: 2px;
  padding: 12px 14px; width: 100%;
}
input:focus { border-color: var(--stop); outline: none; }
.choice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; border: 1px solid var(--rule); border-radius: 2px;
  background: var(--paper); cursor: pointer; font-family: var(--mono); font-size: 14px;
}
.choice input { margin-top: 2px; accent-color: var(--stop); }
.btn {
  font-family: var(--mono); font-size: 14px; font-weight: 500;
  background: var(--ink); color: var(--paper); border: 0; border-radius: 2px;
  padding: 12px 18px; cursor: pointer;
}
.btn:hover { background: var(--stop); }
.btn.ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--rule); }
.btn.ghost:hover { color: var(--stop); border-color: var(--stop); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.err { font-family: var(--mono); font-size: 13px; color: var(--stop); min-height: 1.2em; }
.ok { font-family: var(--mono); color: var(--ok); min-height: 1.2em; }
.hidden { display: none !important; }
.identity { font-family: var(--mono); font-size: 14px; color: var(--ink-2); }
.oauth-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.oauth-secondary .oauth-btn { flex: 1 1 140px; font-size: 13px; padding: 8px 10px; }
.oauth-btn { width: 100%; justify-content: center; text-align: center; }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0; color: var(--ink-3);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase;
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--rule);
}
#screenAuthReturn { display: none; }
html[data-auth-return="pending"] #screenAuthReturn,
html[data-auth-return="settling"] #screenAuthReturn {
  display: flex !important;
  position: fixed;
  inset: 0;
  z-index: 40;
  margin: 0;
  padding: 0;
  align-items: center;
  justify-content: center;
  background-color: var(--paper);
  pointer-events: none;
}
html[data-auth-return="pending"] #screenAuthReturn { pointer-events: auto; }
html[data-auth-return="settling"] #screenAuthReturn { background-color: transparent; }
html[data-auth-return="pending"] header,
html[data-auth-return="pending"] #shell { display: none !important; }
html[data-auth-return="settling"] #shell {
  animation: splash-desk-in 500ms ease both;
}
.splash-lockup {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  max-width: 22rem;
}
.splash-mark {
  display: inline-block;
  position: relative;
  margin: 0;
  transition: transform 600ms cubic-bezier(0.22, 0.8, 0.2, 1);
}
.splash-tagline {
  margin: 0;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  transition: opacity 240ms ease;
}
html[data-auth-return="pending"] .splash-mark .stop,
html[data-auth-return="settling"] .splash-mark .stop {
  animation: splash-period-pulse 1200ms ease-in-out infinite;
}
@keyframes splash-period-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}
html[data-auth-return="settling"] .splash-tagline { opacity: 0; }
@keyframes splash-desk-in {
  from { opacity: 0; clip-path: inset(50% 0 50% 0); }
  to { opacity: 1; clip-path: inset(0 0 0 0); }
}
@media (prefers-reduced-motion: reduce) {
  .splash-mark { transition: none; }
  html[data-auth-return="pending"] .splash-mark .stop,
  html[data-auth-return="settling"] .splash-mark .stop { animation: none; }
  html[data-auth-return="settling"] #shell { animation: none; }
}
