/* ═══════════════════════════════════════════
   Memoroam — Onboarding & Landing Styles
   Landing page, onboarding steps 1-3,
   plan selection screen.
   ═══════════════════════════════════════════ */

/* ── Auth overlay container ── */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: var(--bg);
}
.auth-overlay.hidden {
  display: none;
}

/* ── Screen base (slide + fade transitions) ── */
.auth-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transform: translateX(60px);
  transition: opacity .4s ease, transform .4s cubic-bezier(.32,.72,0,1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.auth-screen.active {
  opacity: 1;
  pointer-events: all;
  transform: translateX(0);
}
.auth-screen.slide-out-left {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-60px);
}
.auth-screen.slide-out-right {
  opacity: 0;
  pointer-events: none;
  transform: translateX(60px);
}

/* Constrain all screen content to phone-like width */
.auth-screen > * {
  width: 100%;
  max-width: 420px;
}

/* ════════════════════════════════════════════
   SCREEN 1 — Landing / Welcome
   ════════════════════════════════════════════ */

#authLanding {
  background: var(--bg);
}

.landing-flags-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 52%;
  max-width: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  padding-bottom: 16px;
  overflow: hidden;
}

.flag-row {
  display: flex;
  white-space: nowrap;
  width: max-content;
}

.flag-tile {
  width: 72px;
  height: 52px;
  margin-right: 10px;
  border-radius: 12px;
  background: rgba(0,0,0,.04);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.flag-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flag-row-ltr { animation: flagScrollLTR 90s linear infinite; }
.flag-row-rtl { animation: flagScrollRTL 80s linear infinite; }
.flag-row-ltr-slow { animation: flagScrollLTR 110s linear infinite; }

@keyframes flagScrollLTR {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes flagScrollRTL {
  0%   { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

/* Gradient fading flags into bg */
.landing-gradient {
  position: absolute;
  inset: 0;
  max-width: none;
  background: linear-gradient(180deg,
    rgba(240,235,227,0) 0%,
    rgba(240,235,227,.4) 30%,
    rgba(240,235,227,.88) 46%,
    rgba(240,235,227,1) 54%);
  pointer-events: none;
}

/* Bottom content area */
.landing-content {
  position: relative;
  z-index: 2;
  margin-top: auto;
  padding: 0 32px 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.landing-brand {
  font-family: 'Playfair Display', serif;
  font-size: 40px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.5px;
}

.landing-subtitle {
  font-size: 14px;
  color: var(--muted);
  margin-top: 6px;
  margin-bottom: 40px;
  letter-spacing: .4px;
}

.landing-cta {
  width: 100%;
  max-width: 320px;
  height: 54px;
  border-radius: 16px;
  border: none;
  background: var(--text);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
.landing-cta:active { opacity: .85; }

.landing-login-link {
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted);
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 320px;
  height: 54px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  transition: opacity .15s;
}
.landing-login-link:active { opacity: .75; }

/* ════════════════════════════════════════════
   SCREENS 2-4 — Onboarding Steps
   ════════════════════════════════════════════ */

.ob-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-top: 72px;
}

.ob-heading {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  padding: 0 32px;
  text-align: center;
}
.ob-heading span {
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-size: 22px;
}

/* Onboarding footer — dots + button */
.ob-footer {
  padding: 0 32px 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.ob-dots {
  display: flex;
  gap: 8px;
}
.ob-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0,0,0,.12);
  transition: width .3s ease, border-radius .3s ease, background .3s ease;
}
.ob-dot.active {
  width: 28px;
  border-radius: 4px;
  background: var(--text);
}

.ob-continue {
  width: 100%;
  max-width: 320px;
  height: 54px;
  border-radius: 16px;
  border: none;
  background: var(--text);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
.ob-continue:active { opacity: .85; }

/* ── Screen 2: Phone mockup ── */
.ob-phone-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.ob-phone-mockup {
  width: 260px;
  height: 480px;
  border-radius: 36px;
  border: 3px solid var(--text);
  /* Dark background flush with the preview so no cream bleeds through */
  background: #0d1628;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.1);
}

.ob-phone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 24px;
  background: var(--text);
  border-radius: 0 0 16px 16px;
  z-index: 4;
}

.ob-phone-placeholder {
  position: absolute;
  inset: 32px 12px 12px;
  border-radius: 16px;
  background: rgba(0,0,0,.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

/* ── Phone preview: mirrors the real home globe screen ── */
.ob-preview {
  position: absolute;
  inset: 0;
  /* matches .home-globe-wrap in globe.css */
  background: radial-gradient(ellipse at 50% 42%, #1e2535 0%, #111520 100%);
  overflow: hidden;
  color: #f5f0e6;
}

/* Top stats pill — glass morphic, gold numbers, mirrors .home-stats-inner */
.ob-prev-stats-bar {
  position: absolute;
  top: 36px; left: 14px; right: 14px;
  z-index: 3;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.ob-prev-stats-pill {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(240,235,227,.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 50px;
  padding: 7px 16px;
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 2px 14px rgba(0,0,0,.3);
}
.ob-prev-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.ob-prev-stat-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: #E8D5A0;
  line-height: 1;
}
.ob-prev-stat-lbl {
  font-size: 6.5px;
  font-weight: 600;
  color: rgba(255,255,255,.45);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.ob-prev-stat-divider {
  width: 1px; height: 18px;
  background: rgba(255,255,255,.12);
}

/* Globe fills the whole phone canvas — real D3 globe rendered into here */
.ob-prev-globe {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

.obpg-pin, .ob-prev-pin {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #5aa0ff;
  border: 1.5px solid rgba(255,255,255,.85);
  box-shadow: 0 0 8px rgba(90,160,255,.55);
  transform: translate(-50%, -50%);
  animation: obPinPulse 2.8s ease-out infinite;
}
.obpg-pin--gold, .ob-prev-pin--gold {
  width: 8px; height: 8px;
  background: #E8D5A0;
  box-shadow: 0 0 10px rgba(232,213,160,.7);
}

@keyframes obPinPulse {
  0%   { box-shadow: 0 0 8px rgba(90,160,255,.55); }
  60%  { box-shadow: 0 0 14px rgba(90,160,255,.25); }
  100% { box-shadow: 0 0 8px rgba(90,160,255,.55); }
}

/* Bottom-left gallery pill (matches .globe-gallery-btn) */
.ob-prev-gallery {
  position: absolute;
  left: 14px;
  bottom: 16px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 50px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.7);
  font-family: 'DM Sans', sans-serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.ob-prev-gallery svg { opacity: .6; }

/* Bottom-right FAB */
.ob-prev-fab {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 3;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #1a1f2e;
  color: #E8D5A0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,255,255,.08);
}

/* ── Feature card mini visuals (screen 2) ──────────────
   Each .ob-feature-img is the right-hand half of the card
   (45% wide, min-height 120px). The visual fills it edge
   to edge with a themed background and a prominent motif. */

.ob-feature-img { position: relative; overflow: hidden; }
.ob-feature-img--ticket { background: linear-gradient(135deg, #f4efe7 0%, #e0d4b8 100%); }
.ob-feature-img--globe  {
  background: radial-gradient(ellipse at 50% 45%, #1e2a4a 0%, #0d1628 85%);
}
.ob-feature-img--memory { background: linear-gradient(135deg, #f0e6d0 0%, #d6c2a0 100%); }

/* ── 1. Boarding pass ticket ─────────────────────────── */
.ob-pass {
  position: absolute;
  inset: 8px 10px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,.15);
  padding: 10px 10px 9px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.ob-pass-route {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.ob-pass-code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: #1a1f2e;
  letter-spacing: -.4px;
}
.ob-pass-path {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  justify-content: center;
}
.ob-pass-dot {
  width: 3px; height: 3px; border-radius: 50%;
  background: rgba(0,0,0,.3);
}
.ob-pass-line {
  flex: 1;
  height: 1px;
  background: repeating-linear-gradient(90deg, rgba(0,0,0,.2) 0 2px, transparent 2px 5px);
}
.ob-pass-plane { color: rgba(0,0,0,.45); }
.ob-pass-cities {
  display: flex;
  justify-content: space-between;
  font-family: 'DM Sans', sans-serif;
  font-size: 8px;
  color: rgba(0,0,0,.45);
  margin-top: 2px;
}
.ob-pass-perf {
  border-top: 1px dashed rgba(0,0,0,.15);
  margin: 7px -10px 7px;
  position: relative;
}
.ob-pass-perf::before, .ob-pass-perf::after {
  content: '';
  position: absolute;
  top: -6px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #f4efe7;
}
.ob-pass-perf::before { left: -5px; }
.ob-pass-perf::after  { right: -5px; }
.ob-pass-meta {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}
.ob-pass-meta-lbl {
  font-family: 'DM Sans', sans-serif;
  font-size: 6.5px;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(0,0,0,.4);
  text-transform: uppercase;
}
.ob-pass-meta-val {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  color: #1a1f2e;
  margin-top: 1px;
}

/* ── 2. Globe that overflows the box (portal feel) ─── */
.ob-globe-stage {
  position: absolute; inset: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ob-globe-stars {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,.6), transparent),
    radial-gradient(1px 1px at 70% 20%, rgba(255,255,255,.4), transparent),
    radial-gradient(1px 1px at 40% 75%, rgba(255,255,255,.5), transparent),
    radial-gradient(1px 1px at 85% 60%, rgba(255,255,255,.4), transparent),
    radial-gradient(1px 1px at 15% 85%, rgba(255,255,255,.3), transparent),
    radial-gradient(1px 1px at 60% 10%, rgba(255,255,255,.45), transparent);
}
.ob-globe-orb {
  position: relative;
  width: 140%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, rgba(120,160,210,.25), transparent 55%),
    radial-gradient(circle at 48% 55%,
      #3a6a68 0%,
      #23504e 35%,
      #12302f 68%,
      #0a1d1c 100%);
  box-shadow:
    inset -20px -22px 44px rgba(0,0,0,.6),
    0 0 0 1px rgba(96,140,170,.2),
    0 0 28px rgba(74,184,184,.2);
  animation: obGlobeSpin 26s linear infinite;
}
.ob-globe-orb::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 40%, rgba(74,158,106,.55) 0 11%, transparent 12%),
    radial-gradient(circle at 58% 36%, rgba(74,158,106,.45) 0 8%, transparent 9%),
    radial-gradient(circle at 62% 62%, rgba(74,158,106,.48) 0 9%, transparent 10%),
    radial-gradient(circle at 40% 70%, rgba(74,158,106,.38) 0 7%, transparent 8%),
    radial-gradient(circle at 75% 50%, rgba(74,158,106,.32) 0 6%, transparent 7%);
  mix-blend-mode: screen;
}
.ob-globe-orb::after {
  content: '';
  position: absolute; inset: -3px;
  border-radius: 50%;
  border: 1px solid rgba(74,184,184,.2);
  pointer-events: none;
}
.ob-globe-pin {
  position: absolute;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #5aa0ff;
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: 0 0 6px rgba(90,160,255,.7);
  transform: translate(-50%, -50%);
  animation: obPinPulse 2.8s ease-out infinite;
  z-index: 2;
}
.ob-globe-pin--gold {
  width: 6px; height: 6px;
  background: #e8d5a0;
  box-shadow: 0 0 8px rgba(232,213,160,.8);
  animation-delay: .8s;
}

@keyframes obGlobeSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes obPinPulse {
  0%   { box-shadow: 0 0 6px rgba(90,160,255,.7); }
  60%  { box-shadow: 0 0 12px rgba(90,160,255,.25); }
  100% { box-shadow: 0 0 6px rgba(90,160,255,.7); }
}

/* ── 3. Stack of polaroids ───────────────────────────── */
.ob-polaroid-stack {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ob-polaroid {
  position: absolute;
  width: 62%;
  background: #fff;
  padding: 5px 5px 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,.18);
}
.ob-polaroid--back {
  transform: rotate(-9deg) translate(-18%, -6%);
  z-index: 1;
  opacity: .85;
}
.ob-polaroid--mid {
  transform: rotate(5deg) translate(12%, 4%);
  z-index: 2;
}
.ob-polaroid--front {
  transform: rotate(-2deg);
  z-index: 3;
}
.ob-polaroid-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 1px;
}
.ob-polaroid-caption {
  font-family: 'Playfair Display', serif;
  font-size: 9px;
  color: #1a1f2e;
  text-align: center;
  padding-top: 3px;
  font-style: italic;
}

/* ── Screen 3: Feature cards ── */
.ob-features {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 36px 24px;
  justify-content: center;
}

.ob-feature-card {
  display: flex;
  align-items: stretch;
  background: var(--card);
  border-radius: 18px;
  border: 1.5px solid var(--border);
  overflow: hidden;
  min-height: 120px;
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
}

.ob-feature-text {
  flex: 1;
  padding: 24px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  display: flex;
  align-items: center;
}

.ob-feature-img {
  width: 45%;
  flex-shrink: 0;
  background: rgba(0,0,0,.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

/* ── Screen 4: Destination flag grid ── */
.ob-dest-heading {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  padding: 0 32px;
  text-align: center;
}

.ob-flag-grid {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  gap: 12px;
  padding: 28px 20px;
}

.ob-flag-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 80px;
}

.ob-flag-badge {
  width: 80px;
  height: 54px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  transition: transform .2s;
  overflow: hidden;
}
.ob-flag-badge:active {
  transform: scale(.96);
}
.ob-flag-badge img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ob-flag-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  letter-spacing: .3px;
}

/* ════════════════════════════════════════════
   SCREEN 7 — Plan Selection
   ════════════════════════════════════════════ */

#authPlanSelect {
  background: var(--bg);
}

.plan-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 60px 24px 48px;
}

.plan-heading {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}

.plan-subtitle {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  margin: 6px 0 28px;
}

.plan-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.plan-card {
  background: var(--card);
  border-radius: 18px;
  padding: 20px;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .15s;
  position: relative;
}
.plan-card:active {
  transform: scale(.98);
}
.plan-card.selected {
  border-color: var(--text);
  box-shadow: 0 4px 24px rgba(0,0,0,.1);
}

.plan-badge {
  position: absolute;
  top: -10px;
  right: 16px;
  background: #4A8C8A;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .5px;
  padding: 3px 12px;
  border-radius: 50px;
  text-transform: uppercase;
  font-family: 'DM Sans', sans-serif;
}

.plan-name {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.plan-price {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 15px;
  color: var(--text);
  margin-top: 2px;
}
.plan-price-detail {
  font-size: 12px;
  color: var(--muted);
}

.plan-features {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.plan-feature {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'DM Sans', sans-serif;
}

.pf-check {
  color: #4A9E6A;
  flex-shrink: 0;
}

.plan-confirm {
  width: 100%;
  max-width: 320px;
  height: 54px;
  border-radius: 16px;
  border: none;
  background: var(--text);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin: 24px auto 0;
  display: block;
  transition: opacity .15s;
  position: relative;
}
.plan-confirm:active { opacity: .85; }
.plan-confirm:disabled { opacity: .5; cursor: not-allowed; }
.plan-confirm.loading { color: transparent; }
.plan-confirm.loading::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: authSpin .6s linear infinite;
  left: 50%; top: 50%;
  transform: translate(-50%,-50%);
}

@keyframes authSpin {
  to { transform: translate(-50%,-50%) rotate(360deg); }
}

/* ── Dark Mode ── */
[data-theme="dark"] .landing-gradient{
  background:linear-gradient(180deg,
    rgba(26,23,20,0) 0%,
    rgba(26,23,20,.4) 30%,
    rgba(26,23,20,.88) 46%,
    rgba(26,23,20,1) 54%);
}
