:root {
  --bg: #07070a;
  --bg-2: #0b0b11;
  --panel: rgba(15, 15, 21, 0.72);
  --panel-solid: #0e0e14;
  --stroke: rgba(255, 255, 255, 0.075);
  --stroke-strong: rgba(255, 255, 255, 0.16);
  --text: #f2f2f6;
  --muted: #8b8b9b;
  --muted-2: #61616f;
  --accent: #7c5cff;
  --accent-2: #5865f2;
  --accent-glow: rgba(124, 92, 255, 0.45);
  --danger: #ff4d61;
  --ok: #2fe08a;
  --radius: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }

/* ---------- background ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  will-change: transform;
}
.blob-a {
  width: 46vw; height: 46vw; min-width: 380px; min-height: 380px;
  background: radial-gradient(circle at 30% 30%, #7c5cff, transparent 70%);
  top: -14vw; left: -8vw;
  animation: drift-a 26s var(--ease) infinite alternate;
}
.blob-b {
  width: 40vw; height: 40vw; min-width: 320px; min-height: 320px;
  background: radial-gradient(circle at 60% 40%, #3b2bff, transparent 70%);
  bottom: -16vw; right: -10vw;
  opacity: 0.4;
  animation: drift-b 32s var(--ease) infinite alternate;
}
.blob-c {
  width: 30vw; height: 30vw; min-width: 240px; min-height: 240px;
  background: radial-gradient(circle at 50% 50%, #c14cff, transparent 70%);
  top: 40%; left: 55%;
  opacity: 0.22;
  animation: drift-c 38s var(--ease) infinite alternate;
}

@keyframes drift-a {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(8vw, 6vh, 0) scale(1.15); }
}
@keyframes drift-b {
  0%   { transform: translate3d(0, 0, 0) scale(1.1); }
  100% { transform: translate3d(-7vw, -5vh, 0) scale(0.95); }
}
@keyframes drift-c {
  0%   { transform: translate3d(0, 0, 0) scale(0.9); }
  100% { transform: translate3d(-10vw, 8vh, 0) scale(1.2); }
}

.grid {
  position: absolute;
  inset: -40%;
  background-image:
    linear-gradient(rgba(255,255,255,0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.028) 1px, transparent 1px);
  background-size: 56px 56px;
  transform: perspective(600px) rotateX(52deg);
  mask-image: radial-gradient(ellipse 55% 45% at 50% 45%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 55% 45% at 50% 45%, #000 20%, transparent 75%);
  animation: grid-slide 22s linear infinite;
}
@keyframes grid-slide {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 0 56px, 56px 0; }
}

.noise {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- top bar ---------- */
.topbar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(18px, 4vw, 48px);
  animation: fade-down 0.7s var(--ease) both;
}

@keyframes fade-down {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(150deg, #7c5cff, #4a2fe0);
  color: #fff;
  box-shadow: 0 6px 22px -6px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.28);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}
.brand-mark svg { width: 19px; height: 19px; }
.brand:hover .brand-mark {
  transform: rotate(-8deg) scale(1.06);
  box-shadow: 0 10px 30px -6px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.4);
}

.brand-name { font-size: 17px; }
.brand-dot { color: var(--accent); }

.brand-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 4px 7px;
  border-radius: 6px;
  color: #b9aaff;
  background: rgba(124, 92, 255, 0.12);
  border: 1px solid rgba(124, 92, 255, 0.25);
}

.topnav { display: flex; align-items: center; gap: 6px; }
.topnav-link {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  padding: 9px 14px;
  border-radius: 9px;
  transition: color 0.25s, background 0.25s;
}
.topnav-link:hover { color: var(--text); background: rgba(255,255,255,0.05); }

.topnav-cta {
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 18px;
  margin-left: 6px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(180deg, rgba(124,92,255,0.95), rgba(88,101,242,0.95));
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 6px 20px -8px var(--accent-glow);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), filter 0.25s;
}
.topnav-cta:hover { transform: translateY(-1px); filter: brightness(1.1); box-shadow: 0 10px 26px -8px var(--accent-glow); }
.topnav-cta:active { transform: translateY(0) scale(0.98); }

/* ---------- stage ---------- */
.stage {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 18px 48px;
}

.card {
  position: relative;
  width: 100%;
  max-width: 448px;
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(26px) saturate(140%);
  -webkit-backdrop-filter: blur(26px) saturate(140%);
  border: 1px solid var(--stroke);
  box-shadow:
    0 30px 80px -30px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset,
    0 1px 0 rgba(255, 255, 255, 0.06) inset;
  padding: 34px clamp(22px, 5vw, 36px) 32px;
  overflow: hidden;
  animation: card-in 0.75s var(--ease) both 0.1s;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(22px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(150deg, rgba(124,92,255,0.4), transparent 35%, transparent 65%, rgba(88,101,242,0.22));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.8;
}

.card.shake { animation: shake 0.45s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}

/* ---------- views ---------- */
.view { display: none; }
.view.is-active { display: block; animation: view-in 0.45s var(--ease) both; }
@keyframes view-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.pane-head { position: relative; text-align: center; margin-bottom: 26px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #b6aaff;
  background: rgba(124, 92, 255, 0.1);
  border: 1px solid rgba(124, 92, 255, 0.22);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.pill-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(47, 224, 138, 0.6);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(47, 224, 138, 0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(47, 224, 138, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 224, 138, 0); }
}

.title {
  margin: 0 0 10px;
  font-size: clamp(24px, 5.2vw, 29px);
  line-height: 1.16;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.title.sm { font-size: 22px; letter-spacing: -0.025em; text-align: left; }

.grad {
  background: linear-gradient(100deg, #a996ff, #5865f2 55%, #c14cff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sub {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
  text-align: left;
}
.pane-head .sub { text-align: center; max-width: 340px; margin: 0 auto; }

.back {
  position: absolute;
  left: -10px; top: -4px;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.25s, background 0.25s, border-color 0.25s, transform 0.25s var(--ease);
}
.back svg { width: 18px; height: 18px; }
.back:hover { color: var(--text); background: rgba(255,255,255,0.06); border-color: var(--stroke); }
.back:active { transform: scale(0.94); }

/* ---------- features ---------- */
.feat {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: grid;
  gap: 9px;
}
.feat li {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 13.5px;
  color: #c7c7d4;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.022);
  border: 1px solid var(--stroke);
  transition: transform 0.3s var(--ease), background 0.3s, border-color 0.3s;
}
.feat li:hover {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--stroke-strong);
}
.feat-ico { color: var(--accent); font-size: 9px; }

/* ---------- fields ---------- */
.field { margin-bottom: 17px; }

.field label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #a3a3b3;
  margin-bottom: 8px;
}
.req { color: var(--danger); }

.field input {
  width: 100%;
  height: 47px;
  padding: 0 15px;
  font-size: 14.5px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--stroke);
  border-radius: 11px;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.3s, background 0.25s;
}
.field input::placeholder { color: var(--muted-2); }
.field input:hover { border-color: var(--stroke-strong); }
.field input:focus {
  border-color: rgba(124, 92, 255, 0.65);
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.13), 0 0 24px -8px var(--accent-glow);
}
.field input.is-bad {
  border-color: rgba(255, 77, 97, 0.7);
  box-shadow: 0 0 0 4px rgba(255, 77, 97, 0.1);
}

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 46px; }

.pw-toggle {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 0; border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.pw-toggle svg { width: 17px; height: 17px; }
.pw-toggle:hover { color: var(--text); background: rgba(255,255,255,0.06); }

.forgot {
  display: inline-block;
  font-size: 12.5px;
  color: #8f7dff;
  margin: -4px 0 18px;
  transition: color 0.2s;
}
.forgot:hover { color: #b4a5ff; text-decoration: underline; text-underline-offset: 3px; }

.form-error {
  display: none;
  margin: 0 0 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: #ff8092;
  padding: 9px 12px;
  border-radius: 9px;
  background: rgba(255, 77, 97, 0.08);
  border: 1px solid rgba(255, 77, 97, 0.25);
  animation: view-in 0.3s var(--ease) both;
}
.form-error.show { display: block; }

/* ---------- buttons ---------- */
.btn {
  position: relative;
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s var(--ease), box-shadow 0.3s var(--ease), filter 0.25s;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #8a6cff 0%, #6350e8 45%, #4b3ecf 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 12px 30px -12px rgba(124, 92, 255, 0.85), inset 0 1px 0 rgba(255,255,255,0.22);
}
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.28) 48%, transparent 62%);
  transform: translateX(-120%);
  transition: transform 0.75s var(--ease);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 42px -14px rgba(124, 92, 255, 1), inset 0 1px 0 rgba(255,255,255,0.3); }
.btn-primary:hover::after { transform: translateX(120%); }
.btn-primary:active { transform: translateY(0) scale(0.985); }
.btn-primary:focus-visible { outline: 2px solid #b4a5ff; outline-offset: 3px; }

.btn-ghost {
  margin-top: 10px;
  height: 44px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--stroke);
  font-weight: 500;
  font-size: 13px;
}
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,0.04); border-color: var(--stroke-strong); }
.btn-ghost:active { transform: scale(0.99); }

.btn-discord { width: 19px; height: 19px; flex: 0 0 auto; }

.btn.loading { pointer-events: none; filter: saturate(0.85); }
.btn.loading .btn-label { opacity: 0.35; }

.spinner {
  position: absolute;
  width: 19px; height: 19px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  opacity: 0;
  animation: spin 0.7s linear infinite;
  transition: opacity 0.2s;
}
.btn.loading .spinner { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  animation: ripple 0.65s var(--ease) forwards;
}
@keyframes ripple {
  to { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

.legal {
  margin: 16px 0 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted-2);
  text-align: center;
}
.legal a { color: #9a8cff; }
.legal a:hover { text-decoration: underline; }

/* ---------- otp ---------- */
.otp {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 9px;
  margin-bottom: 18px;
}
.otp input {
  height: 56px;
  width: 100%;
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--stroke);
  border-radius: 11px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.25s, transform 0.2s var(--ease);
}
.otp input:hover { border-color: var(--stroke-strong); }
.otp input:focus {
  border-color: rgba(124, 92, 255, 0.75);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.13), 0 0 24px -8px var(--accent-glow);
  transform: translateY(-2px);
}
.otp input.filled { border-color: rgba(124, 92, 255, 0.5); background: rgba(124, 92, 255, 0.08); }

/* ---------- trust ---------- */
.trust {
  margin-top: 26px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11.5px;
  color: var(--muted-2);
  animation: view-in 0.8s var(--ease) both 0.35s;
}
.trust-item { display: inline-flex; align-items: center; gap: 6px; }
.trust-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px rgba(47, 224, 138, 0.8);
}
.trust-sep { width: 1px; height: 12px; background: var(--stroke-strong); }

/* ---------- footer ---------- */
.foot {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(18px, 4vw, 48px);
  font-size: 11.5px;
  color: var(--muted-2);
  border-top: 1px solid rgba(255, 255, 255, 0.045);
}
.foot-links { display: flex; gap: 18px; }
.foot-links a { transition: color 0.2s; }
.foot-links a:hover { color: var(--text); }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .topnav-link { display: none; }
  .brand-badge { display: none; }
  .stage { padding-top: 18px; }
  .card { padding: 28px 20px 26px; border-radius: 18px; }
  .trust { font-size: 10.5px; gap: 10px; flex-wrap: wrap; justify-content: center; }
  .foot { flex-direction: column; gap: 10px; }
  .otp { gap: 7px; }
  .otp input { height: 50px; font-size: 18px; }
}

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