/* ── Variables ─────────────────────────────────────────────────────────────── */

:root {
  --bg: #0a0a0b;
  --surface: #141416;
  --border: #2a2a2e;
  --text: #e4e4e7;
  --text-muted: #71717a;
  --accent: #818cf8;
  --accent-hover: #6366f1;
  --accent-dim: rgba(129, 140, 248, 0.15);
  --green: #4ade80;
  --red: #f87171;
  --yellow: #fbbf24;
}

/* ── Reset & Base ─────────────────────────────────────────────────────────── */

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

body {
  font-family: "SF Mono", "Fira Code", "JetBrains Mono", ui-monospace, monospace;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Layout ───────────────────────────────────────────────────────────────── */

.page-centered {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Card ─────────────────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem;
  max-width: 480px;
  width: 100%;
  text-align: center;
}

.card h1 { font-size: 1.5rem; margin-bottom: 0.5rem; }

.card .logo { margin-bottom: 1.5rem; }

.card .subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 2rem;
  line-height: 1.5;
}

.card .tagline {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.card .message {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.card-lg {
  max-width: 520px;
  padding: 3rem 2.5rem;
}

.card-lg h1 { font-size: 2rem; }

/* ── Button ───────────────────────────────────────────────────────────────── */

.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover { opacity: 0.9; }

/* ── Back Link ────────────────────────────────────────────────────────────── */

.back { margin-top: 1.5rem; }

.back a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
}

/* ── Auth Components ──────────────────────────────────────────────────────── */

.username { color: var(--accent); }

.checkmark {
  font-size: 3rem;
  color: var(--green);
  margin-bottom: 1rem;
}

.instructions {
  margin-top: 1.5rem;
  text-align: left;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.token-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem;
  margin: 1rem 0;
  font-size: 0.75rem;
  word-break: break-all;
  color: var(--green);
  cursor: pointer;
  position: relative;
}

.token-box:hover::after {
  content: 'Click to copy';
  position: absolute;
  top: -24px;
  right: 0;
  font-size: 0.65rem;
  color: var(--text-muted);
}

.error {
  color: var(--red);
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

.form-group { margin-bottom: 1.5rem; }

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  text-align: center;
  letter-spacing: 0.1em;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
}

.install-hint {
  margin-top: 2rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.6;
}

.install-hint code {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-top: 0.75rem;
  color: var(--accent);
  font-size: 0.8rem;
}

/* ── Toast ─────────────────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--green);
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  color: var(--green);
  font-size: 0.85rem;
  z-index: 1000;
  animation: toast-fade 4s ease-in-out forwards;
}

@keyframes toast-fade {
  0% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  10% { opacity: 1; transform: translateX(-50%) translateY(0); }
  80% { opacity: 1; }
  100% { opacity: 0; }
}
