/*
 * Auth pages (login, signup, forgot, success, password edit).
 * Two-column layout: decorative left + 460px form panel right.
 */

.auth {
  min-height: 100vh;
  display: flex;
  position: relative;
  overflow: hidden;
}

.auth__blobs { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.auth__blob {
  position: absolute;
  border-radius: 50%;
  animation: glow 7s ease-in-out infinite;
}
.auth__blob--a {
  width: 500px; height: 500px; top: -150px; left: -100px;
  background: radial-gradient(circle, rgba(99,102,241,0.18) 0%, transparent 70%);
}
.auth__blob--b {
  width: 400px; height: 400px; bottom: -100px; right: -80px;
  background: radial-gradient(circle, rgba(34,211,238,0.09) 0%, transparent 70%);
  animation-delay: 3s; animation-duration: 9s;
}

/* ── Decorative left panel ─────────────────────────────────── */
.auth__decoration {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  position: relative;
  z-index: 1;
}
.auth__cards {
  position: relative;
  width: 340px;
  height: 380px;
}
.auth__card {
  position: absolute;
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--color-border);
  background: var(--color-card);
}
.auth__card--back {
  top: 40px; left: 20px; right: -20px;
  background: var(--color-card-alt);
  animation: float 6s ease-in-out infinite 1s;
}
.auth__card--front {
  bottom: 0; left: 0; right: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  animation: float 5s ease-in-out infinite;
}
.auth__lb-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--color-border);
}
.auth__lb-row--last { border-bottom: none; }
.auth__lb-rank { width: 20px; font-size: 14px; font-weight: 800; }
.auth__lb-team { flex: 1; font-size: 13px; color: var(--color-text); font-weight: 500; }
.auth__lb-score { font-size: 14px; font-weight: 800; }
.auth__opt {
  background: var(--color-card-alt);
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text-muted);
}
.auth__opt--correct { background: rgba(16, 185, 129, 0.13); border-color: var(--color-success); color: var(--color-text); font-weight: 600; }
.auth__opt-letter {
  width: 24px; height: 24px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 12px;
}
.auth__opt--correct .auth__opt-letter { background: var(--color-success) !important; }

.auth__tagline { margin-top: 40px; text-align: center; }
.auth__tagline h2 { font-size: 28px; font-weight: 800; letter-spacing: -1px; }
.auth__tagline p { font-size: 15px; color: var(--color-text-faint); margin-top: 8px; line-height: 1.6; }

@media (max-width: 880px) {
  .auth__decoration { display: none; }
}

/* ── Right form panel ──────────────────────────────────────── */
.auth__panel {
  width: 460px;
  flex-shrink: 0;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border-subtle);
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  min-height: 100vh;
}
@media (max-width: 880px) {
  .auth__panel { width: 100%; border-left: none; padding: 32px 24px; }
}

.auth__brand { margin-bottom: 32px; }

.auth__heading { margin-bottom: 24px; }
.auth__heading h1 { font-size: 26px; font-weight: 700; color: var(--color-text); }
.auth__heading p { font-size: 14px; color: var(--color-text-faint); margin-top: 4px; }

.auth__form { display: flex; flex-direction: column; gap: 20px; }

.auth__divider {
  display: flex; align-items: center; gap: 12px;
  margin-top: 8px;
}
.auth__divider span { font-size: 13px; color: #4B5563; }
.auth__divider hr { flex: 1; border: 0; height: 1px; background: var(--color-border-subtle); }

.auth__sso { display: flex; gap: 10px; }
.auth__sso button {
  flex: 1;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 11px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 14px; font-weight: 500;
  color: var(--color-text-muted);
  cursor: not-allowed;
  opacity: 0.7;
}

.auth__switch {
  text-align: center;
  font-size: 14px;
  color: var(--color-text-faint);
  margin-top: 4px;
}
.auth__switch a, .auth__switch button {
  background: none;
  border: none;
  color: var(--color-accent);
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}

.auth__forgot {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-accent);
}

.auth__finepri {
  margin-top: auto;
  padding-top: 32px;
  font-size: 12px;
  color: var(--color-border);
  text-align: center;
}
.auth__finepri a { color: var(--color-text-faint); }

/* Field stack: 6px gap label/input */
.auth__field { display: flex; flex-direction: column; gap: 6px; }
.auth__field label { font-size: 13px; font-weight: 600; color: var(--color-text-muted); }

/* Submit button shows a spinner when its form is submitted */
.auth__submit { position: relative; }
.auth__submit[data-loading="true"] .auth__submit-text { opacity: 0; }
.auth__submit-spinner {
  position: absolute;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
  display: none;
}
.auth__submit[data-loading="true"] .auth__submit-spinner { display: block; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes glow { 0%,100% { opacity: 0.35; } 50% { opacity: 0.65; } }

/* ── Success state (forgot-password completion) ───────────── */
.auth__success {
  text-align: center;
}
.auth__success__emoji { font-size: 52px; margin-bottom: 16px; }
.auth__success h2 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.auth__success p { font-size: 15px; color: var(--color-text-faint); margin-bottom: 32px; }

/* ── Flash messages ───────────────────────────────────────── */
.auth__flash {
  border-radius: var(--radius-button);
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 16px;
  border: 1px solid;
}
.auth__flash--alert  { background: rgba(239, 68, 68, 0.08); color: var(--color-danger); border-color: rgba(239, 68, 68, 0.27); }
.auth__flash--notice { background: rgba(16, 185, 129, 0.08); color: var(--color-success); border-color: rgba(16, 185, 129, 0.27); }
