/* ═══════════════════════════════════════════
   TUTORIAL.CSS — Overlay de tutorial interactivo
   ═══════════════════════════════════════════ */

/* ── OVERLAY PRINCIPAL ── */
.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 8000;
  pointer-events: none;
}

/* ── BACKDROP OSCURO con recorte spotlight ── */
.tutorial-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  pointer-events: all;
  transition: background 0.4s ease;
}

/* Cuando hay un elemento iluminado, el backdrop usa clip-path para recortarse */
.tutorial-backdrop.con-spotlight {
  clip-path: polygon(
    0% 0%,
    0% 100%,
    var(--spot-x) 100%,
    var(--spot-x) var(--spot-y),
    calc(var(--spot-x) + var(--spot-w)) var(--spot-y),
    calc(var(--spot-x) + var(--spot-w)) calc(var(--spot-y) + var(--spot-h)),
    var(--spot-x) calc(var(--spot-y) + var(--spot-h)),
    var(--spot-x) 100%,
    100% 100%,
    100% 0%
  );
  transition: clip-path 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── ANILLO RESALTADOR sobre el elemento ── */
.tutorial-ring {
  position: fixed;
  z-index: 8004;
  border: 3px solid var(--fluo);
  border-radius: var(--radius-lg);
  pointer-events: none;
  box-shadow:
    0 0 25px rgba(170,255,0,0.3),
    inset 0 0 0 1px rgba(170,255,0,0.1);
  animation: ringPulse 2s ease-in-out infinite;
  display: none;
}

@keyframes ringPulse {
  0%, 100% { box-shadow: 0 0 25px rgba(170,255,0,0.3); }
  50% { box-shadow: 0 0 35px rgba(170,255,0,0.5); }
}

/* ── TARJETA DEL PASO ── */
.tutorial-card {
  position: fixed;
  z-index: 8002;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow:
    0 24px 60px rgba(0,0,0,0.4),
    0 4px 16px rgba(0,0,0,0.2),
    0 0 0 1px rgba(170,255,0,0.1);
  width: 340px;
  pointer-events: all;
  overflow: hidden;
}

/* Línea decorativa superior */
.tutorial-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--fluo), var(--fluo-dim), transparent);
}

/* ── BARRA DE PROGRESO ── */
.tutorial-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 20px 24px 0;
}

.tprog-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gris-200);
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-bounce), width var(--transition-med);
}

.tprog-dot.completado {
  background: rgba(170,255,0,0.5);
  transform: scale(1);
}

.tprog-dot.activo {
  background: var(--fluo);
  width: 20px;
  border-radius: 3px;
  transform: scale(1);
  box-shadow: 0 0 8px var(--fluo-glow);
}

/* ── CUERPO DEL PASO ── */
.tutorial-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tutorial-emoji {
  font-size: 2rem;
  line-height: 1;
}

.tutorial-titulo {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--negro);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.tutorial-texto {
  font-size: 0.88rem;
  color: var(--gris-600);
  line-height: 1.65;
}

/* ── FOOTER: botones ── */
.tutorial-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--gris-100);
  background: var(--bg-body);
}

.tut-btn-skip {
  font-size: 0.78rem;
  color: var(--gris-400);
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font);
  background: none;
  border: none;
  transition: color var(--transition-fast);
  display: inline-flex;
  align-items: center;
}
.tut-btn-skip:hover { color: var(--negro); text-decoration: underline; }

.tut-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tut-btn-prev {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gris-100);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  transition: background var(--transition-fast), transform var(--transition-bounce), opacity var(--transition-fast);
}
.tut-btn-prev:hover:not(:disabled) { background: var(--gris-200); transform: scale(1.08); }

.tut-btn-next {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--negro);
  color: var(--blanco);
  border: none;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: transform var(--transition-bounce), background var(--transition-fast), box-shadow var(--transition-med);
}

.tut-btn-next:hover {
  background: var(--fluo);
  color: var(--negro);
  transform: scale(1.05);
  box-shadow: 0 4px 16px var(--fluo-glow);
}

.tut-btn-next:hover svg { stroke: var(--negro); }

/* ── ANIMACIONES ESPECÍFICAS ── */
@keyframes cardEntrada {
  from { transform: scale(0.9) translateY(10px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .tutorial-card {
    width: calc(100vw - 32px);
    left: 16px !important;
    right: 16px;
    top: auto !important;
    bottom: 16px;
    transform: none !important;
  }

  /* En mobile, el spotlight no hace clip complejo */
  .tutorial-backdrop.con-spotlight {
    clip-path: none;
  }
}
