/* ── Reindeer product tour overlay ────────────────────────────────────────
 * Brand tokens pulled from the Reindeer design system + the existing app:
 *   forest green #00543C  (primary CTA, accents, spotlight ring)
 *   cream        #f7f5f0  (welcome / tooltip surfaces, app background)
 *   ink          #0B0B0B  (top bar, primary text on cream)
 *   lime         #D4F25C  (secondary accent on dark backgrounds)
 * Type: Montserrat (loaded from Google Fonts).
 * ──────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

:root {
  --tour-green: #00543C;
  --tour-green-hover: #003D2C;
  --tour-green-tint: #f0fdf4;
  --tour-lime: #D4F25C;
  --tour-cream: #f7f5f0;
  --tour-cream-2: #fffdf7;
  --tour-ink: #0B0B0B;
  --tour-ink-2: #1f2937;
  --tour-muted: #6b7280;
  --tour-border: #e5e7eb;
  --tour-font: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#tourBackdrop {
  position: fixed; inset: 0;
  background: rgba(11, 11, 11, 0.30);
  z-index: 9000;
  pointer-events: auto;            /* swallow clicks so viewer can't free-roam */
  cursor: default;
}

#tourSpotlight {
  position: fixed;
  border-radius: 10px;
  box-shadow:
    0 0 0 9999px rgba(11, 11, 11, 0.62),
    0 0 0 3px var(--tour-lime),
    0 0 0 6px rgba(0, 84, 60, 0.55),
    0 14px 38px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  transition: top .55s cubic-bezier(.4,0,.2,1),
              left .55s cubic-bezier(.4,0,.2,1),
              width .55s cubic-bezier(.4,0,.2,1),
              height .55s cubic-bezier(.4,0,.2,1);
  z-index: 9001;
}

/* ── Tooltip card ── */
#tourTooltip {
  position: fixed;
  z-index: 9002;
  background: var(--tour-cream);
  border-radius: 14px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.22), 0 2px 8px rgba(0, 0, 0, 0.10);
  width: 340px;
  max-width: calc(100vw - 32px);
  padding: 18px 18px 14px;
  font-family: var(--tour-font);
  color: var(--tour-ink-2);
  border: 1px solid rgba(0, 84, 60, 0.10);
}
#tourTooltip .t-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--tour-ink);
  margin-bottom: 8px;
  font-family: var(--tour-font);
}
#tourTooltip .t-body {
  font-size: 13px;
  line-height: 1.55;
  color: #374151;
  margin-bottom: 16px;
  font-family: var(--tour-font);
}
#tourTooltip .t-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
}
#tourTooltip .t-count {
  font-size: 11px;
  color: var(--tour-green);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
#tourTooltip .t-actions { display: flex; gap: 6px; }
#tourTooltip .t-btn {
  font: inherit;
  font-family: var(--tour-font);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--tour-border);
  background: #fff;
  color: var(--tour-ink-2);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
#tourTooltip .t-btn:hover:not(:disabled) { background: #f9fafb; border-color: #d1d5db; }
#tourTooltip .t-btn:disabled { opacity: 0.45; cursor: not-allowed; }
#tourTooltip .t-btn.primary {
  background: var(--tour-green);
  color: #fff;
  border-color: var(--tour-green);
}
#tourTooltip .t-btn.primary:hover:not(:disabled) { background: var(--tour-green-hover); border-color: var(--tour-green-hover); }
#tourTooltip .t-close {
  position: absolute; top: 10px; right: 10px;
  width: 26px; height: 26px;
  background: transparent; border: none;
  font-size: 18px; line-height: 1; color: var(--tour-muted);
  cursor: pointer; border-radius: 6px;
}
#tourTooltip .t-close:hover { background: rgba(0, 84, 60, 0.08); color: var(--tour-ink); }

/* arrow pointer */
#tourTooltip::before {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  background: var(--tour-cream);
  transform: rotate(45deg);
  z-index: -1;
  border: 1px solid rgba(0, 84, 60, 0.10);
}
#tourTooltip.side-top::before    { bottom: -8px; left: calc(50% - 7px); border-top: none; border-left: none; }
#tourTooltip.side-bottom::before { top: -8px;    left: calc(50% - 7px); border-bottom: none; border-right: none; }
#tourTooltip.side-left::before   { right: -8px;  top: calc(50% - 7px);  border-left: none; border-bottom: none; }
#tourTooltip.side-right::before  { left: -8px;   top: calc(50% - 7px);  border-right: none; border-top: none; }
#tourTooltip.side-center::before { display: none; }

/* ── Welcome modal (cream, on-brand) ── */
#tourWelcome, #tourEnd {
  position: fixed;
  z-index: 9003;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--tour-cream);
  color: var(--tour-ink);
  width: 440px;
  max-width: calc(100vw - 32px);
  border-radius: 18px;
  padding: 28px 28px 24px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 84, 60, 0.06);
  font-family: var(--tour-font);
}
#tourWelcome .w-logo {
  display: flex; justify-content: center; align-items: center;
  margin: 0 auto 14px;
  width: 56px; height: 56px;
  background: var(--tour-ink);
  border-radius: 14px;
}
#tourWelcome .w-logo svg { width: 32px; height: 32px; }
#tourWelcome .w-eyebrow {
  font-size: 11px;
  color: var(--tour-green);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
#tourWelcome h2, #tourEnd h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  color: var(--tour-ink);
  font-family: var(--tour-font);
}
#tourWelcome p, #tourEnd p {
  font-size: 13.5px;
  line-height: 1.55;
  color: #374151;
  margin: 0 0 22px;
}
#tourWelcome .w-input {
  width: 100%;
  background: #fff;
  border: 1px solid var(--tour-border);
  color: var(--tour-ink);
  font: inherit;
  font-family: var(--tour-font);
  font-size: 13px;
  padding: 12px 13px;
  border-radius: 10px;
  margin-bottom: 12px;
  outline: none;
}
#tourWelcome .w-input::placeholder { color: #9ca3af; }
#tourWelcome .w-input:focus { border-color: var(--tour-green); box-shadow: 0 0 0 3px rgba(0, 84, 60, 0.15); }
#tourWelcome .w-cta, #tourEnd .e-cta {
  display: block;
  width: 100%;
  background: var(--tour-green);
  color: #fff;
  font: inherit;
  font-family: var(--tour-font);
  font-size: 14px;
  font-weight: 700;
  padding: 13px 16px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s, opacity .15s;
}
#tourWelcome .w-cta:hover:not(:disabled) { background: var(--tour-green-hover); }
#tourWelcome .w-cta:disabled {
  background: #d1d5db;
  color: #fff;
  cursor: not-allowed;
}
#tourWelcome .w-skip {
  display: inline-block;
  margin-top: 12px;
  font-size: 12px;
  color: var(--tour-muted);
  background: none; border: none;
  cursor: pointer;
  font-family: var(--tour-font);
}
#tourWelcome .w-skip:hover { color: var(--tour-ink); }
#tourWelcome .w-close, #tourEnd .e-close {
  position: absolute; top: 12px; right: 12px;
  background: transparent; border: none;
  width: 28px; height: 28px;
  color: var(--tour-muted); cursor: pointer; font-size: 20px; line-height: 1;
  border-radius: 6px;
}
#tourWelcome .w-close:hover, #tourEnd .e-close:hover { background: rgba(0, 84, 60, 0.08); color: var(--tour-ink); }

/* ── End / branching dialog ── */
#tourEnd { width: 480px; }
#tourEnd .e-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}
#tourEnd .e-btn {
  display: block;
  width: 100%;
  background: #fff;
  border: 1px solid var(--tour-border);
  color: var(--tour-ink-2);
  font: inherit;
  font-family: var(--tour-font);
  font-size: 12.5px;
  font-weight: 600;
  padding: 12px 10px;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  transition: background .15s, border-color .15s, color .15s;
}
#tourEnd .e-btn:hover { background: var(--tour-green-tint); border-color: var(--tour-green); color: var(--tour-green); }
#tourEnd .e-btn.primary {
  grid-column: 1 / -1;
  background: var(--tour-green);
  color: #fff;
  border-color: var(--tour-green);
  font-size: 13.5px;
  padding: 13px 12px;
  margin-bottom: 4px;
}
#tourEnd .e-btn.primary:hover { background: var(--tour-green-hover); border-color: var(--tour-green-hover); color: #fff; }

/* ── Persistent launcher pill ── */
#tourLauncher {
  position: fixed;
  bottom: 20px; right: 20px;
  background: var(--tour-ink);
  color: #fff;
  font: inherit;
  font-family: var(--tour-font);
  font-size: 12.5px;
  font-weight: 600;
  padding: 10px 16px 10px 14px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  z-index: 8000;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.20);
  transition: transform .15s, box-shadow .15s;
}
#tourLauncher:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25); }
#tourLauncher .l-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--tour-lime);
}
#tourLauncher.hidden { display: none; }

/* When a welcome/end modal is showing, lock page scroll. Tooltip steps allow scrolling. */
body.tour-modal-open { overflow: hidden; }

/* Small screens */
@media (max-width: 520px) {
  #tourTooltip { width: calc(100vw - 32px); }
  #tourWelcome, #tourEnd { width: calc(100vw - 32px); }
  #tourEnd .e-actions { grid-template-columns: 1fr; }
}
