/* Lo que comparten el asistente de /crear y la vista previa (prototipo «Paso a paso»): la barra blanca fija de arriba, el
   botón gordo de la marca (el mismo «Siguiente» y «Pagar» en cualquier mundo, con los colores medidos de la venta: blanco
   sobre rosa 5.3:1) y el botón fantasma de «Atrás». Va detrás de la hoja del mundo, así que lleva sus propios colores. */
:root {
  --asiste-tinta: #2A1733;
  --asiste-acento: #D1006E;
  --asiste-texto: #B8005F; /* 5.3:1 sobre blanco */
  --asiste-suave: #5C4863; /* 7.6:1 sobre blanco */
  --asiste-foco: #1F5FD8;
}

/* La barra de arriba: blanca, con su sombra, fija; top la sigue al teclado (viewport.js). */
.asistente-fijo {
  position: sticky; top: var(--vv-arriba, 0px); z-index: 20; padding: 0 16px 10px; background: #fff; color: var(--asiste-tinta);
  box-shadow: 0 1px 0 rgba(42, 23, 51, .14), 0 10px 18px -14px rgba(42, 23, 51, .45);
}
html[data-compacto] .asistente-fijo { padding-bottom: 8px; }

/* El botón gordo de la marca: rosa con canto de tinta y la sombra de abajo que se hunde al pulsar. */
.boton-asistente {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 60px; padding: 0 22px;
  border: 3px solid var(--asiste-tinta); border-radius: 999px; background: var(--asiste-acento); color: #fff;
  font: 600 21px/1.1 "Fredoka", ui-rounded, "Nunito", system-ui, sans-serif; letter-spacing: normal; text-transform: none;
  text-decoration: none; cursor: pointer; box-shadow: 0 4px 0 var(--asiste-tinta), inset 0 -4px 0 rgba(0, 0, 0, .16);
  -webkit-tap-highlight-color: transparent;
}
.boton-asistente:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--asiste-tinta), inset 0 -2px 0 rgba(0, 0, 0, .16); }
.boton-asistente:focus-visible { outline: 3px solid var(--asiste-foco); outline-offset: 3px; }
/* Esperando a la red («Abriendo el pago…»): el texto lo dice y un anillo que gira tras él, del color de la letra y hecho con border
   (como el de los botones de cada mundo; su @keyframes está en la hoja del mundo). Con «reducir movimiento», quieto y abierto. */
.boton-asistente[aria-busy="true"] { cursor: progress; opacity: .72; }
.boton-asistente[aria-busy="true"]::after {
  content: ""; flex: none; width: .9em; height: .9em; border: .16em solid currentColor; border-right-color: transparent; border-radius: 50%;
}
@media (prefers-reduced-motion: no-preference) { /* seis vueltas de .8 s: nada se mueve 5 s o más (WCAG 2.2.2) */
  .boton-asistente[aria-busy="true"]::after { animation: boton-espera .8s linear 6; }
}

/* «Atrás»: sin caja, para que lo gordo sea avanzar; la tinta, con un subrayado al pasar el ratón. */
.boton-fantasma {
  display: inline-flex; align-items: center; gap: 6px; min-height: 56px; padding: 0 14px 0 8px; border: 0; border-radius: 16px;
  background: transparent; color: var(--asiste-tinta); font: 800 19px/1 "Nunito", ui-rounded, system-ui, sans-serif; cursor: pointer;
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 5px; transition: background-color 140ms ease-out;
  -webkit-tap-highlight-color: transparent;
}
.boton-fantasma .ico { width: 22px; height: 22px; }
.boton-fantasma:active { background: #FFE3EF; }
.boton-fantasma:focus-visible { outline: 3px solid var(--asiste-foco); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .boton-fantasma:hover { text-decoration-color: currentColor; } }

/* Un móvil de 320 px: «Atrás» y «Ver la invitación» caben en su fila sin partir el texto. */
@media (max-width: 359px) {
  .boton-asistente { padding: 0 14px; font-size: 19px; }
  .boton-fantasma { padding: 0 8px 0 4px; font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .boton-fantasma { transition: none; }
  .boton-asistente:active { transform: none; }
}
