/* ─── CSS Variables & Reset ─────────────────────────────────────────────── */
:root {
  --bg-primary: #0d0d0d;
  --bg-secondary: #141414;
  --bg-card: #1a1a1a;
  --bg-card-hover: #222222;
  --bg-input: #151515;
  --border-color: #2a2a2a;
  --border-focus: #e84545;
  --text-primary: #f5f0eb;
  --text-secondary: #a8a096;
  --text-muted: #6b6560;
  --accent: #e84545;
  --accent-hover: #c93030;
  --accent-glow: rgba(232, 69, 69, 0.3);
  --accent-secondary: #ff8c42;
  --accent-secondary-hover: #e67830;
  --success: #4caf50;
  --success-bg: rgba(76, 175, 80, 0.1);
  --danger: #e84545;
  --gradient-1: linear-gradient(135deg, #e84545, #ff8c42);
  --gradient-2: linear-gradient(135deg, #ff8c42, #e84545);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ─── Particles Background ─────────────────────────────────────────────── */
.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particles::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 69, 69, 0.08) 0%, transparent 70%);
  top: -200px;
  right: -200px;
  animation: float 20s ease-in-out infinite;
}

.particles::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 140, 66, 0.06) 0%, transparent 70%);
  bottom: -150px;
  left: -150px;
  animation: float 25s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* ─── Page Wrapper ─────────────────────────────────────────────────────── */
.page-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Navbar ───────────────────────────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(13, 13, 13, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-logo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
}

.nav-icon {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 0.5rem;
}

.nav-link {
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  color: var(--accent);
  background: rgba(232, 69, 69, 0.1);
}

/* ─── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 15px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 25px var(--accent-glow);
  transform: translateY(-2px);
}

.btn-discord {
  background: #5865f2;
  color: white;
  box-shadow: 0 2px 15px rgba(88, 101, 242, 0.3);
}

.btn-discord:hover {
  background: #4752c4;
  box-shadow: 0 4px 25px rgba(88, 101, 242, 0.4);
  transform: translateY(-2px);
}

.btn-lg {
  padding: 0.875rem 2rem;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
}

.btn-full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* ─── Hero Section ─────────────────────────────────────────────────────── */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6rem 4rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
  gap: 4rem;
}

.hero-content {
  flex: 1;
  max-width: 600px;
}

.hero-badge {
  display: inline-block;
  padding: 0.375rem 1rem;
  background: rgba(255, 140, 66, 0.12);
  color: var(--accent-secondary);
  border: 1px solid rgba(255, 140, 66, 0.25);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.gradient-text {
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 480px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
}

/* Floating Cards */
.hero-graphic {
  flex: 0 0 320px;
  position: relative;
  height: 360px;
}

.floating-card {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-md);
  animation: cardFloat 6s ease-in-out infinite;
}

.floating-card .card-icon {
  font-size: 2rem;
}

.floating-card .card-text {
  font-weight: 600;
  font-size: 1.1rem;
}

.card-1 {
  top: 0;
  left: 0;
  animation-delay: 0s;
}

.card-2 {
  top: 120px;
  right: 0;
  animation-delay: -2s;
}

.card-3 {
  bottom: 0;
  left: 30px;
  animation-delay: -4s;
  border-color: rgba(255, 140, 66, 0.3);
}

@keyframes cardFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* ─── How It Works ─────────────────────────────────────────────────────── */
.how-it-works {
  padding: 4rem 2rem 6rem;
  max-width: 1000px;
  margin: 0 auto;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 3rem;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: var(--transition);
}

.step-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gradient-1);
  color: white;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.step-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.step-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ─── Apply Section ────────────────────────────────────────────────────── */
.apply-section {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3rem 2rem 4rem;
}

.apply-container {
  width: 100%;
  max-width: 680px;
}

.apply-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.apply-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.apply-header p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Login Box */
.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 3rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.discord-logo {
  margin-bottom: 1.5rem;
}

.login-box h2 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.login-box p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* User Info */
.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1.5rem;
  padding: 1rem 1.5rem;
  background: rgba(232, 69, 69, 0.1);
  border: 1px solid rgba(232, 69, 69, 0.2);
  border-radius: var(--radius-md);
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--accent);
}

.user-info h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.user-tag {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ─── Application Form ─────────────────────────────────────────────────── */
.application-form {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.label-icon {
  margin-right: 0.25rem;
}

.form-group input[type="text"],
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
  resize: vertical;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Checkbox */
.checkbox-group {
  margin-top: 0.5rem;
}

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-weight: 500 !important;
  color: var(--text-secondary) !important;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-input);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
  content: '✓';
  color: white;
  font-size: 14px;
  font-weight: 700;
}

.required {
  color: var(--danger);
}

/* Form Actions */
.form-actions {
  margin-top: 2rem;
}

/* ─── Success Section ──────────────────────────────────────────────────── */
.success-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 3rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.success-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: bounce 1s ease-in-out;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  30% { transform: translateY(-20px); }
  60% { transform: translateY(-10px); }
}

.success-box h1 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.success-box > p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 450px;
  margin-left: auto;
  margin-right: auto;
}

.success-details {
  text-align: left;
  margin-bottom: 2rem;
  background: rgba(255, 140, 66, 0.05);
  border: 1px solid rgba(255, 140, 66, 0.15);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.success-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.success-item:last-child {
  border-bottom: none;
}

.success-label {
  font-weight: 600;
  font-size: 0.9rem;
}

.success-item span:last-child {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ─── Callback / Loading ───────────────────────────────────────────────── */
.callback-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
  gap: 1rem;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.callback-container h2 {
  font-size: 1.5rem;
}

.callback-container p {
  color: var(--text-secondary);
}

/* ─── Error / Toast ────────────────────────────────────────────────────── */
.error-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--danger);
  color: white;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.95rem;
  box-shadow: 0 4px 20px rgba(232, 69, 69, 0.4);
  z-index: 1000;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 90vw;
  text-align: center;
}

.error-toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ─── Footer ───────────────────────────────────────────────────────────── */
.footer {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

/* ─── Loading Spinner for button ───────────────────────────────────────── */
.btn-loading {
  position: relative;
  color: transparent !important;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ─── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero {
    flex-direction: column;
    padding: 3rem 1.5rem 2rem;
    text-align: center;
    gap: 2rem;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-graphic {
    display: none;
  }

  .steps-grid {
    grid-template-columns: 1fr 1fr;
  }

  .navbar {
    padding: 0.75rem 1rem;
  }

  .application-form {
    padding: 1.5rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .login-box {
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .steps-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: 2rem;
  }
}
