/* Onboarding walkthrough (SPEC-029). Isolated from styles.css so it composes
   with parallel work; theme-aware via the same custom properties. The dim is a
   single box-shadow cut-out around the spotlight, easing 200ms between targets
   (SuryaIQ / BDR-system feel). No layout shift — everything is position:fixed. */

.fstour {
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
}

/* Full-screen interaction blocker. Transparent by default — the spotlight's
   box-shadow does the dimming; only a step with no anchor dims here directly. */
.fstour__catch {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  background: transparent;
  transition: background var(--dur-base, 250ms) ease-out;
}
.fstour.is-centered .fstour__catch {
  background: rgba(12, 10, 9, 0.66);
}

/* Spotlight: a hole punched in a near-opaque overlay via a huge box-shadow. */
.fstour__spot {
  position: absolute;
  border-radius: var(--radius-card, 12px);
  box-shadow: 0 0 0 9999px rgba(12, 10, 9, 0.66);
  outline: 2px solid var(--color-primary, #0f766e);
  outline-offset: 2px;
  pointer-events: none;
  transition:
    top 0.2s ease-out,
    left 0.2s ease-out,
    width 0.2s ease-out,
    height 0.2s ease-out,
    opacity 0.15s ease-out;
}

/* Narration card. */
.fstour__card {
  position: absolute;
  pointer-events: auto;
  box-sizing: border-box;
  /* On a short viewport the card can be taller than the screen — cap it and
     scroll internally so Next/Done stay reachable. */
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  padding: var(--space-3, 16px);
  background: var(--color-surface, #fff);
  color: var(--color-fg, #1c1917);
  border: 1px solid var(--color-border, #e7e5e4);
  border-top: 3px solid var(--color-primary, #0f766e);
  border-radius: var(--radius-card, 12px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  font-family: var(--font-body, system-ui, sans-serif);
  animation: fstour-in 0.16s ease-out;
}

@keyframes fstour-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fstour__spot,
  .fstour__card {
    transition: none;
    animation: none;
  }
}

.fstour__x {
  position: absolute;
  top: 6px;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* A real touch target so "skip the tour" is obvious and reachable on a phone
     (SPEC-038) — the old 26px icon was easy to miss/mistap. */
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--color-border, #e7e5e4);
  border-radius: 999px;
  background: var(--color-surface, #fff);
  color: var(--color-fg-muted, #57534e);
  cursor: pointer;
  line-height: 0;
  touch-action: manipulation;
}
.fstour__x:hover {
  background: var(--color-bg, #fafaf9);
  color: var(--color-fg, #1c1917);
}
/* Keep the title/kicker clear of the enlarged close button. */
.fstour__kicker,
.fstour__title {
  padding-right: 44px;
}

.fstour__kicker {
  margin: 0 0 2px;
  padding-right: 24px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-primary, #0f766e);
}

.fstour__title {
  margin: 0 0 6px;
  font-family: var(--font-head, sans-serif);
  font-size: 1.12rem;
  line-height: 1.25;
}

.fstour__body {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--color-fg-muted, #57534e);
}

.fstour__link {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--color-accent, #0369a1);
}

.fstour__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2, 8px);
  margin-top: var(--space-3, 16px);
}

.fstour__count {
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
  color: var(--color-fg-muted, #57534e);
}

.fstour__nav {
  display: flex;
  gap: var(--space-2, 8px);
}

.fstour__btn {
  padding: 7px 14px;
  border: 1px solid var(--color-border, #e7e5e4);
  border-radius: var(--radius-chip, 999px);
  background: var(--color-surface, #fff);
  color: var(--color-fg, #1c1917);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--dur-fast, 150ms) ease-out;
}
.fstour__btn:hover:not([disabled]) {
  background: var(--color-bg, #fafaf9);
}
.fstour__btn[disabled] {
  opacity: 0.45;
  cursor: default;
}
.fstour__btn--primary {
  border-color: var(--color-primary, #0f766e);
  background: var(--color-primary, #0f766e);
  color: var(--color-on-primary, #fff);
}
.fstour__btn--primary:hover:not([disabled]) {
  filter: brightness(1.06);
  background: var(--color-primary, #0f766e);
}

.fstour__card :focus-visible {
  outline: 2px solid var(--color-accent, #0369a1);
  outline-offset: 2px;
}

/* Anonymous teaser hint — a small, non-blocking bubble (absolute, scrolls with
   the page) with a little beak pointing down at the signup CTA below it. */
.fstour-hint {
  position: absolute;
  z-index: 1500;
  box-sizing: border-box;
  padding: 12px 14px;
  background: var(--color-primary, #0f766e);
  color: var(--color-on-primary, #fff);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
  font-family: var(--font-body, system-ui, sans-serif);
  animation: fstour-in 0.16s ease-out;
}
.fstour-hint::after {
  content: "";
  position: absolute;
  bottom: -7px;
  left: 24px;
  width: 14px;
  height: 14px;
  background: var(--color-primary, #0f766e);
  transform: rotate(45deg);
  border-radius: 0 0 3px 0;
}
/* Below-anchor variant (compass nudge in the header): beak on top, near the
   right edge to point back up at the launcher. */
.fstour-hint--below::after {
  bottom: auto;
  top: -7px;
  left: auto;
  right: 24px;
  border-radius: 3px 0 0 0;
}
.fstour-hint__text {
  margin: 0;
  padding-right: 20px;
  font-size: 0.88rem;
  line-height: 1.45;
}
.fstour-hint__x {
  position: absolute;
  top: 6px;
  right: 6px;
  display: inline-flex;
  padding: 2px;
  border: 0;
  background: transparent;
  color: var(--color-on-primary, #fff);
  opacity: 0.85;
  cursor: pointer;
  line-height: 0;
}
.fstour-hint__x:hover {
  opacity: 1;
}
