/* intro-wizard.css — Giftly Welcome / How-To Wizard
   Pastel palette, teal final screen, smooth slide transitions.
   ─────────────────────────────────────────────────────────── */

/* ── Overlay ─────────────────────────────────────────── */
#intro-wizard-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 40, 0.72);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

#intro-wizard-overlay.iw-visible {
  opacity: 1;
}

/* ── Modal ───────────────────────────────────────────── */
.iw-modal {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 22px;
  box-shadow:
    0 2px 0 rgba(255,255,255,0.6) inset,
    0 28px 70px rgba(0, 0, 0, 0.26),
    0 4px 16px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 92dvh;
}

/* ── Progress bar ────────────────────────────────────── */
.iw-progress-bar {
  height: 4px;
  background: #eef0f5;
  flex-shrink: 0;
}

.iw-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6C3CE1 0%, #FF5D6C 50%, #FFB830 100%);
  border-radius: 0 2px 2px 0;
  transition: width 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Close ───────────────────────────────────────────── */
.iw-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.06);
  color: #888;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s, color 0.18s;
  line-height: 1;
}

.iw-close-btn:hover {
  background: #fee2e2;
  color: #b91c1c;
}

/* ── Slides track ────────────────────────────────────── */
.iw-slides-track {
  position: relative;
  flex: 1;
  min-height: 280px;
  overflow: hidden;
}

/* ── Slide ───────────────────────────────────────────── */
.iw-slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 38px 32px 24px;
  overflow-y: auto;

  opacity: 0;
  transform: translateX(56px) scale(0.975);
  transition:
    transform 0.34s cubic-bezier(0.4, 0, 0.2, 1),
    opacity   0.34s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.iw-slide.iw-slide-active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  position: relative;
}

.iw-slide.iw-slide-prev {
  opacity: 0;
  transform: translateX(-56px) scale(0.975);
}

.iw-slide.iw-slide-next {
  opacity: 0;
  transform: translateX(56px) scale(0.975);
}

/* ── Pastel slide backgrounds ────────────────────────── */
.slide-blue        { background: linear-gradient(150deg, #f0eaff 0%, #e8dffe 100%); }
.slide-mint        { background: linear-gradient(150deg, #fff8e6 0%, #ffedc8 100%); }
.slide-sky         { background: linear-gradient(150deg, #f0eaff 0%, #e8d5ff 100%); }
.slide-peach       { background: linear-gradient(150deg, #ffe4e6 0%, #ffd0d4 100%); }
.slide-lavender    { background: linear-gradient(150deg, #ece6ff 0%, #ddd4ff 100%); }
.slide-teal        { background: linear-gradient(150deg, #ffe4e6 0%, #ffccce 100%); }
.slide-coral       { background: linear-gradient(150deg, #ffe4e6 0%, #ffcacf 100%); }
.slide-gold        { background: linear-gradient(150deg, #fff6d0 0%, #ffedb0 100%); }

/* Final screen — rich teal ───────────────────────────── */
.slide-teal-final {
  background: linear-gradient(150deg, #4b23b0 0%, #6C3CE1 60%, #8b5cf6 100%);
}

.slide-teal-final .iw-slide-icon { filter: drop-shadow(0 6px 16px rgba(0,0,0,0.25)); }
.slide-teal-final .iw-slide-title,
.slide-teal-final .iw-title-sub  { color: #fff; }
.slide-teal-final .iw-slide-body { color: rgba(255,255,255,0.9); }

/* ── Slide content ───────────────────────────────────── */
.iw-slide-icon {
  font-size: 3.8rem;
  line-height: 1;
  margin-bottom: 16px;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,0.12));
}

/* Bounce in when slide becomes active */
.iw-slide.iw-slide-active .iw-slide-icon {
  animation: iw-icon-pop 0.42s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes iw-icon-pop {
  0%   { transform: scale(0.35) rotate(-10deg); opacity: 0; }
  65%  { transform: scale(1.14) rotate(4deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.iw-slide-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1A1025;
  margin: 0 0 12px;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.iw-title-sub {
  display: block;
  font-size: 1.45rem;
}

.iw-slide-body {
  font-size: 0.97rem;
  color: #2d1f4a;
  line-height: 1.65;
  margin: 0 0 16px;
  max-width: 400px;
}

.iw-slide-body strong { color: #1A1025; }
.slide-teal-final .iw-slide-body strong { color: #fff; }

/* ── Tip box ─────────────────────────────────────────── */
.iw-tip {
  background: rgba(255,255,255,0.62);
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 0.855rem;
  color: #2d1f4a;
  line-height: 1.5;
  max-width: 390px;
  backdrop-filter: blur(3px);
}

.iw-tip strong { color: #1A1025; }

/* ── Final CTA ───────────────────────────────────────── */
.iw-final-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  width: 100%;
}

.iw-final-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.iw-final-note {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.65);
  margin: 4px 0 0;
}

/* ── Footer ──────────────────────────────────────────── */
.iw-footer {
  padding: 12px 20px 18px;
  background: rgba(255,255,255,0.94);
  border-top: 1px solid rgba(0,0,0,0.05);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Dots ────────────────────────────────────────────── */
.iw-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.iw-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: #d4dcea;
  cursor: pointer;
  padding: 0;
  transition: background 0.22s, transform 0.22s, width 0.22s;
}

.iw-dot.iw-dot-active {
  background: linear-gradient(135deg, #6C3CE1, #FF5D6C);
  transform: scale(1.25);
  width: 20px;
  border-radius: 4px;
}

.iw-dot:hover:not(.iw-dot-active) {
  background: #9aaec4;
  transform: scale(1.2);
}

/* ── Nav row ─────────────────────────────────────────── */
.iw-nav-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.iw-step-counter {
  font-size: 0.8rem;
  color: #9aabbc;
  font-weight: 600;
  min-width: 44px;
  text-align: center;
}

.iw-final-actions {
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* ── Buttons ─────────────────────────────────────────── */
.iw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  border-radius: 10px;
  transition: background 0.18s, transform 0.12s, box-shadow 0.18s;
  white-space: nowrap;
  line-height: 1.2;
}

.iw-btn:active { transform: scale(0.96); }

.iw-btn-nav {
  padding: 8px 18px;
  font-size: 0.9rem;
}

.iw-btn-primary {
  background: linear-gradient(135deg, #FF5D6C, #e04a58);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 93, 108, 0.38);
}

.iw-btn-primary:hover {
  background: linear-gradient(135deg, #e04a58, #cc3344);
  box-shadow: 0 6px 18px rgba(255, 93, 108, 0.48);
}

.iw-btn-primary:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.iw-btn-ghost {
  background: rgba(0,0,0,0.055);
  color: #4a5568;
}

.iw-btn-ghost:hover {
  background: rgba(0,0,0,0.1);
  color: #2d3748;
}

.iw-btn-ghost:disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* Final big CTA button — white on teal */
.iw-btn-final-primary {
  background: rgba(255,255,255,0.96);
  color: #4b23b0;
  padding: 13px 30px;
  font-size: 1.02rem;
  border-radius: 13px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.18);
}

.iw-btn-final-primary:hover {
  background: #fff;
  box-shadow: 0 6px 24px rgba(0,0,0,0.22);
}

/* Final secondary ghost buttons — light on teal bg */
.slide-teal-final ~ .iw-footer .iw-btn-ghost,
.iw-final-secondary .iw-btn-ghost {
  background: rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.88);
  border: 1px solid rgba(255,255,255,0.25);
}

.iw-final-secondary .iw-btn-ghost:hover {
  background: rgba(255,255,255,0.22);
  color: #fff;
}

.iw-btn-small {
  padding: 7px 13px;
  font-size: 0.82rem;
  border-radius: 8px;
}

.iw-muted { opacity: 0.65; }
.iw-muted:hover { opacity: 1; }

/* ── Final footer override — teal bg bleeds into footer ─ */
.iw-modal:has(.slide-teal-final.iw-slide-active) .iw-footer {
  background: #5b21b6;
  border-top-color: rgba(255,255,255,0.12);
}

.iw-modal:has(.slide-teal-final.iw-slide-active) .iw-dot {
  background: rgba(255,255,255,0.3);
}

.iw-modal:has(.slide-teal-final.iw-slide-active) .iw-dot.iw-dot-active {
  background: rgba(255,255,255,0.9);
}

.iw-modal:has(.slide-teal-final.iw-slide-active) .iw-step-counter {
  color: rgba(255,255,255,0.55);
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 560px) {
  .iw-modal { border-radius: 16px; }
  .iw-slide { padding: 28px 20px 18px; }
  .iw-slide-icon { font-size: 3rem; margin-bottom: 12px; }
  .iw-slide-title { font-size: 1.25rem; }
  .iw-title-sub { font-size: 1.2rem; }
  .iw-slide-body { font-size: 0.9rem; }
  .iw-footer { padding: 10px 14px 14px; }
  .iw-btn-nav { padding: 8px 13px; font-size: 0.85rem; }
  .iw-final-secondary { flex-direction: column; align-items: stretch; }
  .iw-btn-small { text-align: center; }
}

@media (max-height: 620px) {
  .iw-slide-icon { font-size: 2.4rem; margin-bottom: 8px; }
  .iw-slide { padding: 22px 20px 14px; }
  .iw-slide-title { font-size: 1.15rem; margin-bottom: 8px; }
  .iw-slide-body { font-size: 0.875rem; }
  .iw-tip { font-size: 0.8rem; padding: 7px 12px; }
}
