/* ==========================================================================
   Waitlist Section Styles — Warm cream palette, editorial aesthetic
   ========================================================================== */

/* CSS Variables */
:root {
  --waitlist-bg: #faf9f7;
  --waitlist-surface: #ffffff;
  --waitlist-text: #1a1a1a;
  --waitlist-text-secondary: #4a4a4a;
  --waitlist-text-muted: #888888;
  --waitlist-accent: #d97706;
  --waitlist-accent-hover: #b45309;
  --waitlist-border: rgba(0, 0, 0, 0.08);
  --waitlist-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  --waitlist-radius: 8px;
  --waitlist-font-display: 'Space Mono', monospace;
  --waitlist-font-body: 'Satoshi', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --waitlist-bg: #0f0f0f;
    --waitlist-surface: #1a1a1a;
    --waitlist-text: #faf9f7;
    --waitlist-text-secondary: #a0a0a0;
    --waitlist-text-muted: #666666;
    --waitlist-border: rgba(255, 255, 255, 0.08);
    --waitlist-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }
}

/* Animations */
@keyframes waitlistSlideIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes waitlistPop {
  0% {
    transform: scale(0.95);
    opacity: 0;
  }
  70% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes waitlistPulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* Base Section */
.waitlist-section {
  background: var(--waitlist-bg);
  padding: 80px 24px;
  position: relative;
  overflow: hidden;
}

.waitlist-inner {
  max-width: 640px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Asymmetric layout — editorial aesthetic */
.waitlist-header {
  margin-bottom: 40px;
  animation: waitlistSlideIn 0.6s ease-out;
}

.waitlist-eyebrow {
  font-family: var(--waitlist-font-display);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--waitlist-accent);
  margin-bottom: 16px;
}

.waitlist-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 600;
  line-height: 1.1;
  color: var(--waitlist-text);
  margin: 0 0 16px;
}

.waitlist-subtitle {
  font-family: var(--waitlist-font-body);
  font-size: 18px;
  line-height: 1.6;
  color: var(--waitlist-text-secondary);
  margin: 0;
}

/* Form */
.waitlist-form {
  animation: waitlistSlideIn 0.6s ease-out 0.1s both;
}

.waitlist-field {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.waitlist-input {
  flex: 1;
  font-family: var(--waitlist-font-body);
  font-size: 16px;
  padding: 14px 18px;
  border: 1px solid var(--waitlist-border);
  border-radius: var(--waitlist-radius);
  background: var(--waitlist-surface);
  color: var(--waitlist-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.waitlist-input::placeholder {
  color: var(--waitlist-text-muted);
}

.waitlist-input:focus {
  outline: none;
  border-color: var(--waitlist-accent);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15);
}

.waitlist-button {
  font-family: var(--waitlist-font-body);
  font-size: 15px;
  font-weight: 600;
  padding: 14px 28px;
  background: var(--waitlist-accent);
  color: #ffffff;
  border: none;
  border-radius: var(--waitlist-radius);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  white-space: nowrap;
}

.waitlist-button:hover {
  background: var(--waitlist-accent-hover);
}

.waitlist-button:active {
  transform: scale(0.98);
}

.waitlist-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Error state */
.waitlist-error {
  font-family: var(--waitlist-font-body);
  font-size: 14px;
  color: #dc2626;
  margin-bottom: 16px;
  display: none;
  animation: waitlistSlideIn 0.3s ease-out;
}

.waitlist-error.visible {
  display: block;
}

/* Success state */
.waitlist-success {
  background: var(--waitlist-surface);
  border-radius: var(--waitlist-radius);
  padding: 32px;
  box-shadow: var(--waitlist-shadow);
  border: 1px solid var(--waitlist-border);
  animation: waitlistPop 0.5s ease-out;
}

.waitlist-success-icon {
  width: 48px;
  height: 48px;
  background: var(--waitlist-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.waitlist-success-icon svg {
  width: 24px;
  height: 24px;
  color: #ffffff;
}

.waitlist-success-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--waitlist-text);
  margin: 0 0 8px;
}

.waitlist-success-text {
  font-family: var(--waitlist-font-body);
  font-size: 16px;
  color: var(--waitlist-text-secondary);
  margin: 0 0 24px;
  line-height: 1.5;
}

.waitlist-position {
  font-family: var(--waitlist-font-display);
  font-size: 14px;
  color: var(--waitlist-text-muted);
  margin-bottom: 16px;
}

.waitlist-position strong {
  color: var(--waitlist-accent);
  font-size: 18px;
}

/* Referral code display */
.waitlist-referral {
  background: var(--waitlist-bg);
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.waitlist-referral-label {
  font-family: var(--waitlist-font-body);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--waitlist-text-muted);
  margin-bottom: 6px;
}

.waitlist-referral-code {
  font-family: var(--waitlist-font-display);
  font-size: 20px;
  color: var(--waitlist-accent);
  letter-spacing: 2px;
  word-break: break-all;
}

.waitlist-referral-link {
  font-family: var(--waitlist-font-body);
  font-size: 13px;
  color: var(--waitlist-text-muted);
  margin-top: 12px;
  word-break: break-all;
}

/* Referral stats */
.waitlist-stats {
  display: flex;
  gap: 24px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--waitlist-border);
}

.waitlist-stat {
  text-align: center;
}

.waitlist-stat-value {
  font-family: var(--waitlist-font-display);
  font-size: 24px;
  color: var(--waitlist-text);
  font-weight: 700;
}

.waitlist-stat-label {
  font-family: var(--waitlist-font-body);
  font-size: 12px;
  color: var(--waitlist-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

/* Loading state */
.waitlist-loading {
  display: none;
  align-items: center;
  gap: 10px;
  font-family: var(--waitlist-font-body);
  font-size: 14px;
  color: var(--waitlist-text-muted);
}

.waitlist-loading.visible {
  display: flex;
}

.waitlist-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--waitlist-border);
  border-top-color: var(--waitlist-accent);
  border-radius: 50%;
  animation: waitlistPulse 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 480px) {
  .waitlist-section {
    padding: 60px 16px;
  }

  .waitlist-field {
    flex-direction: column;
  }

  .waitlist-button {
    width: 100%;
  }

  .waitlist-success {
    padding: 24px;
  }

  .waitlist-stats {
    flex-direction: column;
    gap: 16px;
  }
}

@media (min-width: 768px) {
  .waitlist-section {
    padding: 100px 24px;
  }

  .waitlist-inner {
    max-width: 560px;
  }
}