/* Wizard de cotización: overlay a pantalla completa, un paso por pantalla.
   Se abre desde cualquier CTA con [data-wizard-open] y devuelve el foco al
   botón que lo abrió al cerrarse. */
.wizard {
  inset: 0;
  opacity: 0;
  position: fixed;
  transition: opacity 0.28s ease;
  z-index: 100;
}

.wizard[hidden] {
  display: none;
}

.wizard.is-open {
  opacity: 1;
}

.wizard__backdrop {
  background-color: hsl(0 0% 0% / 0.85);
  backdrop-filter: blur(6px);
  inset: 0;
  position: absolute;
}

.wizard__panel {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
  transform: translateY(1.5rem) scale(0.99);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  width: 100%;
}

.wizard.is-open .wizard__panel {
  transform: none;
}

/* Mismo halo rojo del hero, para que el wizard no se sienta otro sitio */
.wizard__panel::before {
  background: radial-gradient(
    52rem 32rem at 50% -8%,
    hsl(var(--accent) / 0.22),
    transparent 66%
  );
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

/* ── Barra superior ───────────────────────────────────────────────────────── */

.wizard__bar {
  align-items: center;
  border-bottom: 1px solid hsl(0 0% 100% / 0.08);
  display: flex;
  flex-shrink: 0;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  position: relative;
  z-index: 1;
}

/* En la barra del wizard el espacio es justo: el logo va más chico. */
.wizard__logo {
  flex-shrink: 0;
  height: 1.6rem;
}

.wizard__close {
  align-items: center;
  border: 1px solid hsl(0 0% 100% / 0.14);
  border-radius: 0.65rem;
  color: hsl(var(--primary-foreground) / 0.8);
  display: flex;
  flex-shrink: 0;
  height: 2.5rem;
  justify-content: center;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
  width: 2.5rem;
}

.wizard__close:hover {
  background-color: hsl(0 0% 100% / 0.07);
  color: hsl(var(--primary-foreground));
}

.wizard__close svg {
  height: 1.15rem;
  width: 1.15rem;
}

/* Barra de progreso pegada al borde inferior de la barra */
.wizard__progress {
  background-color: hsl(0 0% 100% / 0.08);
  bottom: -1px;
  height: 2px;
  left: 0;
  position: absolute;
  right: 0;
}

.wizard__progress-fill {
  background-image: linear-gradient(
    to right,
    hsl(var(--accent)),
    hsl(var(--accent-light))
  );
  display: block;
  height: 100%;
  transform-origin: left;
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  width: 33.33%;
}

/* El stepper vive en la barra: horizontal y compacto */
.wizard__bar .stepper {
  margin-bottom: 0;
}

.wizard__bar .stepper__link {
  flex-direction: row;
  gap: 0.5rem;
}

.wizard__bar .stepper__icon {
  height: 2.1rem;
  width: 2.1rem;
}

.wizard__bar .stepper__icon svg {
  height: 1rem;
  width: 1rem;
}

/* ── Cuerpo: una pantalla por paso ────────────────────────────────────────── */

.wizard__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  overflow-y: auto;
  padding: 1.75rem 1.25rem 2.5rem;
  position: relative;
  z-index: 1;
}

.wizard__screen {
  margin-inline: auto;
  max-width: 44rem;
  width: 100%;
}

/* Transición entre pasos: entra desde el lado al que vas */
@keyframes wizard-step-next {
  from {
    opacity: 0;
    transform: translateX(2rem);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes wizard-step-prev {
  from {
    opacity: 0;
    transform: translateX(-2rem);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.form-step.is-entering-next {
  animation: wizard-step-next 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.form-step.is-entering-prev {
  animation: wizard-step-prev 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Bloquea el scroll del documento mientras el wizard está abierto */
body.is-wizard-open {
  overflow: hidden;
}

@media (max-width: 519px) {
  /* En pantallas chicas sólo quedan los íconos del stepper */
  .wizard__bar .stepper__label {
    display: none;
  }

  .wizard__bar .stepper__line {
    width: 1.25rem;
  }
}

@media (min-width: 768px) {
  .wizard__bar {
    padding-inline: 2rem;
  }

  .wizard__body {
    padding: 2.5rem 2rem 3rem;
  }
}
