/* ========================================
   Launch Screen Styles
   Dark-themed personalization screen
   Visually consistent with intro (v3) onboarding tour
   ======================================== */

/* ========================================
   Launch Screen Layout
   ======================================== */
.launch-screen {
  /* Dark theme tokens — match intro.css exactly */
  --launch-bg: #0a0f1a;
  --launch-bg-card: #151c2c;
  --launch-bg-elevated: #1e293b;
  --launch-primary: #10b981;
  --launch-primary-hover: #059669;
  --launch-text-primary: #f8fafc;
  --launch-text-secondary: #94a3b8;
  --launch-text-tertiary: #64748b;
  --launch-border: rgb(255 255 255 / 8%);
  --launch-border-active: rgb(16 185 129 / 40%);

  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding-top: 40px;
  padding-bottom: 40px;
  overflow-x: hidden;
  background: var(--launch-bg);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--launch-text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* Animation */
  opacity: 1;
  transition: opacity 300ms ease;
}

/* Decorative gradient orb — identical to intro.css */
.launch-screen::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(
    circle,
    rgb(16 185 129 / 15%) 0%,
    rgb(16 185 129 / 5%) 40%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

/* Hidden state for dismissing */
.launch-screen.is-hidden {
  opacity: 0;
  pointer-events: none;
}

/* Hide feedback button when launch overlay is active */
body.launch-overlay-active .feedback-sticky {
  display: none !important;
}

.launch-content {
  position: relative;
  z-index: 1;
  max-width: 360px;
  width: 100%;
  min-height: min(720px, calc(100dvh - 128px));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  margin-inline: auto;
  text-align: left;
  gap: 24px;

  /* Fade-in animation */
  animation: launch-fade-up 600ms ease-out forwards;
}

@keyframes launch-fade-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

/* ========================================
   Typography
   ======================================== */
.launch-eyebrow {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--launch-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0;
}

.launch-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.launch-hero-icon {
  height: 2.25rem;
  width: auto;
  flex-shrink: 0;
  filter: brightness(0) invert(1);
}

.launch-brand-name {
  font-family: Righteous, sans-serif;
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--launch-text-primary);
  margin: 0;
}

.launch-title {
  font-family: Righteous, sans-serif;
  font-size: clamp(2.5rem, 8vw, 3.75rem);
  font-weight: 400;
  line-height: 1.12;
  color: var(--launch-text-primary);
  text-transform: uppercase;
  max-width: 340px;
  margin: 0;
  text-align: left;
}

.launch-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  font-size: 1rem;
  line-height: 1.625;
  color: var(--launch-text-secondary);
  max-width: 380px;
}

.launch-body p {
  margin: 0;
}

.launch-social-proof {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--launch-primary);
}

.launch-highlight {
  display: block;
  color: var(--launch-text-primary);
  font-weight: 500;
  font-style: italic;
  background: var(--launch-bg-elevated);
  padding: 16px 20px;
  border-radius: 12px;
  margin-top: 8px;
}

.launch-location {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--launch-text-primary);
  margin-top: 8px;
}

/* ========================================
   Decorative Card (Visual Interest)
   ======================================== */
.launch-visual {
  position: relative;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 16 / 10;
  background: var(--launch-bg-card);
  border: 1px solid var(--launch-border);
  border-radius: 16px;
  display: flex;
  align-items: flex-end;
  padding: 20px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 50%);
}

.visual-brand {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--launch-text-primary);
  letter-spacing: -0.02em;
}

.visual-icon {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.visual-icon svg {
  width: 100%;
  height: 100%;
}

/* ========================================
   CTA Button
   ======================================== */
.launch-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 24px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--launch-bg);
  background: var(--launch-text-primary);
  border: 2px solid var(--launch-text-primary);
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  min-height: 44px;
  transition:
    background 150ms ease,
    transform 100ms ease;

  /* iOS Safari touch fixes */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}

.launch-cta:hover {
  background: rgb(255 255 255 / 90%);
  border-color: rgb(255 255 255 / 90%);
}

.launch-cta:active {
  transform: scale(0.98);
}

.launch-cta svg {
  width: 20px;
  height: 20px;
  transition: transform 150ms ease;
}

/* ========================================
   Desktop Enhancements (640px+)
   ======================================== */
@media (width >= 640px) {
  .launch-screen {
    padding: 40px;
  }

  .launch-content {
    max-width: 420px;
    gap: 32px;
  }

  .launch-title {
    font-size: clamp(2.75rem, 6vw, 4rem);
    max-width: 420px;
  }

  .launch-body {
    font-size: 1.125rem;
    max-width: 420px;
  }

  .launch-visual {
    max-width: 380px;
  }

  .launch-cta {
    padding: 16px 32px;
  }
}

/* ========================================
   Large Desktop (1024px+)
   ======================================== */
@media (width >= 1024px) {
  .launch-screen::before {
    width: 800px;
    height: 800px;
  }

  .launch-content {
    max-width: 640px;
  }

  .launch-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
  }
}

/* ========================================
   Personalization Flow
   Multi-step onboarding flow for first-time visitors
   ======================================== */

/* Flow container - holds all steps */
.launch-flow {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: clamp(420px, 62dvh, 560px);
  margin-inline: auto;
}

/* Each step slides in/out */
.launch-step {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  gap: 24px;
  opacity: 0;
  transform: translateX(30px);
  pointer-events: none;
  transition:
    opacity 300ms ease,
    transform 300ms ease;
}

.launch-step.is-active {
  position: relative;
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.launch-step.is-exiting {
  transform: translateX(-30px);
}

/* Progress indicator — fixed at bottom of screen */
.launch-progress {
  position: fixed;
  bottom: 24px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  z-index: 10000;
  transition: bottom 200ms ease;
}

/* Shift dots up when cookie/consent banner is visible */
body:has(.consent-banner--visible) .launch-progress {
  bottom: 80px;
}

.progress-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--launch-text-tertiary);
  transition:
    background 150ms ease,
    transform 150ms ease;
}

.progress-dot.is-completed {
  background: var(--launch-border-active);
}

.progress-dot.is-active {
  background: var(--launch-primary);
  transform: scale(1.2);
}

/* ========================================
   Shared bottom dot nav (launch-personalization)
   Mirrors the intro__nav / intro__dot pattern.
   ======================================== */
.launch-dots-nav {
  position: absolute;
  bottom: 24px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.launch-dots-nav.is-visible {
  opacity: 1;
}

.launch-dot {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--launch-text-tertiary);
  transition:
    background 150ms ease,
    transform 150ms ease;
}

.launch-dot.is-completed {
  background: var(--launch-border-active);
}

.launch-dot.is-active {
  background: var(--launch-primary);
  transform: scale(1.2);
}

/* Step title - same type family as the intro headings */
.step-title {
  font-family: Righteous, sans-serif;
  font-size: 1.875rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--launch-text-primary);
  margin: 0;
}

/* Option cards grid */
.options-grid {
  display: grid;
  gap: 12px;
  width: 100%;
}

/* Single-column for level selection */
.options-grid--levels {
  grid-template-columns: 1fr;
  max-width: 320px;
}

/* Single-column for event types */
.options-grid--types {
  grid-template-columns: 1fr;
  max-width: 320px;
}

/* Two-column for availability */
.options-grid--times {
  grid-template-columns: repeat(2, 1fr);
  max-width: 360px;
}

/* Option card button */
.option-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  padding: 16px 20px;
  min-height: 72px;
  background: var(--launch-bg-card);
  border: 2px solid var(--launch-border);
  border-radius: 12px;
  color: var(--launch-text-primary);
  font-size: 1rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    transform 150ms ease;

  /* iOS Safari touch fixes */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.option-card:hover {
  background: var(--launch-bg-elevated);
}

.option-card:active {
  transform: scale(0.98);
}

.option-card.is-selected {
  border-color: var(--launch-border-active);
  background: rgb(16 185 129 / 10%);
}

.option-card__label {
  width: 100%;
  font-weight: 600;
  text-align: left;
}

.option-card__hint {
  width: 100%;
  font-size: 0.875rem;
  color: var(--launch-text-secondary);
  text-align: left;
}

/* CTA group (primary + secondary buttons) */
.cta-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 320px;
  align-self: flex-start;
  margin-inline: 0;
}

/* Secondary CTA (outlined) */
.launch-cta--secondary {
  background: transparent;
  color: var(--launch-text-primary);
  border: 2px solid var(--launch-text-tertiary);
}

.launch-cta--secondary:hover {
  border-color: var(--launch-text-secondary);
  background: rgb(255 255 255 / 5%);
}

/* Skip link */
.launch-screen .skip-link {
  position: static;
  top: auto;
  left: auto;
  z-index: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  padding: 8px 16px;
  font-size: 0.875rem;
  color: var(--launch-text-tertiary);
  background: none;
  border: none;
  border-radius: 0;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: color 150ms ease;
}

.skip-link:hover {
  color: var(--launch-text-secondary);
}

/* Playful escape banner — shown at top of Step 1 only */
.launch-notify {
  position: fixed;
  top: max(env(safe-area-inset-top, 0px), 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 12px;
  background: rgb(255 255 255 / 6%);
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 100px;
  white-space: nowrap;
  font-size: 0.8125rem;
  color: var(--launch-text-secondary);
  backdrop-filter: blur(12px);
  transition:
    opacity 250ms ease,
    transform 250ms ease;
}

.launch-notify.is-hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(-8px);
  pointer-events: none;
}

.launch-notify__text {
  font-size: 0.8125rem;
}

.launch-notify__btn {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--launch-primary);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 150ms ease;
}

.launch-notify__btn:hover {
  color: var(--launch-primary-hover);
}

/* Back button — matches intro arrow visual style */
.launch-back-btn {
  position: fixed;
  z-index: 10;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 26px);
  left: clamp(12px, 4vw, 16px);
  display: none; /* shown/hidden by goToStep() */
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--launch-border-active);
  background: rgb(10 15 26 / 94%);
  color: var(--launch-text-secondary);
  cursor: pointer;
  box-shadow: 0 8px 24px rgb(0 0 0 / 25%);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition:
    color 150ms ease,
    background 150ms ease,
    border-color 150ms ease;
}

.launch-back-btn:hover,
.launch-back-btn:focus-visible {
  color: var(--launch-text-primary);
  background: rgb(21 28 44 / 95%);
  border-color: var(--launch-primary);
  outline: none;
}

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

@media (pointer: fine) {
  .launch-back-btn {
    width: 48px;
    height: 48px;
    background: rgb(21 28 44 / 80%);
    backdrop-filter: blur(8px);
    border-color: var(--launch-border);
    opacity: 0.7;
  }

  .launch-back-btn:hover {
    opacity: 1;
  }
}

/* Continue button - appears after selection */
.continue-btn {
  margin-top: 16px;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 200ms ease,
    transform 200ms ease;
  pointer-events: none;
}

.continue-btn.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Multi-select hint */
.selection-hint {
  width: 100%;
  font-size: 0.875rem;
  color: var(--launch-text-tertiary);
  margin-top: -8px;
  text-align: left;
}

/* Personalization flow responsive adjustments */
@media (width >= 640px) {
  .launch-flow {
    max-width: 560px;
  }

  .step-title {
    font-size: 1.875rem;
  }

  .options-grid--levels {
    max-width: 380px;
  }

  .options-grid--types,
  .options-grid--times {
    max-width: 420px;
  }

  .option-card {
    padding: 20px 24px;
    min-height: 80px;
  }
}
