/* ============================================================================
   SalePilot — Авто-тур (salepilot-autotour.css)
   Прожектор + подпись + контролы поверх реального интерфейса.
   Откат: убрать <link>/<script> autotour и кнопку #autoTourBtn из index.html.
   ========================================================================== */

.tour-root {
  position: fixed;
  inset: 0;
  z-index: 2147483600;
  animation: tour-fade-in 0.3s ease both;
}
.tour-root.is-closing {
  animation: tour-fade-out 0.3s ease both;
}

/* прожектор: огромная тень создаёт затемнение вокруг подсвеченного блока */
.tour-spot {
  position: fixed;
  top: 0; left: 0; width: 0; height: 0;
  border-radius: 18px;
  box-shadow: 0 0 0 9999px rgba(6, 8, 18, 0.74);
  outline: 1.5px solid rgba(124, 77, 255, 0.85);
  outline-offset: 2px;
  pointer-events: none;
  transition: top 0.6s cubic-bezier(.4,0,.2,1), left 0.6s cubic-bezier(.4,0,.2,1),
              width 0.6s cubic-bezier(.4,0,.2,1), height 0.6s cubic-bezier(.4,0,.2,1);
}
.tour-spot::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 20px;
  box-shadow: 0 0 40px rgba(124, 77, 255, 0.55), inset 0 0 22px rgba(124, 77, 255, 0.25);
  pointer-events: none;
  animation: tour-pulse 2.2s ease-in-out infinite;
}

.tour-caption {
  position: fixed;
  left: 0; top: 0;
  width: min(340px, calc(100vw - 24px));
  padding: 16px 18px;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(28, 24, 56, 0.96), rgba(14, 16, 30, 0.96));
  border: 1px solid rgba(124, 77, 255, 0.45);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55), 0 0 24px rgba(124, 77, 255, 0.3);
  color: #f4f6ff;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease, top 0.55s cubic-bezier(.4,0,.2,1), left 0.55s cubic-bezier(.4,0,.2,1);
}
.tour-caption.is-in {
  opacity: 1;
  transform: translateY(0);
}
.tour-caption h3 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}
.tour-caption p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: #b9c0e6;
}
.tour-caption::before {
  content: "▶ Авто-демо";
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #c9bcff;
  background: rgba(124, 77, 255, 0.18);
  border: 1px solid rgba(124, 77, 255, 0.4);
}

.tour-bar {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(12, 14, 26, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55);
}
.tour-dots {
  display: flex;
  gap: 7px;
}
.tour-dots i {
  width: 22px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  transition: background 0.3s ease, transform 0.3s ease;
}
.tour-dots i.is-done { background: rgba(124, 77, 255, 0.6); }
.tour-dots i.is-active {
  background: linear-gradient(90deg, #7c4dff, #22e6b3);
  transform: scaleY(1.5);
}

.tour-controls {
  display: flex;
  gap: 8px;
}
.tour-btn {
  cursor: pointer;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #e9ecff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background 0.18s ease, transform 0.12s ease, border-color 0.18s ease;
}
.tour-btn:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-1px); }
.tour-btn:active { transform: translateY(0); }
.tour-btn.tour-next {
  color: #fff;
  background: linear-gradient(135deg, #7c4dff, #5a32cf);
  border-color: rgba(124, 77, 255, 0.6);
}
.tour-btn.tour-exit {
  color: #ffd7dc;
  border-color: rgba(255, 107, 122, 0.35);
}

/* кнопка запуска на лендинге */
#autoTourBtn {
  position: relative;
  overflow: hidden;
}
#autoTourBtn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.18) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: tour-shine 3.6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes tour-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes tour-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes tour-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}
@keyframes tour-shine {
  0%, 60% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

@media (prefers-reduced-motion: reduce) {
  .tour-spot, .tour-caption { transition: none !important; }
  .tour-spot::after, #autoTourBtn::after { animation: none !important; }
}
