/* ============================================================
   TopoMapping — First-visit onboarding tour
   Modern SaaS onboarding styling
   Brand: --primary-dark #1e5d44 / --accent-yellow #fdbf2d
   ============================================================ */

:root {
  --tm-primary-dark: #1e5d44;
  --tm-accent-yellow: #fdbf2d;
}

/* Layer order (kept above the BMC widget) */
.tm-overlay    { z-index: 2147482000; }
.tm-spotlight  { z-index: 2147482001; }
.tm-tooltip    { z-index: 2147482002; }
.tm-modal-bg   { z-index: 2147482003; }
.tm-toast      { z-index: 2147482004; }
.tm-help       { z-index: 2147481000; }

* { box-sizing: border-box; }

.tm-hidden { display: none !important; }

.tm-font {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- Click-blocking overlay (transparent) ---------- */
.tm-overlay {
  position: fixed;
  inset: 0;
  background: transparent;
  cursor: default;
}

/* ---------- Spotlight (the highlight hole) ---------- */
.tm-spotlight {
  position: fixed;
  top: 0; left: 0;
  width: 0; height: 0;
  border-radius: 12px;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(15, 32, 24, 0.62);
  outline: 2px solid var(--tm-accent-yellow);
  outline-offset: 0px;
  transition: all 0.35s cubic-bezier(.4, 0, .2, 1);
}
.tm-spotlight.tm-pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 14px;
  border: 2px solid var(--tm-accent-yellow);
  animation: tm-pulse 1.6s ease-out infinite;
}
@keyframes tm-pulse {
  0%   { transform: scale(1);    opacity: .9; }
  100% { transform: scale(1.08); opacity: 0; }
}

/* ---------- Tooltip ---------- */
.tm-tooltip {
  position: fixed;
  width: 320px;
  max-width: calc(100vw - 24px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 18px 40px -12px rgba(15, 32, 24, .45), 0 4px 12px rgba(0,0,0,.12);
  padding: 18px 18px 14px;
  color: #1f2937;
  animation: tm-tt-in .28s cubic-bezier(.4, 0, .2, 1);
}
@keyframes tm-tt-in {
  from { opacity: 0; transform: translateY(6px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.tm-tt-arrow {
  position: absolute;
  width: 14px; height: 14px;
  background: #fff;
  transform: rotate(45deg);
  box-shadow: -2px -2px 4px rgba(0,0,0,.04);
}

.tm-tt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.tm-tt-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--tm-primary-dark);
  line-height: 1.2;
}
.tm-skip {
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  flex: 0 0 auto;
  transition: background .15s, color .15s;
}
.tm-skip:hover { background: #f3f4f6; color: #4b5563; }

.tm-tt-body {
  font-size: 14px;
  line-height: 1.5;
  color: #4b5563;
}
.tm-tt-example {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--tm-primary-dark);
  background: rgba(253, 191, 45, .16);
  border: 1px dashed var(--tm-accent-yellow);
  border-radius: 8px;
  padding: 7px 10px;
  font-family: 'Lucida Console', monospace;
}

.tm-tt-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}

/* progress */
.tm-progress { display: flex; align-items: center; gap: 8px; }
.tm-dots { display: flex; gap: 5px; min-width: 151px; }
.tm-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #e5e7eb;
  transition: all .25s;
}
.tm-dot.tm-active { background: var(--tm-accent-yellow); transform: scale(1.25); }
.tm-dot.tm-done   { background: var(--tm-primary-dark); }
.tm-step-text { font-size: 12px; color: #9ca3af; font-weight: 600; margin-left: 2px; }

.tm-nav { display: flex; gap: 8px; }
.tm-btn {
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  border-radius: 9px;
  padding: 8px 16px;
  transition: transform .12s, background .15s, box-shadow .15s;
  font-family: inherit;
}
.tm-btn:active { transform: translateY(1px); }
.tm-btn-ghost {
  background: #f3f4f6;
  color: #4b5563;
}
.tm-btn-ghost:hover { background: #e5e7eb; }
.tm-btn-primary {
  background: var(--tm-primary-dark);
  color: #fff;
  box-shadow: 0 4px 10px -3px rgba(30, 93, 68, .55);
}
.tm-btn-primary:hover { background: #17492f; }
.tm-btn-accent {
  background: var(--tm-accent-yellow);
  color: #4a3a06;
  box-shadow: 0 4px 10px -3px rgba(253, 191, 45, .6);
}
.tm-btn-accent:hover { background: #f5b414; }

/* ---------- Welcome / Final modal ---------- */
.tm-modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(15, 32, 24, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: tm-fade .25s ease;
}
@keyframes tm-fade { from { opacity: 0; } to { opacity: 1; } }

.tm-modal {
  width: 460px;
  max-width: 100%;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 30px 70px -20px rgba(0,0,0,.5);
  overflow: hidden;
  animation: tm-modal-in .32s cubic-bezier(.34, 1.4, .64, 1);
}
@keyframes tm-modal-in {
  from { opacity: 0; transform: translateY(16px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.tm-modal-banner {
  background: linear-gradient(135deg, var(--tm-primary-dark) 0%, #2c7d5e 100%);
  padding: 30px 28px 26px;
  text-align: center;
  position: relative;
}
.tm-modal-banner::after {
  content: "";
  position: absolute;
  bottom: -1px; left: 0; right: 0; height: 5px;
  background: var(--tm-accent-yellow);
}
.tm-modal-emoji { font-size: 42px; line-height: 1; margin-bottom: 10px; }
.tm-modal-title {
  color: #fff;
  font-size: 23px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -.2px;
}
.tm-modal-body { padding: 22px 28px 16px; }
.tm-modal-text {
  font-size: 15px;
  line-height: 1.6;
  color: #4b5563;
  text-align: center;
  margin: 0;
}
.tm-modal-foot {
  padding: 8px 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tm-modal-foot .tm-btn { width: 100%; padding: 12px 16px; font-size: 14px; }
.tm-modal-foot .tm-row { display: flex; gap: 10px; }
.tm-modal-foot .tm-row .tm-btn { flex: 1; }

/* ---------- Contextual tip toast ---------- */
.tm-toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--tm-primary-dark);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 12px 30px -8px rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
}
.tm-toast.tm-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.tm-toast .tm-toast-accent { color: var(--tm-accent-yellow); }

/* ---------- Floating help button + menu ---------- */
.tm-help {
  position: fixed;
  bottom: 92px;
  right: 20px;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 10px;
}
.tm-help-fab {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--tm-primary-dark);
  color: #fff;
  font-size: 22px;
  box-shadow: 0 6px 16px -4px rgba(30, 93, 68, .65);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .18s, background .18s;
}
.tm-help-fab:hover { transform: scale(1.07); background: #17492f; }
.tm-help-fab.tm-open { background: var(--tm-accent-yellow); color: #4a3a06; }

.tm-help-menu {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 40px -12px rgba(0,0,0,.35);
  padding: 6px;
  min-width: 210px;
  transform-origin: bottom right;
  animation: tm-modal-in .2s ease;
}
.tm-help-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  padding: 10px 12px;
  border-radius: 9px;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s;
}
.tm-help-item:hover { background: #f3f4f6; }
.tm-help-item .tm-ico { font-size: 16px; width: 20px; text-align: center; }

@media (max-width: 767px) {
  .tm-help { bottom: 210px; right: 16px; }
  .tm-help-fab { width: 46px; height: 46px; font-size: 19px; }
  .tm-modal-title { font-size: 20px; }
}
