:root {
  --navy: #0B111E;
  --charcoal: #111827;
  --cyan: #22D3EE;
  --violet: #7C3AED;
  --glass-bg: rgba(15, 23, 42, 0.40);
  --glass-bg-soft: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --text-muted: #94A3B8;
  --text-body: #E5E7EB;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(160deg, #0B111E 0%, #0D1420 45%, #111827 100%);
  font-family: 'Inter', sans-serif;
  color: var(--text-body);
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}
h1, h2, h3, h4 { font-family: 'Plus Jakarta Sans', sans-serif; margin: 0; }
p { margin: 0; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; }
input { font-family: inherit; }

/* ---------- Ambient blobs ---------- */
.blob {
  position: absolute;
  border-radius: 9999px;
  filter: blur(90px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}
.blob-cyan { background: radial-gradient(circle, var(--cyan) 0%, rgba(34,211,238,0) 70%); }
.blob-violet { background: radial-gradient(circle, var(--violet) 0%, rgba(124,58,237,0) 70%); }
@keyframes float-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -60px) scale(1.08); }
}
@keyframes float-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-50px, 50px) scale(1.05); }
}
.anim-float-a { animation: float-a 18s ease-in-out infinite; }
.anim-float-b { animation: float-b 22s ease-in-out infinite; }

/* ---------- Glass ---------- */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}
.glass-border-gradient { position: relative; }
.glass-border-gradient::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0) 60%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ---------- Logo ---------- */
.auth-header {
  position: relative;
  z-index: 10;
  padding: 28px 20px 0;
  display: flex;
  justify-content: center;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px 2px rgba(34,211,238,0.8);
}
.logo-text {
  font-weight: 800;
  color: #fff;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.logo-text span { color: var(--cyan); }

/* ---------- Auth card wrapper ---------- */
.auth-main {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 60px;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  border-radius: 24px;
  padding: 40px 36px;
}
.auth-eyebrow {
  letter-spacing: 0.18em;
  font-size: 11px;
  font-weight: 600;
  color: var(--cyan);
  text-transform: uppercase;
  display: block;
  text-align: center;
  margin-bottom: 12px;
}
.auth-title {
  font-weight: 800;
  color: #fff;
  font-size: 1.7rem;
  text-align: center;
  letter-spacing: -0.01em;
}
.auth-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  margin-top: 10px;
  line-height: 1.55;
}

/* ---------- Form ---------- */
form.auth-form { margin-top: 32px; }
.field { position: relative; margin-bottom: 18px; }
.field input {
  width: 100%;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  padding: 22px 16px 9px 16px;
  color: #F1F5F9;
  outline: none;
  font-size: 15px;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.field input:focus {
  border-color: rgba(34,211,238,0.55);
  background: rgba(34,211,238,0.04);
}
.field input.input-error {
  border-color: rgba(248,113,113,0.6);
}
.field label {
  position: absolute;
  left: 16px;
  top: 17px;
  color: #94A3B8;
  font-size: 0.95rem;
  pointer-events: none;
  transition: all 0.18s ease;
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label {
  top: 7px;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--cyan);
  text-transform: uppercase;
}

.field-hint {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 6px;
  margin-left: 4px;
}

.btn {
  display: inline-block;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 1rem 1.75rem;
  border-radius: 9999px;
  text-align: center;
}
.btn-full { width: 100%; }
.btn-primary {
  background: linear-gradient(135deg, #22D3EE 0%, #0EA5E9 100%);
  color: var(--navy);
  box-shadow: 0 8px 24px -6px rgba(34, 211, 238, 0.55);
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}
.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 12px 30px -6px rgba(34, 211, 238, 0.7);
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.auth-switch {
  text-align: center;
  margin-top: 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.auth-switch a {
  color: var(--cyan);
  font-weight: 600;
}
.auth-switch a:hover { text-decoration: underline; }

.form-message {
  margin-top: 18px;
  font-size: 0.85rem;
  text-align: center;
  line-height: 1.5;
  min-height: 1.2em;
}
.form-message.error { color: #f87171; }
.form-message.success { color: var(--cyan); }

/* ---------- Dashboard (My Leaderboard stub) ---------- */
.dash-header {
  position: relative;
  z-index: 10;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}
.dash-logout {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.14);
  color: #cbd5e1;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 9999px;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.dash-logout:hover {
  border-color: rgba(255,255,255,0.3);
  color: #fff;
}
.dash-main {
  position: relative;
  z-index: 10;
  flex: 1;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
  padding: 40px 20px 80px;
}
.dash-card {
  border-radius: 24px;
  padding: 48px 40px;
  text-align: center;
}
.dash-eyebrow {
  letter-spacing: 0.18em;
  font-size: 11px;
  font-weight: 600;
  color: var(--cyan);
  text-transform: uppercase;
}
.dash-title {
  font-weight: 800;
  color: #fff;
  font-size: 1.9rem;
  margin-top: 14px;
  letter-spacing: -0.01em;
}
.dash-sub {
  color: var(--text-muted);
  margin-top: 14px;
  line-height: 1.6;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.dash-loading {
  text-align: center;
  color: var(--text-muted);
  padding: 80px 20px;
}

@media (max-width: 480px) {
  .auth-card { padding: 32px 22px; }
  .dash-card { padding: 36px 22px; }
}
