*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6366f1;
  --primary-hover: #5558e6;
  --primary-glow: rgba(99, 102, 241, 0.18);
  --discord: #5865f2;
  --discord-hover: #4752c4;
  --discord-glow: rgba(88, 101, 242, 0.18);
  --green: #22c55e;
  --red: #ef4444;

  --bg: #07080e;
  --bg-card: #11131f;
  --bg-input: #03040a;
  --bg-hover: #0c0e19;

  --border: #1e2440;
  --border-light: #2a3155;

  --text: #edf2f7;
  --text-muted: #6b7394;
  --text-dim: #3d4363;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --content-width: 640px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(99, 102, 241, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(168, 85, 247, 0.03) 0%, transparent 50%);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

::selection {
  background: rgba(99, 102, 241, 0.3);
  color: #fff;
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

/* ========== HEADER ========== */

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(7, 8, 14, 0.8);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(30, 36, 64, 0.5);
}

nav {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 0.25rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-xs);
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav-links a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ========== SCROLL MARGIN ========== */

#discord-cards {
  scroll-margin-top: 5rem;
}

/* ========== HERO ========== */

.hero {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 7rem 1.5rem 4rem;
  text-align: center;
  animation: fadeInUp 0.7s ease both;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(99, 102, 241, 0.05));
  border: 1px solid rgba(99, 102, 241, 0.15);
  color: #818cf8;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  margin-bottom: 1.5rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  animation: fadeInUp 0.7s 0.1s both;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 1rem;
  animation: fadeInUp 0.7s 0.15s both;
}

.hero-sub {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 2.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  animation: fadeInUp 0.7s 0.2s both;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 3rem;
  animation: fadeInUp 0.7s 0.25s both;
}

.hero-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  animation: fadeInUp 0.7s 0.3s both;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== DIVIDER ========== */

.divider {
  max-width: var(--content-width);
  margin: 0 auto;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(30, 36, 64, 0.5), transparent);
}

/* ========== SECTION ========== */

.section {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 4.5rem 1.5rem;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.section.revealed {
  opacity: 1;
  transform: translateY(0);
}

.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(99, 102, 241, 0.04));
  color: #818cf8;
  margin-bottom: 0.75rem;
}

.section-icon.discord-icon {
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.12), rgba(88, 101, 242, 0.04));
  color: #8b94f7;
}

.section-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.375rem;
}

.section-header p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ========== FORM ========== */

.form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.form:focus-within {
  border-color: rgba(99, 102, 241, 0.2);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.04);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  transition: color 0.25s;
  padding-left: 0.25rem;
}

.form-group input,
.form-group textarea {
  background: var(--bg-input);
  border: 1.5px solid #262d55;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  color: var(--text);
  font-size: 0.925rem;
  font-family: inherit;
  transition: border-color 0.25s, box-shadow 0.3s, background 0.2s;
  caret-color: var(--primary);
  box-shadow: inset 0 1.5px 3px rgba(0, 0, 0, 0.4);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #4a5278;
  font-weight: 400;
  font-size: 0.9rem;
}

.form-group input:hover,
.form-group textarea:hover {
  border-color: #3a4575;
  background: var(--bg-hover);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-hover);
  box-shadow:
    0 0 0 3px var(--primary-glow),
    0 0 16px var(--primary-glow),
    inset 0 1.5px 3px rgba(0, 0, 0, 0.4);
}

.form-group:focus-within label {
  color: var(--primary);
}

.form-group textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.5;
}

.form-group input:read-only {
  border-color: #374568;
  background: #0e1120;
  cursor: not-allowed;
  box-shadow: inset 3px 0 0 0 var(--discord);
}

.form-group input:read-only:focus {
  border-color: #374568;
  box-shadow:
    inset 3px 0 0 0 var(--discord),
    0 0 0 3px rgba(88, 101, 242, 0.1);
}

.form-group input:read-only:hover {
  border-color: #374568;
  background: #0e1120;
}

.input-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: var(--discord);
  opacity: 0.8;
  transition: opacity 0.3s;
}

.input-hint.hidden {
  display: none;
}

/* ========== BUTTONS ========== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s, box-shadow 0.25s;
  white-space: nowrap;
}

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

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn--primary {
  background: var(--primary);
  color: #fff;
}

.btn--primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.btn--primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn--discord {
  background: var(--discord);
  color: #fff;
}

.btn--discord:hover {
  background: var(--discord-hover);
  box-shadow: 0 4px 20px rgba(88, 101, 242, 0.35);
}

.btn--discord:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn--outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn--outline:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--text-muted);
}

.btn--full {
  width: 100%;
  padding: 0.85rem;
  font-size: 0.9rem;
}

.btn--full:not(:disabled):hover {
  transform: translateY(-1px);
}

.btn--full:active {
  transform: scale(0.97);
}

/* ========== DISCORD CARD ========== */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1.5rem;
  transition: border-color 0.25s;
}

.card.hidden {
  display: none;
}

.server-discord-card {
  border-color: #6366f1;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(99, 102, 241, 0.02));
}

.server-discord-card .discord-card-text h3 {
  color: #a5b4fc;
}

.card:hover {
  border-color: var(--border-light);
}

.discord-card-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.discord-card-text h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.discord-card-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ========== TOAST ========== */

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #181b2b;
  border: 1px solid var(--border-light);
  color: var(--text);
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.35s, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 200;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  border-color: rgba(34, 197, 94, 0.25);
  color: #4ade80;
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.25);
  color: #f87171;
}

/* ========== FOOTER ========== */

footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

.footer-content {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-dim);
  font-size: 0.75rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
}

/* ========== SPINNER ========== */

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========== RESPONSIVE ========== */

@media (prefers-reduced-motion: reduce) {
  body::after {
    opacity: 0;
  }

  .hero, .hero-badge, .hero h1, .hero-sub, .hero-actions, .hero-status {
    animation: none;
  }

  .section {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 5rem 1.25rem 3rem;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .hero-sub {
    font-size: 0.925rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .section {
    padding: 3rem 1.25rem;
  }

  .form {
    padding: 1.25rem;
  }

  .discord-card-content {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 400px) {
  nav {
    padding: 0 1rem;
  }

  .logo span {
    display: none;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .section-header h2 {
    font-size: 1.15rem;
  }

  .form-group input,
  .form-group textarea {
    padding: 0.75rem 0.85rem;
    font-size: 0.875rem;
  }
}
