/* ───── Variables ───── */
:root {
  --bg-deep: #06060f;
  --bg-card: rgba(255, 255, 255, 0.03);
  --text-primary: #eaeaf5;
  --text-secondary: #7a7a9d;
  --text-tertiary: #52526e;
  --gradient-start: #6366f1;
  --gradient-mid: #8b5cf6;
  --gradient-end: #a855f7;
  --cyan: #22d3ee;
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(99, 102, 241, 0.3);
  --glow: 0 0 40px rgba(99, 102, 241, 0.12);
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --max-width: 1060px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ───── Reset ───── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-primary);
  font-family: "Noto Sans SC", "PingFang SC", system-ui, sans-serif;
  background: var(--bg-deep);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p {
  margin: 0;
}

a {
  color: inherit;
}

/* ───── Dot grid overlay ───── */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.03) 1px,
    transparent 1px
  );
  background-size: 32px 32px;
  pointer-events: none;
}

/* ───── Animated gradient orbs ───── */
.mesh-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(
    circle,
    rgba(99, 102, 241, 0.14),
    transparent 70%
  );
  top: -200px;
  left: -150px;
  animation: orb-drift 20s ease-in-out infinite;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(
    circle,
    rgba(168, 85, 247, 0.12),
    transparent 70%
  );
  bottom: -100px;
  right: -100px;
  animation: orb-drift 25s ease-in-out infinite reverse;
}

.orb-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.07), transparent 70%);
  top: 45%;
  right: 15%;
  animation: orb-drift 18s ease-in-out infinite;
  animation-delay: -6s;
}

@keyframes orb-drift {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(50px, -30px) scale(1.08);
  }
  50% {
    transform: translate(-20px, 40px) scale(0.95);
  }
  75% {
    transform: translate(30px, -20px) scale(1.03);
  }
}

/* ───── Navigation ───── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(6, 6, 15, 0.72);
  border-bottom: 1px solid var(--border);
  opacity: 0;
  animation: fade-in 0.6s ease 0.05s forwards;
}

.nav > div {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 22px;
  text-decoration: none;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

@keyframes fade-in {
  to {
    opacity: 1;
  }
}

/* ───── Page layout ───── */
.page {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 100px 24px 56px;
}

/* ───── Hero ───── */
.hero {
  display: grid;
  gap: 20px;
  margin-bottom: 48px;
  text-align: center;
  justify-items: center;
}

.eyebrow {
  width: fit-content;
  padding: 6px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.15);
}

h1,
h2,
h3 {
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
}

h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  background: linear-gradient(160deg, #fff 30%, var(--text-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  max-width: 640px;
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-top: 8px;
}

/* ───── Buttons ───── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 26px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    background var(--transition),
    border-color var(--transition),
    opacity var(--transition);
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.35;
  transform: none !important;
  box-shadow: none !important;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 44px rgba(99, 102, 241, 0.45);
}

.btn-secondary {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-hover);
}

.btn-sm {
  padding: 10px 18px;
  font-size: 14px;
  border-radius: var(--radius-sm);
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ───── Feature cards ───── */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 40px;
}

.feature-card {
  padding: 28px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition:
    transform var(--transition),
    border-color var(--transition),
    box-shadow var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--glow);
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.1),
    rgba(168, 85, 247, 0.1)
  );
  border: 1px solid rgba(99, 102, 241, 0.12);
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  transition: border-color var(--transition);
}

.feature-card:hover .feature-icon {
  border-color: rgba(99, 102, 241, 0.3);
}

.feature-icon svg {
  width: 26px;
  height: 26px;
}

.feature-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 14.5px;
  line-height: 1.65;
}

/* ───── Generic card ───── */
.card {
  padding: 32px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  transition: border-color var(--transition);
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.card-title h3 {
  font-size: 22px;
}

.card-title p {
  margin-top: 8px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ───── Forms ───── */
.register-form {
  margin-top: 24px;
  display: grid;
  gap: 18px;
}

label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    background var(--transition);
}

input::placeholder {
  color: var(--text-tertiary);
}

input:focus {
  outline: none;
  border-color: var(--gradient-start);
  background: rgba(99, 102, 241, 0.04);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

/* ───── Stats grid ───── */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.admin-stats {
  margin-bottom: 0;
}

.stats article {
  padding: 22px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition:
    border-color var(--transition),
    transform var(--transition);
}

.stats article:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.stats h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stats p {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 14px;
}

/* ───── Invite page ───── */
.invite-box {
  margin-top: 20px;
  display: grid;
  gap: 12px;
}

.invite-box > p:first-child {
  font-size: 12px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.invite-box strong {
  font-family: "Space Grotesk", monospace;
  font-size: 2.6rem;
  letter-spacing: 0.12em;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.invite-link {
  overflow-wrap: anywhere;
  color: var(--text-tertiary);
  font-size: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  font-family: "Space Grotesk", monospace;
}

.verification-text {
  font-weight: 700;
  font-size: 16px;
  color: var(--cyan);
}

.invite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

/* ───── Admin - recent list ───── */
.recent-list {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
}

.recent-list li,
.recent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  transition:
    background var(--transition),
    border-color var(--transition);
}

.recent-list li:hover,
.recent-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}

.recent-contact {
  font-weight: 500;
  color: var(--text-primary);
}

.recent-time {
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ───── Feedback ───── */
.feedback {
  min-height: 1.5em;
  margin-top: 4px;
  font-size: 14px;
  color: var(--cyan);
}

/* ───── Footer ───── */
.footer {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto 32px;
  padding: 0 24px;
  color: var(--text-tertiary);
  font-size: 13px;
  text-align: center;
}

/* ───── Entrance animations ───── */
.animate {
  opacity: 0;
  transform: translateY(24px);
  animation: enter 0.8s var(--ease) forwards;
}

.hero {
  animation-delay: 0.1s;
}
.features {
  animation-delay: 0.2s;
}
#register {
  animation-delay: 0.3s;
}
#invite-panel {
  animation-delay: 0.25s;
}
.footer {
  animation-delay: 0.4s;
}

@keyframes enter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ───── Responsive ───── */
@media (max-width: 800px) {
  .page {
    padding-top: 80px;
  }

  .features,
  .stats {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 24px 20px;
  }

  .invite-box strong {
    font-size: 2rem;
  }

  .hero-actions,
  .invite-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn,
  .invite-actions .btn {
    width: 100%;
  }

  .recent-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* ───── Reward highlight ───── */
.reward-banner {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.08),
    rgba(168, 85, 247, 0.08)
  );
  border: 1px solid rgba(99, 102, 241, 0.15);
  text-align: center;
  margin-top: 20px;
}

.reward-amount {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.reward-rule {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
}

.reward-rule strong {
  color: var(--text-primary);
}

.reward-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 20px;
  text-align: center;
}

.reward-step {
  padding: 16px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.reward-step .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 13px;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: #fff;
  margin-bottom: 10px;
}

.reward-step p {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 800px) {
  .reward-steps {
    grid-template-columns: 1fr;
  }
}
