/* ═══════════════ Trivia Rumble — auth page ═══════════════ */
/* Tokens come from tokens.css. Layout implements the Auth board. */

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Outfit", system-ui, sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(1100px 700px at 85% -10%, oklch(0.30 0.06 25 / 0.55), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, oklch(0.28 0.05 255 / 0.45), transparent 60%);
  color: var(--ink);
  min-height: 100dvh;
  overflow-x: hidden;
}
a { color: var(--gold); text-decoration: none; }

.auth-wrap {
  width: 100%; max-width: 430px; margin: 0 auto;
  min-height: 100dvh; padding: 20px 20px 32px;
  display: flex; flex-direction: column; gap: 22px;
}
@media (min-width: 700px) {
  .auth-wrap { padding-top: 56px; padding-bottom: 88px; }
}

/* ─────────── chrome ─────────── */
.auth-chrome { display: flex; align-items: center; justify-content: space-between; }
.brand-tiles { display: flex; gap: 4px; }
.brand-tiles i { width: 16px; height: 16px; border-radius: 5px; }
.brand-tiles .t-coral { background: var(--coral); }
.brand-tiles .t-amber { background: var(--amber); }
.brand-tiles .t-teal  { background: var(--teal); }
.brand-tiles .t-blue  { background: var(--blue); }
.auth-close {
  width: 44px; height: 44px; margin: -15px -15px -15px 0;
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px; color: var(--ink-dim);
  transition: color 0.2s;
}
.auth-close:hover { color: var(--ink); }

/* ─────────── headline ─────────── */
.auth-head { display: flex; flex-direction: column; gap: 8px; text-align: center; padding-top: 8px; }
.auth-head h1 {
  font-size: 34px; font-weight: 900; letter-spacing: -0.02em;
  text-transform: uppercase; line-height: 1;
}
.auth-sub { font-weight: 500; font-size: 15px; color: var(--ink-dim); line-height: 1.5; }

/* ─────────── tabs ─────────── */
.tabs { display: flex; gap: 6px; background: var(--bg-sink); border-radius: 12px; padding: 4px; }
.tab {
  flex: 1; min-height: 44px; border: 0; cursor: pointer; font: inherit;
  border-radius: 9px; padding: 10px 4px; font-weight: 700; font-size: 15px;
  text-align: center; background: transparent; color: var(--ink-dim);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.tab.is-active { background: var(--gold); color: var(--gold-ink); }

/* ─────────── avatar picker ─────────── */
#auth-form { display: flex; flex-direction: column; gap: 14px; }
.avatar-block { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.field-label { font-weight: 700; font-size: 14px; color: var(--ink-dim); }
.avatar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.avatar {
  aspect-ratio: 1; border: 0; padding: 0; cursor: pointer;
  border-radius: 14px; background: var(--bg-raise);
  display: grid; place-items: center; font-size: 24px;
  transition: transform 0.15s var(--ease), background 0.15s var(--ease);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.avatar:active { transform: scale(0.92); }
.avatar.is-selected {
  background: oklch(0.33 0.05 85); /* board-mandated selected fill, no token exists */
  box-shadow: inset 0 0 0 2px var(--gold);
}

/* ─────────── fields ─────────── */
.field { display: flex; flex-direction: column; gap: 8px; }
.input {
  background: var(--bg-sink); border: 2px solid var(--line); border-radius: var(--r-ctl);
  padding: 14px 16px; font: inherit; font-weight: 600; font-size: 17px;
  color: var(--ink); outline: none; width: 100%;
}
.input::placeholder { color: oklch(0.5 0.02 60); }
.input:focus { border-color: var(--gold); }

/* log in tab hides signup-only bits */
#auth-form[data-mode="login"] .signup-only { display: none; }

/* ─────────── buttons ─────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-weight: 800; letter-spacing: 0.01em; border: 0; cursor: pointer;
  border-radius: var(--r-ctl); padding: 14px 24px; font-size: 1.05rem;
  color: var(--gold-ink); background: var(--gold); box-shadow: 0 4px 0 var(--gold-edge);
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), filter 0.2s;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(3px) scale(0.99); box-shadow: 0 1px 0 var(--gold-edge); }
.btn:disabled { opacity: 0.7; cursor: default; filter: none; transform: none; }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); font-weight: 700; }
.btn-ghost:active { transform: scale(0.98); box-shadow: inset 0 0 0 2px var(--line); }

.btn-submit { width: 100%; padding: 17px; font-size: 18px; }

.btn-google {
  width: 100%; padding: 15px; font-size: 16px; gap: 10px;
  opacity: 0.55; pointer-events: none;
}
.g-icon {
  width: 22px; height: 22px; border-radius: 7px;
  background: var(--bg-sink); box-shadow: inset 0 0 0 2px var(--line);
  display: grid; place-items: center;
  font-weight: 800; font-size: 13px; color: var(--ink-dim);
}

/* ─────────── error panel ─────────── */
.error-panel {
  background: oklch(0.32 0.09 25); color: oklch(0.9 0.05 25);
  border-radius: 12px; padding: 10px 14px; font-weight: 600; font-size: 0.95rem;
}
.error-panel.shake { animation: shake 0.4s var(--ease); }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ─────────── divider + guest link ─────────── */
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-dim); font-size: 13px; font-weight: 600; }
.divider span { flex: 1; height: 2px; background: var(--line); border-radius: 1px; }

.guest-link {
  display: flex; align-items: center; justify-content: center; min-height: 44px;
  text-align: center; font-weight: 600; font-size: 14px; color: var(--ink-dim);
  transition: color 0.2s;
}
.guest-link:hover { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
