/* =====================================================
   SahiHisab — Intro Carousel
   First-run welcome overlay shown once per studio.
   Mobile-first 375px, scales gracefully on desktop.
   ===================================================== */

.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-page, #fff);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: intro-fade-in 240ms ease-out;
}

@keyframes intro-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Top bar — skip + progress dots */
.intro-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  flex-shrink: 0;
}

.intro-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.intro-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border, #e5e7eb);
  transition: all 220ms ease;
}

.intro-dot.is-active {
  width: 22px;
  border-radius: 4px;
  background: var(--brand-color, #c4583c);
}

.intro-dot.is-past {
  background: var(--brand-color, #c4583c);
  opacity: 0.4;
}

.intro-skip {
  background: transparent;
  border: none;
  color: var(--text-secondary, #6b7280);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 4px;
  min-height: 44px;
  cursor: pointer;
  font-family: inherit;
}

.intro-skip:hover {
  color: var(--text-primary, #111);
}

/* Slide track */
.intro-track {
  flex: 1;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.intro-track::-webkit-scrollbar { display: none; }

.intro-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 28px 16px;
  text-align: center;
}

/* Slide visual — illustration container */
.intro-visual {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1 / 1;
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  color: var(--brand-color, #c4583c);
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand-color, #c4583c) 6%, transparent) 0%, color-mix(in srgb, var(--brand-color, #c4583c) 14%, transparent) 100%);
}

/* Per-slide accent tints — soft, brand-leaning */
.intro-visual--welcome { background: linear-gradient(135deg, #fef3f0 0%, #fad8cc 100%); color: var(--brand-color, #c4583c); }
.intro-visual--quote   { background: linear-gradient(135deg, #f4f0ff 0%, #ddd0ff 100%); color: #6d4ad6; }
.intro-visual--pay     { background: linear-gradient(135deg, #ecfdf5 0%, #c8f0db 100%); color: #059669; }
.intro-visual--cal     { background: linear-gradient(135deg, #fef6e7 0%, #fce5b8 100%); color: #d97706; }
.intro-visual--cta     { background: linear-gradient(135deg, #fef3f0 0%, #fad8cc 100%); color: var(--brand-color, #c4583c); }

/* SVG illustration — fills the visual cleanly */
.intro-visual-svg {
  width: 88%;
  height: 88%;
  display: block;
}

/* Real-image slot (when path provided in Intro._images).
   Overlays the SVG so a failed-to-load image (img.remove() in onerror)
   reveals the SVG fallback underneath. */
.intro-visual-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Headlines */
.intro-headline {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary, #0077b6);
  margin: 0 0 10px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.intro-sub {
  font-size: 0.95rem;
  color: var(--text-secondary, #6b7280);
  line-height: 1.5;
  margin: 0;
  max-width: 320px;
}

/* Bottom CTA bar */
.intro-actions {
  flex-shrink: 0;
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.intro-btn {
  width: 100%;
  min-height: 52px;
  border-radius: 14px;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.intro-btn--primary {
  background: var(--brand-color, #c4583c);
  color: #fff;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--brand-color, #c4583c) 30%, transparent);
}

.intro-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--brand-color, #c4583c) 40%, transparent);
}

.intro-btn--primary:active { transform: translateY(0); }

.intro-btn--ghost {
  background: transparent;
  color: var(--text-secondary, #6b7280);
  min-height: 44px;
  font-size: 0.9rem;
  font-weight: 500;
}

.intro-btn--ghost:hover { color: var(--text-primary, #111); }

.intro-btn .material-symbols-rounded { font-size: 1.2rem; }

/* Final CTA slide gets two buttons */
.intro-cta-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 320px;
}

/* ─── Desktop ─────────────────────────────────────── */
@media (min-width: 768px) {
  .intro-overlay {
    padding: 0;
  }
  .intro-slide {
    padding: 40px 48px 24px;
  }
  .intro-visual {
    max-width: 380px;
    margin-bottom: 36px;
  }
  .intro-visual-icon { font-size: 5rem; }
  .intro-headline { font-size: 1.85rem; }
  .intro-sub { font-size: 1rem; max-width: 420px; }
  .intro-actions {
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
  }
  .intro-topbar { padding: 18px 32px; }
}

/* Honor reduced motion */
@media (prefers-reduced-motion: reduce) {
  .intro-overlay { animation: none; }
  .intro-track { scroll-behavior: auto; }
  .intro-btn { transition: none; }
}
