/* Tour guiado — estilo Figma Make (modal + viñeta limpia) */

:root {
  --tuko-tour-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --tuko-tour-brand: #3d50f2;
  --tuko-tour-dim: rgba(15, 23, 42, 0.62);
}

.tuko-tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: transparent;
  pointer-events: auto;
}

.tuko-tour-overlay.is-welcome {
  pointer-events: none;
}

.tuko-tour-spotlight {
  position: fixed;
  z-index: 12001;
  border-radius: 1rem;
  box-shadow:
    0 0 0 2px rgba(61, 80, 242, 0.55),
    0 0 0 6px rgba(61, 80, 242, 0.14),
    0 0 22px 1px rgba(61, 80, 242, 0.2),
    0 0 0 9999px var(--tuko-tour-dim);
  outline: none;
  pointer-events: none;
  opacity: 0;
  /* Geometría solo vía WAAPI/JS: en Firefox la transition CSS
     hacía un segundo desplazamiento tras commitStyles. */
  transition: opacity 0.4s var(--tuko-tour-ease);
}

.tuko-tour-spotlight.is-compact {
  box-shadow:
    0 0 0 2px rgba(61, 80, 242, 0.75),
    0 0 0 4px rgba(61, 80, 242, 0.16),
    0 0 12px 0 rgba(61, 80, 242, 0.22),
    0 0 0 9999px var(--tuko-tour-dim);
}

.tuko-tour-spotlight.is-dimming {
  opacity: 0 !important;
}

.tuko-tour-target {
  position: relative;
  z-index: 12002 !important;
  pointer-events: none !important;
  filter: brightness(1.06) saturate(1.05);
  transition: filter 0.32s var(--tuko-tour-ease);
}

/* —— Bienvenida: card sobre scrim blur —— */
.tuko-tour-welcome {
  position: fixed;
  inset: 0;
  z-index: 12004;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.32s var(--tuko-tour-ease);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

.tuko-tour-welcome.is-active {
  display: flex;
  opacity: 1;
}

.tuko-tour-welcome.is-leaving {
  opacity: 0;
}

.tuko-tour-welcome__scrim {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: auto;
}

.tuko-tour-welcome__card {
  position: relative;
  z-index: 1;
  width: min(28.75rem, 92vw);
  padding: 3.25rem 3.25rem 2.75rem;
  border-radius: 1.25rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.1),
    0 8px 24px rgba(0, 0, 0, 0.05);
  text-align: center;
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px) scale(0.985);
}

.tuko-tour-welcome.is-playing .tuko-tour-welcome__card {
  animation: tukoTourCardIn 0.72s var(--tuko-tour-ease) 0.04s both;
}

/* Base visible con is-active: si is-playing no llega o la animación no corre, no queda solo el blur */
.tuko-tour-welcome.is-active .tuko-tour-welcome__card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.tuko-tour-welcome.is-active .tuko-tour-welcome__logo,
.tuko-tour-welcome.is-active .tuko-tour-welcome__title,
.tuko-tour-welcome.is-active .tuko-tour-welcome__sub,
.tuko-tour-welcome.is-active .tuko-tour-welcome__actions,
.tuko-tour-welcome.is-active .tuko-tour-welcome__eyebrow {
  opacity: 1;
  transform: none;
}

.tuko-tour-welcome.is-active.tuko-tour-welcome--done .tuko-tour-welcome__mark {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  /* No matar animaciones del welcome/done: en Windows "reducir movimiento"
     dejaba solo el popup estático. La visibilidad ya la garantiza is-active. */
}

/* Fallback si la animación CSS no llega a pintar la card (solo blur) */
.tuko-tour-welcome--solid .tuko-tour-welcome__card,
.tuko-tour-welcome--solid .tuko-tour-welcome__logo,
.tuko-tour-welcome--solid .tuko-tour-welcome__title,
.tuko-tour-welcome--solid .tuko-tour-welcome__sub,
.tuko-tour-welcome--solid .tuko-tour-welcome__actions,
.tuko-tour-welcome--solid .tuko-tour-welcome__eyebrow,
.tuko-tour-welcome--solid .tuko-tour-welcome__mark,
.tuko-tour-welcome--solid .tuko-tour-welcome__check {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

.tuko-tour-welcome--solid .tuko-tour-welcome__check-path {
  stroke-dashoffset: 0 !important;
  animation: none !important;
}

.tuko-tour-welcome__wash {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 15rem;
  background: radial-gradient(ellipse 70% 55% at 50% 0%, rgba(61, 80, 242, 0.055) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0.65;
}

.tuko-tour-welcome__logo {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2rem;
  opacity: 0;
  transform: translateY(10px) scale(0.92);
}

.tuko-tour-welcome__logo::before {
  content: '';
  position: absolute;
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(61, 80, 242, 0.16) 0%, rgba(61, 80, 242, 0) 70%);
  transform: scale(0.6);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

.tuko-tour-welcome__mark {
  display: none;
}

.tuko-tour-welcome__eyebrow {
  position: relative;
  margin: 0 0 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #3d50f2;
  opacity: 0;
  transform: translateY(10px);
}

.tuko-tour-welcome__logo-mark {
  position: relative;
  z-index: 1;
  display: block;
  width: min(11.5rem, 52vw);
  height: 3.85rem;
  background-color: #0f172a;
  -webkit-mask-image: var(--tuko-tour-logo);
  mask-image: var(--tuko-tour-logo);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.tuko-tour-welcome__title {
  position: relative;
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.3;
  color: #0f172a;
  opacity: 0;
  transform: translateY(10px);
}

.tuko-tour-welcome__sub {
  position: relative;
  margin: 0 auto 2.25rem;
  max-width: 22rem;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.65;
  color: #475569;
  opacity: 0;
  transform: translateY(10px);
}

.tuko-tour-welcome__actions {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  opacity: 0;
  transform: translateY(10px);
}

.tuko-tour-welcome--done .tuko-tour-welcome__logo {
  display: none;
}

.tuko-tour-welcome--done .tuko-tour-welcome__mark {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  width: 4.75rem;
  height: 4.75rem;
  opacity: 0;
  transform: translateY(10px) scale(0.86);
}

.tuko-tour-welcome__check-ring {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 2px solid rgba(61, 80, 242, 0.35);
  opacity: 0;
  transform: scale(0.55);
  pointer-events: none;
}

.tuko-tour-welcome--done .tuko-tour-welcome__check {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 999px;
  background: linear-gradient(145deg, #3d50f2 0%, #5b6cf5 100%);
  color: #ffffff;
  box-shadow:
    0 0 0 8px rgba(61, 80, 242, 0.12),
    0 12px 28px -10px rgba(61, 80, 242, 0.55);
  transform: scale(0.55);
  opacity: 0;
}

.tuko-tour-welcome--done .tuko-tour-welcome__check svg {
  width: 1.5rem;
  height: 1.5rem;
  overflow: visible;
}

.tuko-tour-welcome__check-path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.tuko-tour-welcome--done .tuko-tour-welcome__wash {
  background: radial-gradient(ellipse 70% 55% at 50% 0%, rgba(61, 80, 242, 0.1) 0%, transparent 70%);
}

.tuko-tour-welcome--done .tuko-tour-welcome__title {
  font-size: 1.625rem;
  letter-spacing: -0.02em;
}

.tuko-tour-welcome.is-playing .tuko-tour-welcome__wash {
  animation: tukoTourWashIn 0.82s var(--tuko-tour-ease) 0.08s both;
}

.tuko-tour-welcome.is-playing .tuko-tour-welcome__logo {
  animation: tukoTourLogoPop 0.82s var(--tuko-tour-ease) 0.16s both;
}

.tuko-tour-welcome.is-playing .tuko-tour-welcome__logo::before {
  animation: tukoTourLogoGlow 1s var(--tuko-tour-ease) 0.26s both;
}

.tuko-tour-welcome.is-playing .tuko-tour-welcome__logo-mark {
  animation: tukoTourLogoShine 1.2s var(--tuko-tour-ease) 0.32s both;
}

.tuko-tour-welcome.is-playing.tuko-tour-welcome--done .tuko-tour-welcome__mark {
  animation: tukoTourDoneMark 0.6s var(--tuko-tour-ease) 0.12s both;
}

.tuko-tour-welcome.is-playing.tuko-tour-welcome--done .tuko-tour-welcome__check {
  animation: tukoTourCheckIn 0.52s var(--tuko-tour-ease) 0.2s both;
}

.tuko-tour-welcome.is-playing.tuko-tour-welcome--done .tuko-tour-welcome__check-ring {
  animation: tukoTourCheckRing 0.86s var(--tuko-tour-ease) 0.24s both;
}

.tuko-tour-welcome.is-playing.tuko-tour-welcome--done .tuko-tour-welcome__check-path {
  animation: tukoTourCheckDraw 0.64s ease-out 0.36s forwards;
}

.tuko-tour-welcome.is-playing .tuko-tour-welcome__eyebrow {
  animation: tukoTourFadeUp 0.52s var(--tuko-tour-ease) 0.32s both;
}
.tuko-tour-welcome.is-playing .tuko-tour-welcome__title {
  animation: tukoTourFadeUp 0.52s var(--tuko-tour-ease) 0.42s both;
}
.tuko-tour-welcome.is-playing .tuko-tour-welcome__sub {
  animation: tukoTourFadeUp 0.52s var(--tuko-tour-ease) 0.52s both;
}
.tuko-tour-welcome.is-playing .tuko-tour-welcome__actions {
  animation: tukoTourFadeUp 0.52s var(--tuko-tour-ease) 0.62s both;
}

@keyframes tukoTourCardIn {
  0% { opacity: 0; transform: translateY(22px) scale(0.96); }
  70% { opacity: 1; transform: translateY(-3px) scale(1.01); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes tukoTourFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes tukoTourWashIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes tukoTourLogoPop {
  0% { opacity: 0; transform: translateY(16px) scale(0.86); }
  58% { opacity: 1; transform: translateY(-3px) scale(1.04); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes tukoTourLogoGlow {
  0% { opacity: 0; transform: scale(0.45); }
  45% { opacity: 1; transform: scale(1.08); }
  100% { opacity: 0.55; transform: scale(1); }
}

@keyframes tukoTourLogoShine {
  0% { filter: brightness(1); }
  40% { filter: brightness(1.16); }
  100% { filter: brightness(1); }
}

@keyframes tukoTourDoneMark {
  from { opacity: 0; transform: translateY(12px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes tukoTourCheckIn {
  from { opacity: 0; transform: scale(0.88); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes tukoTourCheckRing {
  0% { opacity: 0.7; transform: scale(0.7); }
  100% { opacity: 0; transform: scale(1.35); }
}

@keyframes tukoTourCheckDraw {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

/* —— Viñeta / coachmark —— */
.tuko-tour-popover {
  position: fixed;
  z-index: 12003;
  width: min(21.25rem, calc(100vw - 1.5rem));
  padding: 1.25rem;
  border-radius: 1rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.08),
    0 2px 8px rgba(0, 0, 0, 0.04);
  color: #0f172a;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  pointer-events: none;
  will-change: opacity, transform, top, left;
  /* Opacity/transform solo vía WAAPI: en Firefox la transition CSS
     re-disparaba el fade al limpiar estilos inline tras commitStyles. */
  transition: none;
}

.tuko-tour-popover.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.tuko-tour-popover.is-leaving {
  opacity: 0;
  transform: translateY(-14px) scale(0.96);
  pointer-events: none;
}

.tuko-tour-popover.is-moving {
  /* Sin transition de posición: en Firefox + scroll/onResize
     se veía un segundo “salto” del cartel tras el fade. */
  transition: none;
}

.tuko-tour-popover::before {
  content: '';
  position: absolute;
  width: 0.8125rem;
  height: 0.8125rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  transform: rotate(45deg);
}

.tuko-tour-popover.is-measuring {
  /* Solo medir tamaño: sin flash visible */
  opacity: 0 !important;
  transform: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.tuko-tour-popover[data-placement='bottom']::before {
  top: -0.42rem;
  left: var(--tuko-tour-arrow-x, 1.25rem);
  margin-left: -0.4rem;
  border-right: none;
  border-bottom: none;
  border-radius: 2px 0 0 0;
}

.tuko-tour-popover[data-placement='top']::before {
  bottom: -0.42rem;
  left: var(--tuko-tour-arrow-x, 1.25rem);
  margin-left: -0.4rem;
  border-left: none;
  border-top: none;
  border-radius: 0 0 4px 0;
}

.tuko-tour-popover[data-placement='right']::before {
  left: -0.42rem;
  top: var(--tuko-tour-arrow-y, 50%);
  margin-top: -0.4rem;
  border-right: none;
  border-top: none;
}

.tuko-tour-popover[data-placement='left']::before {
  right: -0.42rem;
  top: var(--tuko-tour-arrow-y, 50%);
  margin-top: -0.4rem;
  border-left: none;
  border-bottom: none;
}

.tuko-tour-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
}

.tuko-tour-popover-progress {
  display: flex;
  align-items: center;
  gap: 0.3125rem;
}

.tuko-tour-dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 999px;
  background: #cbd5e1;
  transition: width 0.25s ease, background 0.25s ease;
}

.tuko-tour-dot.is-active {
  width: 1.375rem;
  background: var(--tuko-tour-brand);
}

.tuko-tour-dot.is-done {
  background: #94a3b8;
}

.tuko-tour-popover-step {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #94a3b8;
  flex-shrink: 0;
}

.tuko-tour-popover-copy {
  transition: opacity 0.28s var(--tuko-tour-ease), transform 0.28s var(--tuko-tour-ease);
}

.tuko-tour-popover-copy.is-leaving {
  opacity: 0;
  transform: translateY(-10px);
}

.tuko-tour-popover-copy.is-entering {
  opacity: 0;
  transform: translateY(12px);
}

.tuko-tour-popover-title {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #0f172a;
  line-height: 1.4;
}

.tuko-tour-popover-body {
  margin: 0 0 1.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.65;
  color: #475569;
}

.tuko-tour-popover-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.tuko-tour-popover-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tuko-tour-btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 0.5rem;
  padding: 0.4375rem 1rem;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s var(--tuko-tour-ease);
}

.tuko-tour-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.tuko-tour-btn--block {
  width: 100%;
  padding: 0.8125rem 1rem;
  font-size: 0.9375rem;
  font-weight: 700;
  border-radius: 0.625rem;
  letter-spacing: -0.01em;
}

.tuko-tour-btn--ghost {
  background: transparent;
  color: #94a3b8;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  font-weight: 500;
}

.tuko-tour-btn--ghost:hover:not(:disabled) {
  color: #64748b;
}

.tuko-tour-btn--secondary {
  background: transparent;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.tuko-tour-btn--secondary:hover:not(:disabled) {
  background: #f8fafc;
}

.tuko-tour-btn--primary {
  background: var(--tuko-tour-brand);
  color: #ffffff;
  font-weight: 600;
}

.tuko-tour-btn--primary:hover:not(:disabled) {
  background: #3242d4;
}

.tuko-tour-btn--primary:active:not(:disabled) {
  transform: scale(0.98);
}

html.tuko-tour-active,
html.tuko-tour-active body {
  /* Bloquear scroll manual: evita que el foco/viñeta se desalineen */
  overflow: hidden !important;
  overscroll-behavior: none;
}

html.tuko-tour-active .tuko-content {
  overflow: hidden !important;
  overscroll-behavior: none;
  /* El tour hace scroll programático al target; el usuario no debe mover la página */
  overscroll-behavior-y: none;
}

@media (prefers-reduced-motion: reduce) {
  .tuko-tour-dot,
  .tuko-tour-target {
    transition: none !important;
    animation: none !important;
  }
}

/* Ajustes: replay */
.tuko-settings-tour-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding-top: 0.25rem;
}

.tuko-settings-tour-help {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #64748b;
  line-height: 1.45;
}

.tuko-settings-tour-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 0.55rem;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.tuko-settings-tour-btn:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #3d50f2;
}
