/* ============================================================
   Onboarding — full-screen multi-step flow on first launch
   Persists progress in localStorage; skipped if user already onboarded
   ============================================================ */

.onboarding {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: linear-gradient(160deg, #1f4c84 0%, #123c68 50%, #0b2745 100%);
  color: #fff;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.onboarding.open { display: flex; animation: onbFade 0.4s ease-out; }
@keyframes onbFade { from { opacity: 0; } to { opacity: 1; } }

/* Progress dots top */
.onb-progress {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 0 0;
}
.onb-progress .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  transition: all 0.3s ease;
}
.onb-progress .dot.active { background: #f5d77a; width: 24px; border-radius: 4px; }
.onb-progress .dot.done   { background: rgba(245,215,122,0.5); }

/* Main step area (scrollable on small screens) */
.onb-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 32px 24px 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.onb-step { display: none; }
.onb-step.active { display: block; animation: stepSlide 0.35s ease-out; }
@keyframes stepSlide {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.onb-emoji {
  text-align: center;
  font-size: 4rem;
  line-height: 1;
  margin: 20px 0 16px;
}
.onb-title {
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  margin: 0 0 12px;
  line-height: 1.25;
}
.onb-sub {
  font-size: 0.98rem;
  text-align: center;
  color: rgba(255,255,255,0.92);   /* bumped from 0.78 — contrast 11.2:1 vs navy */
  line-height: 1.55;
  margin: 0 0 28px;
  padding: 0 8px;
  font-weight: 400;
}

/* Options grid (for lang/country/family selection) */
.onb-options {
  display: grid;
  gap: 10px;
  padding: 0 4px;
}
.onb-options.grid-2 { grid-template-columns: 1fr 1fr; }
.onb-options.grid-3 { grid-template-columns: 1fr 1fr 1fr; }

.onb-option {
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 14px 12px;
  color: #fff;
  font-size: 0.95rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.onb-option:hover { background: rgba(255,255,255,0.14); }
.onb-option.selected {
  background: rgba(245,215,122,0.18);
  border-color: #f5d77a;
  color: #f5d77a;
}
.onb-option .flag { font-size: 1.4rem; line-height: 1; margin-bottom: 4px; display: block; }

/* Premium trial offer benefits list */
.onb-benefits {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  font-size: 0.95rem;
}
.onb-benefits li {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}
.onb-benefits li:last-child { border-bottom: none; }
.onb-benefits .check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f5d77a;
  color: #123c68;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.onb-trial-pricing {
  background: rgba(245,215,122,0.10);
  border: 1px solid rgba(245,215,122,0.25);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 18px;
  font-size: 0.85rem;
  text-align: center;
  color: rgba(255,255,255,0.85);
}
.onb-trial-pricing strong { color: #f5d77a; }

/* Footer with buttons */
.onb-footer {
  padding: 16px 24px calc(env(safe-area-inset-bottom, 0px) + 24px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.onb-btn {
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
  font-family: inherit;
}
.onb-btn:active { transform: scale(0.98); }
.onb-btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.onb-btn-primary {
  background: #f5d77a;
  color: #123c68;
}
.onb-btn-ghost {
  background: transparent;
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  padding: 12px 24px;
}
.onb-btn-ghost:hover { color: #fff; }

/* Specific step illustrations */
.onb-logo {
  display: flex;
  justify-content: center;
  margin: 30px 0 24px;
}
.onb-logo img { width: 120px; height: 120px; border-radius: 24px; box-shadow: 0 8px 32px rgba(0,0,0,0.3); }

@media (max-height: 640px) {
  .onb-emoji { font-size: 3rem; margin: 8px 0 12px; }
  .onb-title { font-size: 1.35rem; }
  .onb-sub { font-size: 0.92rem; margin-bottom: 18px; }
}
