/* ============================================================
   Metablox guided tour — Figma "Onboarding v2 · Tour Tooltip v2"
   (Trello ONB-15). Prefix: tut-*
   Tokens only (seo/css/ds-tokens.css, design-system/AI_RULES.md):
   4px grid, radius md 12 / lg 16 / pill, one primary action (the
   orange Next/Done with the dark --ds-on-cta label).
   ============================================================ */

/* ── Overlay ─────────────────────────────────────────────── */
.tut-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
}
.tut-overlay[hidden] {
  display: none;
}

/* One prompt at a time (home/includes/prompt_queue.html): while the tour
   holds the screen, a queued cookie notice / app banner / install prompt
   steps aside and comes back when the tour ends. */
html[data-mb-prompt="tour"] #cookie-warning,
html[data-mb-prompt="tour"] #app-download-banner,
html[data-mb-prompt="tour"] #pwa-install-banner {
  visibility: hidden;
}

/* Scrim with the spotlight cutout (the mask lives in the SVG). */
.tut-mask-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.tut-scrim {
  fill: var(--ds-overlay);
}
#tut-spotlight-rect {
  transition: x 250ms cubic-bezier(0.4, 0, 0.2, 1),
              y 250ms cubic-bezier(0.4, 0, 0.2, 1),
              width 250ms cubic-bezier(0.4, 0, 0.2, 1),
              height 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Tooltip card ────────────────────────────────────────── */
.tut-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9100;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
  width: 320px;
  max-width: calc(100vw - 32px);
  padding: 16px;
  border-radius: var(--radius-lg, 16px);
  background: var(--ds-elevated);
  box-shadow: var(--ds-shadow-elevated);
  color: var(--ds-ink);
  font-family: 'SFProText', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  transition: top 250ms cubic-bezier(0.4, 0, 0.2, 1), left 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.tut-tooltip:focus {
  outline: none;
}
.tut-tooltip.tut-entering {
  animation: tutFadeUp 250ms cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes tutFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tut-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tut-step-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--ds-brand);
  color: var(--ds-on-cta);
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
}
.tut-skip {
  min-height: 32px;
  padding: 0 4px;
  border: none;
  border-radius: var(--radius-sm, 8px);
  background: none;
  color: var(--ds-ink-soft);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  cursor: pointer;
  transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.tut-skip:hover {
  color: var(--ds-ink);
}
.tut-title {
  margin: 0;
  color: var(--ds-ink);
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  line-height: 24px;
}
.tut-body {
  margin: 0;
  color: var(--ds-ink-soft);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
}

/* Progress dots: past + current are brand, future is a hairline grey.
   The badge carries the same information as text. */
.tut-dots {
  display: flex;
  align-items: center;
  gap: 4px;
}
.tut-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--ds-line);
  transition: width 150ms cubic-bezier(0.4, 0, 0.2, 1), background-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.tut-dot.done,
.tut-dot.active {
  background: var(--ds-brand);
}
.tut-dot.active {
  width: 16px;
}

/* Action row: ghost Back + the one primary action. */
.tut-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tut-btn {
  min-height: 36px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-md, 12px);
  font: inherit;
  font-size: 14px;
  line-height: 20px;
  cursor: pointer;
  transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.tut-btn[hidden] {
  display: none;
}
.tut-btn-back {
  background: none;
  color: var(--ds-ink);
  font-weight: 600;
}
.tut-btn-back:hover {
  background: var(--ds-surface);
}
.tut-btn-next {
  margin-left: auto;
  background: var(--ds-brand);
  color: var(--ds-on-cta);
  font-weight: 700;
}
.tut-btn-next:hover {
  background: var(--ds-brand-hover);
}
.tut-tooltip button:focus-visible {
  outline: 3px solid var(--ds-focus);
  outline-offset: 2px;
}

/* ── "Replay the tour" menu entry (tutorial/tour-replay.html) ── */
.tut-replay {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: none;
  color: var(--ds-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.tut-replay .material-icons-outlined {
  color: var(--ds-brand-strong);
}
.tut-replay:focus-visible {
  outline: 3px solid var(--ds-focus);
  outline-offset: -3px;
}
/* Mobile slide-down menu: a row like its neighbours. */
.tut-replay--row {
  box-sizing: border-box;
  min-height: 48px;
  margin-bottom: 16px;
  padding: 16px;
  border-radius: var(--radius-sm, 8px);
  background: var(--ds-surface);
  font-size: 16px;
  font-weight: 600;
}
.tut-replay--row .material-icons-outlined {
  font-size: 32px;
}
/* Desktop user menu (signed in). */
.tut-replay--menu {
  padding: 12px 16px;
  border-top: 1px solid var(--ds-line);
  font-size: 16px;
  font-weight: 500;
}
/* Desktop "Explore More" dropdown (guests). */
.tut-replay--explore {
  margin-top: 20px;
  padding: 0;
  font-size: 16px;
  font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {
  .tut-tooltip,
  .tut-dot,
  #tut-spotlight-rect {
    transition: none;
  }
  .tut-tooltip.tut-entering {
    animation: none;
  }
}
