/*
 * The sign-in pages: the console's palette, type and radii (tokens.css), on a
 * neutral near-black page, so the mark above the form — a hull with the work
 * on its deck in the hues the field burns in — is the one colourful thing on it.
 */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  font-family: var(--font-ui);
  font-size: var(--fs-3);
  line-height: 1.5;
  background: var(--bg-0);
  color: var(--fg-1);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.stage {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(32px, 9vh, 96px) 20px 48px;
}

/* The hero: the mark, large and centred, riding a slow swell. */
.hero {
  width: 128px;
  height: 128px;
  animation: swell 7s ease-in-out infinite;
}
.mark {
  display: block;
  width: 100%;
  height: 100%;
}
@keyframes swell {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50%      { transform: translateY(-8px) rotate(1.5deg); }
}
@media (prefers-reduced-motion: reduce) {
  .hero { animation: none; }
}

.wordmark {
  margin: 14px 0 28px;
  font-size: var(--fs-6);
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--fg-0);
}

.card {
  width: min(100%, 380px);
  padding: 28px 28px 24px;
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: var(--r-4);
  box-shadow: var(--shadow-2);
}

h2 {
  font-size: var(--fs-5);
  font-weight: 600;
  color: var(--fg-0);
}
.lede {
  margin-top: 4px;
  color: var(--fg-2);
}
form { margin-top: 20px; }

.field + .field { margin-top: 14px; }
label {
  display: block;
  margin-bottom: 6px;
  font-size: var(--fs-2);
  font-weight: 500;
  color: var(--fg-1);
}
input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  font: inherit;
  color: var(--fg-0);
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  outline: none;
}
input::placeholder { color: var(--fg-3); }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.hint {
  margin-top: 6px;
  font-size: var(--fs-1);
  color: var(--fg-2);
}

.actions { margin-top: 22px; }
button { font: inherit; cursor: pointer; }
.primary {
  width: 100%;
  height: 40px;
  font-weight: 600;
  color: var(--bg-0);
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: var(--r-2);
}
.primary:hover, .primary:focus-visible { background: var(--accent-strong); outline: none; }
.primary:disabled { cursor: default; color: var(--fg-2); background: var(--bg-4); border-color: var(--line-2); }

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 18px;
  margin-top: 18px;
}
.link {
  padding: 0;
  font-size: var(--fs-2);
  color: var(--accent);
  background: none;
  border: none;
}
.link:hover, .link:focus-visible { color: var(--accent-strong); text-decoration: underline; outline: none; }

.banner {
  margin-bottom: 16px;
  padding: 10px 12px;
  font-size: var(--fs-2);
  color: var(--fg-0);
  background: var(--danger-soft);
  border: 1px solid var(--danger-line);
  border-radius: var(--r-2);
}

.choices { display: grid; gap: 10px; margin-top: 20px; }
.choice {
  height: 40px;
  color: var(--fg-1);
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
}
.choice:hover, .choice:focus-visible { color: var(--fg-0); background: var(--bg-4); border-color: var(--line-3); outline: none; }

.secret {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  padding: 12px;
  text-align: center;
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  border-radius: var(--r-2);
}
.secret code {
  font-family: var(--font-mono);
  font-size: var(--fs-3);
  color: var(--fg-0);
  word-break: break-all;
}
.secret a { font-size: var(--fs-2); color: var(--accent); }

.busy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 0;
  color: var(--fg-2);
}
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--line-3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
