﻿/* ==========================================================================
   Rogy Experience Demo — CSS aislado (NO toca chatbot.php)
   ========================================================================== */

:root {
  --rogy-navy: #001a4d;
  --rogy-blue: #086ad8;
  --rogy-sky: #02b5ff;
  --rogy-gold: #e8a84a;
  --rogy-cream: #fff8ef;
  --rogy-ink: #0f172a;
  --rogy-muted: #64748b;
  --rogy-line: rgba(8, 106, 216, 0.14);
  --rogy-shadow: 0 18px 48px rgba(0, 26, 77, 0.22);
  --rogy-radius: 16px;
  --font: "Inter", "Segoe UI", system-ui, sans-serif;

  /* Rogy Stage (Paso 2) — ajustar aquí tamaño/posición/respiración */
  --rogy-stage-size: 300px;
  --rogy-stage-right: -42px;
  --rogy-stage-left: -42px;
  --rogy-stage-bottom: -48px;
  --rogy-stage-scale: 1.08;
  --rogy-stage-enter-x: 15px;
  --rogy-content-width: 58%;

  /* Welcome Stage (Paso 1) */
  --rogy-welcome-height: 172px;
  --rogy-welcome-size: 178px;
  --rogy-welcome-right: -10px;
  --rogy-welcome-bottom: -8px;
  --rogy-welcome-scale: 1;
  --rogy-welcome-bubble-width: 56%;

  --rogy-breath-duration: 4.6s;
  --rogy-breath-scale: 1.008;
  --rogy-breath-y: -2px;
  --rogy-entry-duration: 0.5s;
  --cta-breath-duration: 3.8s;
  --cta-breath-scale: 1.015;
  --cta-shimmer-gap: 7s;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Solo en la página standalone del demo (no al embeber en el sitio) */
body.rogy-demo-standalone {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--rogy-ink);
  background:
    radial-gradient(ellipse 60% 40% at 80% 10%, rgba(8, 106, 216, 0.08), transparent 55%),
    linear-gradient(180deg, #f4f7fc 0%, #eef3fa 100%);
}

/* ---- Demo page chrome ---- */
.demo-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 8rem;
}

.demo-page__badge {
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--rogy-navy);
  background: rgba(8, 106, 216, 0.1);
  border: 1px solid rgba(8, 106, 216, 0.18);
}

.demo-page h1 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  letter-spacing: -0.02em;
  color: var(--rogy-navy);
}

.demo-page__lead {
  margin: 0 0 1.25rem;
  color: var(--rogy-muted);
  line-height: 1.55;
}

.demo-page__notes {
  margin: 0;
  padding: 1rem 1.1rem 1rem 1.6rem;
  background: #fff;
  border: 1px solid var(--rogy-line);
  border-radius: 12px;
  color: #334155;
  line-height: 1.55;
  font-size: 0.92rem;
}

.demo-page__notes code {
  font-size: 0.85em;
  color: var(--rogy-blue);
}

.demo-page__stage {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.75rem;
}

.demo-page__card {
  height: 72px;
  border-radius: 12px;
  background: linear-gradient(90deg, #fff 0%, #f8fbff 100%);
  border: 1px solid var(--rogy-line);
  box-shadow: 0 8px 20px rgba(0, 26, 77, 0.04);
}

/* ---- Widget shell ---- */
.rogy-demo {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 99990;
  font-family: var(--font);
  width: auto;
}

.rogy-demo__toggle {
  width: 68px;
  height: 68px;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  position: relative;
  overflow: visible;
  box-shadow:
    0 0 0 3px rgba(8, 106, 216, 0.18),
    0 14px 32px rgba(0, 26, 77, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rogy-demo__toggle:hover {
  transform: translateY(-2px);
}

.rogy-demo__toggle.is-open {
  box-shadow:
    0 0 0 3px rgba(8, 106, 216, 0.28),
    0 14px 32px rgba(0, 26, 77, 0.4);
}

.rogy-demo__toggle-media {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
}

.rogy-demo__toggle img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  padding: 3px;
  box-sizing: border-box;
  background: #fff;
  transform: rotate(-18deg) scale(1.06);
  transform-origin: center center;
}

.rogy-demo__toggle-zzz {
  position: absolute;
  top: -10px;
  left: -4px;
  display: flex;
  flex-direction: column;
  gap: 0;
  pointer-events: none;
  z-index: 3;
}

.rogy-demo__toggle-zzz[hidden] {
  display: none !important;
}

.rogy-demo__toggle-zzz span {
  font-size: 0.62rem;
  font-weight: 800;
  color: #64748b;
  line-height: 1;
  opacity: 0;
  animation: rogyFloatZ 1.8s ease-in-out infinite;
}

.rogy-demo__toggle-zzz span:nth-child(2) {
  margin-left: 6px;
  animation-delay: 0.25s;
  font-size: 0.7rem;
}

.rogy-demo__toggle-zzz span:nth-child(3) {
  margin-left: 2px;
  animation-delay: 0.5s;
  font-size: 0.78rem;
}

.rogy-demo__toggle.is-asleep .rogy-demo__toggle-zzz {
  display: flex;
}

.rogy-demo__toggle.is-asleep:hover .rogy-demo__toggle-zzz {
  display: none !important;
}

@keyframes rogyFloatZ {
  0%, 100% {
    opacity: 0.15;
    transform: translateY(4px);
  }
  40% {
    opacity: 0.85;
    transform: translateY(-4px);
  }
}

.rogy-demo__badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(145deg, #f59e0b, #ea580c);
  color: #fff;
  border: 2px solid #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  z-index: 2;
}

.rogy-demo__badge.is-visible {
  display: inline-flex;
}

.rogy-demo__teaser {
  position: absolute;
  right: 0;
  bottom: 82px;
  width: min(84vw, 260px);
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--rogy-line);
  border-radius: 14px;
  box-shadow: var(--rogy-shadow);
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--rogy-ink);
}

.rogy-demo__teaser strong {
  display: block;
  margin-bottom: 2px;
  color: var(--rogy-navy);
  font-size: 0.8rem;
}

.rogy-demo__teaser[hidden] {
  display: none !important;
}

/* ---- Panel ---- */
.rogy-demo__panel {
  position: absolute;
  right: 0;
  bottom: 82px;
  width: min(92vw, 360px);
  max-height: min(78vh, 620px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--rogy-line);
  border-radius: 18px;
  box-shadow: var(--rogy-shadow);
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.rogy-demo__panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.rogy-demo__panel[hidden] {
  display: none !important;
}

.rogy-demo__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 12px 12px 12px 14px;
  background: linear-gradient(135deg, var(--rogy-navy) 0%, #0a3a8a 100%);
  color: #fff;
}

.rogy-demo__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.rogy-demo__avatar {
  position: relative;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.rogy-demo__avatar-frame {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s ease;
}

.rogy-demo__avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  padding: 2px;
  box-sizing: border-box;
  background: #fff;
  transform: rotate(-18deg) scale(1.06);
  transform-origin: center center;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.rogy-demo__avatar img.is-swapping {
  opacity: 0;
  transform: rotate(-18deg) scale(1.0) translateY(4px);
}

.rogy-demo__avatar:hover .rogy-demo__avatar-frame {
  transform: scale(1.02) rotate(-2deg);
}

.rogy-demo__avatar.is-bounce .rogy-demo__avatar-frame {
  animation: rogyBounce 0.42s ease;
}

.rogy-demo__avatar.is-breathing .rogy-demo__avatar-frame {
  animation: rogyBreath 3.6s ease-in-out infinite;
}

.rogy-demo__avatar.is-thinking .rogy-demo__avatar-frame {
  animation: rogyThink 1.1s ease-in-out infinite;
}

.rogy-demo__z {
  position: absolute;
  top: -6px;
  right: -8px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #c7d2fe;
  letter-spacing: 0.04em;
  animation: rogyZzz 1.6s ease-in-out infinite;
}

.rogy-demo__brand-copy {
  min-width: 0;
}

.rogy-demo__brand-copy strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
}

.rogy-demo__brand-copy p {
  margin: 2px 0 0;
  font-size: 0.72rem;
  opacity: 0.82;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rogy-demo__header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.rogy-demo__mute,
.rogy-demo__close {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  line-height: 1;
  -webkit-appearance: none;
  appearance: none;
}

.rogy-demo__mute i,
.rogy-demo__close i {
  color: #fff;
  font-size: 0.9rem;
  line-height: 1;
}

.rogy-demo__mute:hover,
.rogy-demo__close:hover {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.rogy-demo__body {
  position: relative;
  padding: 12px 14px 10px;
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1 1 auto;
  isolation: isolate;
}

/* ---- Paso 1: Welcome hero + opciones delante ---- */
.rogy-demo__body.is-step-1 {
  display: grid;
  grid-template-rows: auto var(--rogy-welcome-height) auto;
  grid-template-areas:
    "progress"
    "hero"
    "rest";
  overflow: hidden;
  padding-bottom: 8px;
  min-height: 0;
}

.rogy-demo__body.is-step-1 .rogy-demo__progress {
  grid-area: progress;
  margin-bottom: 4px;
}

.rogy-demo__body.is-step-1 .rogy-welcome {
  grid-area: hero;
}

.rogy-demo__body.is-step-1 .rogy-demo__content-layer {
  grid-area: rest;
  display: contents;
}

.rogy-demo__body.is-step-1 .rogy-demo__speech {
  grid-area: hero;
  align-self: start;
  justify-self: start;
  width: var(--rogy-welcome-bubble-width);
  max-width: 210px;
  margin: 10px 0 0 2px;
  min-height: 0;
  z-index: 6;
  position: relative;
}

.rogy-demo__body.is-step-1 .rogy-demo__dialogue {
  position: relative;
  padding: 9px 11px;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--rogy-navy);
  background: linear-gradient(160deg, #fff8ef 0%, #f7faff 100%);
  border: 1px solid rgba(8, 106, 216, 0.18);
  white-space: pre-line;
  box-shadow:
    0 8px 20px rgba(0, 26, 77, 0.1),
    0 1px 0 rgba(255, 255, 255, 0.8);
}

.rogy-demo__body.is-step-1 .rogy-demo__dialogue::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: 14px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-right: 1px solid rgba(8, 106, 216, 0.12);
  border-bottom: 1px solid rgba(8, 106, 216, 0.12);
  transform: rotate(-45deg);
  box-shadow: 2px 2px 4px rgba(0, 26, 77, 0.04);
}

.rogy-demo__body.is-step-1 .rogy-demo__typing {
  box-shadow: 0 6px 14px rgba(0, 26, 77, 0.08);
}

.rogy-demo__body.is-step-1 .rogy-options {
  --rogy-options-step-x: 50%;
  --rogy-options-step-y: 38px;
  grid-area: rest;
  position: relative;
  z-index: 5;
  margin-top: -18px;
  padding: 10px 2px 2px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, #fff 24%);
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -12px 28px rgba(255, 255, 255, 0.95);
  /* Franja original, pero en L: izquierda alta (texto), derecha baja (bajo Rogy) */
  -webkit-clip-path: polygon(
    0 0,
    var(--rogy-options-step-x) 0,
    var(--rogy-options-step-x) var(--rogy-options-step-y),
    100% var(--rogy-options-step-y),
    100% 100%,
    0 100%
  );
  clip-path: polygon(
    0 0,
    var(--rogy-options-step-x) 0,
    var(--rogy-options-step-x) var(--rogy-options-step-y),
    100% var(--rogy-options-step-y),
    100% 100%,
    0 100%
  );
}

.rogy-demo__body.is-step-1 .rogy-demo__label {
  display: block;
  width: max-content;
  max-width: none;
  margin: 0 0 8px;
  padding: 0 4px;
  white-space: nowrap;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

.rogy-demo__body.is-step-1 .rogy-demo__actions--services {
  position: relative;
  z-index: 2;
  padding-top: 2px;
  background: transparent;
  border-radius: 0;
}

.rogy-demo__body.is-step-1 .rogy-demo__info,
.rogy-demo__body.is-step-1 .rogy-demo__actions--secondary,
.rogy-demo__body.is-step-1 .rogy-demo__back {
  display: none !important;
}

.rogy-demo__body.is-step-2 {
  min-height: 0;
  overflow: hidden;
  padding: 10px 12px 6px;
}

.rogy-demo__body.is-step-2 .rogy-welcome,
.rogy-demo__body.is-step-2 .rogy-options {
  display: none !important;
}

.rogy-demo__content-layer {
  position: relative;
  z-index: 5;
  max-width: 100%;
}

/* ---- Welcome Stage (Paso 1) ---- */
.rogy-welcome {
  position: relative;
  z-index: 2;
  overflow: visible;
  pointer-events: none;
  background: transparent;
}

.rogy-welcome[hidden] {
  display: none !important;
}

.rogy-welcome__wrapper {
  position: absolute;
  z-index: 2;
  right: var(--rogy-welcome-right);
  bottom: var(--rogy-welcome-bottom);
  width: var(--rogy-welcome-size);
  height: var(--rogy-welcome-size);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
  cursor: pointer;
  pointer-events: auto;
  overflow: visible;
  opacity: 0;
  transform: translateY(15px) scale(0.94);
  transform-origin: center bottom;
  --rogy-stage-scale: var(--rogy-welcome-scale);
  /* Sin máscara en idle: cuerpo completo visible */
  -webkit-mask-image: none;
  mask-image: none;
}

.rogy-welcome__wrapper.is-entering {
  animation: rogyWelcomeEnter var(--rogy-entry-duration) cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.rogy-welcome__wrapper.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.rogy-welcome__wrapper.is-exiting {
  animation: rogyWelcomeExit 0.22s ease forwards;
}

.rogy-welcome__stack {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}

.rogy-welcome__character {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Mismo encuadre que Rogy idle de opciones */
  object-position: center 18%;
  transform: scale(var(--rogy-welcome-scale));
  transform-origin: 50% 80%;
  background: transparent !important;
  border: 0;
  box-shadow: none;
  filter: none;
  mix-blend-mode: normal;
  user-select: none;
  pointer-events: none;
  /* Sin transition de opacity: al cambiar src provocaba flashes blancos */
  transition: transform 0.08s ease;
}

.rogy-welcome__stack .rogy-welcome__character {
  position: absolute;
  inset: 0;
}

.rogy-welcome__stack #rogyWelcomeImg {
  z-index: 1;
}

.rogy-welcome__stack #rogyWelcomeImgB {
  display: block;
  z-index: 2;
  opacity: 0;
  transition: none;
}

.rogy-welcome__stack #rogyWelcomeImgB.is-active {
  opacity: 1;
}

.rogy-welcome__character.is-awake {
  object-position: center 18%;
}

.rogy-welcome__character.is-drowsy,
.rogy-welcome__character.is-sleepy,
.rogy-welcome__character.is-yawning {
  object-position: center 18%;
}

/* Dormido: silueta más horizontal, un poco más grande */
.rogy-welcome__wrapper.is-sleeping {
  width: calc(var(--rogy-welcome-size) * 1.32);
  height: calc(var(--rogy-welcome-size) * 1.05);
  right: calc(var(--rogy-welcome-right) - 14px);
  bottom: calc(var(--rogy-welcome-bottom) + 4px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.rogy-welcome__character.is-sleeping {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  transform: scale(1.08);
  transform-origin: center center;
}

.rogy-welcome__character.is-swapping {
  /* Legacy: ya no se usa opacity (doble buffer evita el flash) */
  transform: scale(0.98);
}

.rogy-welcome__character.is-waking {
  animation: rogyWelcomeWake 0.18s ease both;
}

.rogy-welcome__character.is-sleeping.is-breathing {
  animation: rogyWelcomeSleepBreath 5.6s ease-in-out infinite;
  transform-origin: center center;
}

@keyframes rogyWelcomeSleepBreath {
  0%,
  100% {
    transform: scale(1.08) translateY(0);
  }
  50% {
    transform: scale(1.1) translateY(-2px);
  }
}

/* zZz solo en Rogy grande del Paso 1 */
.rogy-welcome__zzz {
  position: absolute;
  top: 10%;
  left: 18%;
  z-index: 3;
  display: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  pointer-events: none;
  color: rgba(8, 106, 216, 0.45);
  font-weight: 700;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1;
}

.rogy-welcome__wrapper.is-sleeping .rogy-welcome__zzz:not([hidden]) {
  display: flex;
}

.rogy-welcome__zzz span {
  opacity: 0.2;
  animation: rogyWelcomeZ 2.8s ease-in-out infinite;
}

.rogy-welcome__zzz span:nth-child(1) {
  font-size: 0.72rem;
  margin-left: 0;
}

.rogy-welcome__zzz span:nth-child(2) {
  font-size: 0.9rem;
  margin-left: 10px;
  animation-delay: 0.45s;
}

.rogy-welcome__zzz span:nth-child(3) {
  font-size: 0.7rem;
  margin-left: 4px;
  animation-delay: 0.9s;
}

@keyframes rogyWelcomeZ {
  0%, 100% {
    opacity: 0.12;
    transform: translateY(3px);
  }
  45% {
    opacity: 0.7;
    transform: translateY(-6px);
  }
}

@keyframes rogyWelcomeWake {
  0% {
    opacity: 0.5;
    transform: scale(0.98) rotate(-0.6deg);
  }
  55% {
    opacity: 1;
    transform: scale(1.02) rotate(-0.3deg);
  }
  100% {
    opacity: 1;
    transform: scale(var(--rogy-welcome-scale)) rotate(0deg);
  }
}

.rogy-welcome__character.is-breathing {
  animation: rogyStageBreath var(--rogy-breath-duration) ease-in-out infinite;
}

/* Respiración dormido en Paso 1 (mismo idle de opciones) */
.rogy-welcome__character.is-sleeping-breath {
  --rogy-breath-duration: 3.4s;
  --rogy-breath-scale: 1.012;
  --rogy-breath-y: -1.5px;
  animation: rogyStageBreath var(--rogy-breath-duration) ease-in-out infinite;
}

.rogy-welcome__character.is-react-tilt {
  animation: rogyStageTilt 0.42s ease;
}

.rogy-welcome__character.is-react-bounce {
  animation: rogyStageMicroBounce 0.45s ease;
}

.rogy-welcome__wrapper:hover .rogy-welcome__character.is-breathing {
  animation-play-state: paused;
}

.rogy-welcome__wrapper:hover .rogy-welcome__character {
  transform: scale(calc(var(--rogy-welcome-scale) * 1.012));
  transition: transform 0.2s ease;
}

.rogy-welcome__wrapper.is-sleeping:hover .rogy-welcome__character {
  transform: scale(1.08);
}

@keyframes rogyWelcomeEnter {
  0% {
    opacity: 0;
    transform: translateY(15px) scale(0.94);
  }
  58% {
    opacity: 1;
    transform: translateY(-2px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes rogyWelcomeExit {
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
}

.rogy-options.is-entering {
  animation: rogyFadeUp 0.34s ease both;
}

/* Columna editorial: Rogy invade el resto POR DETRÁS de las tarjetas */
.rogy-demo__body.is-step-2 .rogy-demo__content-layer {
  position: relative;
  z-index: 5;
  width: var(--rogy-content-width);
  max-width: var(--rogy-content-width);
  padding-right: 0;
  padding-bottom: 4px;
}

.rogy-demo__body.is-step-2 .rogy-demo__content-layer > * {
  position: relative;
  z-index: 1;
}

/* Layout derecho (default): contenido a la izquierda */
.rogy-demo__body.is-step-2[data-stage-side="right"] .rogy-demo__content-layer,
.rogy-demo__body.is-step-2:not([data-stage-side]) .rogy-demo__content-layer {
  margin-right: auto;
  margin-left: 0;
}

/*
 * Layout izquierdo: escena en capas (NO dos columnas).
 * contentStart (~40–45%) hace que las cards invadan la zona de Rogy.
 */
.rogy-demo__body.is-step-2[data-stage-side="left"] .rogy-demo__content-layer {
  margin-left: var(--rogy-content-start, 42%);
  margin-right: 0;
  width: var(--rogy-content-width, 56%);
  max-width: calc(100% - var(--rogy-content-start, 42%) + 4%);
  padding-left: 0;
  padding-right: 2px;
}

.rogy-demo__body.is-step-2 .rogy-demo__progress {
  margin-bottom: 8px;
  z-index: 6;
}

.rogy-demo__body.is-step-2 .rogy-demo__speech {
  position: relative;
  z-index: 6;
  margin-bottom: 8px;
  min-height: 0;
  width: 100%;
}

/* Composición left: cara libre; cards a la derecha con superposición leve */
.rogy-demo__body.is-step-2[data-stage-side="left"] .rogy-demo__speech {
  width: 84%;
  margin-left: 16%;
  margin-bottom: 12px;
}

.rogy-demo__body.is-step-2 .rogy-demo__dialogue {
  position: relative;
  padding: 10px 12px;
  font-size: 0.84rem;
  line-height: 1.38;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--rogy-navy);
  background: linear-gradient(160deg, #ffffff 0%, #f3f8ff 100%);
  border: 1px solid rgba(8, 106, 216, 0.2);
  border-radius: 14px;
  box-shadow:
    0 8px 24px rgba(10, 45, 100, 0.1),
    0 1px 0 rgba(255, 255, 255, 0.9);
}

.rogy-demo__body.is-step-2 .rogy-demo__dialogue.is-visible {
  animation: rogyBubbleIn 0.36s ease-out both;
}

/* Cola del globo → Rogy a la derecha */
.rogy-demo__body.is-step-2[data-stage-side="right"] .rogy-demo__dialogue::after,
.rogy-demo__body.is-step-2:not([data-stage-side]) .rogy-demo__dialogue::after {
  content: "";
  position: absolute;
  right: -6px;
  left: auto;
  bottom: 12px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-right: 1px solid rgba(8, 106, 216, 0.12);
  border-bottom: 1px solid rgba(8, 106, 216, 0.12);
  border-left: 0;
  border-top: 0;
  transform: rotate(-45deg);
  box-shadow: 2px 2px 4px rgba(0, 26, 77, 0.04);
}

/* Cola del globo → Rogy a la izquierda */
.rogy-demo__body.is-step-2[data-stage-side="left"] .rogy-demo__dialogue::after {
  content: "";
  position: absolute;
  left: -6px;
  right: auto;
  bottom: 12px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-left: 1px solid rgba(8, 106, 216, 0.12);
  border-bottom: 1px solid rgba(8, 106, 216, 0.12);
  border-right: 0;
  border-top: 0;
  transform: rotate(45deg);
  box-shadow: -2px 2px 4px rgba(0, 26, 77, 0.04);
}

.rogy-demo__body.is-step-2 .rogy-demo__info {
  position: relative;
  z-index: 6;
  margin: 0 0 8px;
  padding: 10px 12px;
  font-size: 0.76rem;
  line-height: 1.45;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--rogy-navy);
  background: linear-gradient(135deg, rgba(0, 26, 77, 0.06) 0%, rgba(8, 106, 216, 0.05) 100%);
  border: 1px solid rgba(0, 26, 77, 0.14);
  border-left: 4px solid var(--rogy-navy);
  border-radius: 12px;
  box-shadow:
    0 6px 18px rgba(0, 26, 77, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  max-height: 5.2em;
  overflow: hidden;
}

.rogy-demo__body.is-step-2[data-stage-side="left"] .rogy-demo__info {
  border-left-color: transparent;
  border-left-width: 1px;
  border-right: 4px solid var(--rogy-navy);
  width: 100%;
  max-height: 5.4em;
  margin-bottom: 10px;
  background: linear-gradient(225deg, rgba(0, 26, 77, 0.07) 0%, rgba(8, 106, 216, 0.04) 100%);
  box-shadow:
    0 6px 18px rgba(0, 26, 77, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.rogy-demo__body.is-step-2[data-stage-side="left"] .rogy-demo__dialogue {
  background: rgba(255, 255, 255, 0.97);
}

.rogy-demo__body.is-step-2[data-stage-side="left"] .rogy-demo__actions--secondary button,
.rogy-demo__body.is-step-2[data-stage-side="left"] .rogy-cta {
  position: relative;
  z-index: 3;
}

.rogy-demo__body.is-step-2[data-stage-side="left"] .rogy-demo__actions--secondary button:not(.rogy-cta) {
  background: #fff;
}

.rogy-demo__body.is-step-2 .rogy-demo__actions--secondary {
  position: relative;
  z-index: 6;
  margin-top: 0;
  gap: 6px;
  width: 100%;
}

.rogy-demo__body.is-step-2[data-stage-side="left"] .rogy-demo__actions--secondary {
  width: 96%;
  margin-left: 2%;
  gap: 8px;
  margin-bottom: 2px;
}

.rogy-demo__body.is-step-2 .rogy-demo__actions--secondary button:not(.rogy-cta) {
  padding: 7px 10px;
  font-size: 0.78rem;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 26, 77, 0.07);
}

/* ---- CTAs Paso 2: gradientes referencia (sin iconos izq., flecha final) ---- */
.rogy-demo__body.is-step-2 button.rogy-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 10px 14px 10px 16px;
  border-radius: 16px;
  border: 0;
  color: #fff;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    filter 0.22s ease;
}

.rogy-demo__body.is-step-2 button.rogy-cta:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 2px;
}

/* Iconos CTA desactivados */
.rogy-cta__icon {
  display: none !important;
}

.rogy-cta__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  position: relative;
  z-index: 1;
}

button.rogy-cta .rogy-chip-label {
  display: block;
  font-weight: 700;
  font-size: 0.86rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: #fff;
}

.rogy-cta__sub {
  display: block;
  font-weight: 500;
  font-size: 0.68rem;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.88);
}

button.rogy-cta .rogy-chip-arrow {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 1.05rem;
  font-weight: 500;
  color: #fff;
  opacity: 0.95;
  position: relative;
  z-index: 1;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Onda decorativa inferior-derecha (como referencia) */
.rogy-demo__body.is-step-2 .rogy-demo__actions--secondary button.rogy-cta::before {
  content: "";
  position: absolute;
  right: -18%;
  bottom: -70%;
  width: 78%;
  height: 140%;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.rogy-demo__body.is-step-2 .rogy-demo__actions--secondary button.rogy-cta--primary {
  background: linear-gradient(118deg, #5eb0ff 0%, #3b82f6 42%, #2563eb 100%);
  box-shadow:
    0 10px 24px rgba(37, 99, 235, 0.38),
    0 2px 0 rgba(255, 255, 255, 0.18) inset;
}

.rogy-demo__body.is-step-2 .rogy-demo__actions--secondary button.rogy-cta--primary::before {
  background: radial-gradient(
    ellipse at center,
    rgba(15, 60, 180, 0.45) 0%,
    rgba(15, 60, 180, 0.18) 42%,
    transparent 70%
  );
}

.rogy-demo__body.is-step-2 .rogy-demo__actions--secondary button.rogy-cta--secondary {
  /* Azul navy de referencia (#05296a) */
  background: linear-gradient(118deg, #0a3d82 0%, #05296a 48%, #041f54 100%);
  box-shadow:
    0 10px 24px rgba(5, 41, 106, 0.42),
    0 2px 0 rgba(255, 255, 255, 0.14) inset;
}

.rogy-demo__body.is-step-2 .rogy-demo__actions--secondary button.rogy-cta--secondary::before {
  background: radial-gradient(
    ellipse at center,
    rgba(2, 24, 70, 0.55) 0%,
    rgba(2, 24, 70, 0.22) 42%,
    transparent 70%
  );
}

/* Shimmer suave sobre el primario */
.rogy-cta--primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 36%,
    rgba(255, 255, 255, 0.28) 48%,
    transparent 60%
  );
  transform: translateX(-120%);
  pointer-events: none;
  z-index: 2;
  animation: rogyCtaShimmer var(--cta-shimmer-gap) ease-in-out infinite;
  animation-delay: 2.4s;
}

.rogy-demo__body.is-step-2 .rogy-demo__actions--secondary button.rogy-cta--primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.45);
}

.rogy-demo__body.is-step-2 .rogy-demo__actions--secondary button.rogy-cta--secondary:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 14px 30px rgba(5, 41, 106, 0.5);
}

.rogy-demo__body.is-step-2 .rogy-demo__actions--secondary button.rogy-cta--primary:hover::after {
  animation-play-state: paused;
  opacity: 0;
}

.rogy-cta:hover .rogy-chip-arrow {
  transform: translateX(3px);
  opacity: 1;
}

.rogy-cta:active {
  transform: translateY(0) scale(0.985);
  filter: brightness(0.98);
}

@keyframes rogyBubbleIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes rogyCtaPrimaryBreath {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 8px 24px rgba(10, 45, 100, 0.08);
  }
  50% {
    transform: scale(var(--cta-breath-scale));
    box-shadow: 0 10px 28px rgba(8, 106, 216, 0.16);
  }
}

@keyframes rogyCtaShimmer {
  0%, 78%, 100% {
    transform: translateX(-120%);
    opacity: 0;
  }
  82% {
    opacity: 0.7;
  }
  90% {
    transform: translateX(120%);
    opacity: 0;
  }
}

.rogy-demo__body.is-step-2 .rogy-demo__back {
  position: relative;
  z-index: 8;
  margin-top: 10px;
  margin-left: 0;
  width: fit-content;
}

.rogy-demo__body.is-step-2[data-stage-side="left"] .rogy-demo__back {
  margin-left: 0;
}

.rogy-chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1em;
  color: var(--rogy-blue);
  font-size: 0.85em;
  flex-shrink: 0;
}

.rogy-chip-label {
  flex: 1 1 auto;
  min-width: 0;
}

/* ---- Rogy Stage (Paso 2) ---- */
.rogy-stage {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

/* Evitar recorte superior al subir Tech Talent / QA */
.rogy-stage.is-rogy-enter {
  overflow: visible;
}

.rogy-demo__body.is-step-2.is-rogy-enter {
  overflow: visible;
}

.rogy-stage[hidden] {
  display: none !important;
}

/* Veladura: protege la columna de contenido sin apagar a Rogy */
.rogy-stage__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(255, 255, 255, 0.55) 28%,
    rgba(255, 255, 255, 0.12) 48%,
    rgba(255, 255, 255, 0) 68%
  );
}

/* Left: velo muy suave (sin franja blanca detrás de Volver) */
.rogy-stage[data-stage-side="left"] .rogy-stage__veil,
.rogy-stage.rogy-stage--left .rogy-stage__veil {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0) 42%,
    rgba(255, 255, 255, 0.08) 62%,
    rgba(255, 255, 255, 0.2) 82%,
    rgba(255, 255, 255, 0.32) 100%
  );
}

.rogy-stage__wrapper {
  position: absolute;
  z-index: 1;
  right: var(--rogy-stage-right);
  left: auto;
  bottom: var(--rogy-stage-bottom);
  width: var(--rogy-stage-size);
  height: var(--rogy-stage-size);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(var(--rogy-stage-enter-x, 15px)) translateY(15px) scale(0.92);
  transform-origin: center bottom;
  transition: none;
}

.rogy-stage[data-stage-side="left"] .rogy-stage__wrapper,
.rogy-stage.rogy-stage--left .rogy-stage__wrapper {
  left: var(--rogy-stage-left);
  right: auto;
  transform-origin: center bottom;
}

/* CQI: mismo recorte y anclaje que el Rogy de Paso 1 */
.rogy-stage[data-stage-service="cqi"] .rogy-stage__character {
  object-fit: contain;
  object-position: center bottom;
  transform-origin: 50% 100%;
}

/* QA: UI a la derecha / a media altura de Rogy */
.rogy-demo__body.is-step-2.is-rogy-enter {
  min-height: 390px;
  overflow: visible;
  display: flex;
  flex-direction: column;
}

/* Columna CTAs: anclada arriba (líneas rojas) para no tapar a Rogy */
.rogy-demo__body.is-step-2.is-rogy-enter .rogy-demo__content-layer {
  position: absolute;
  left: 50%;
  right: 8px;
  top: 50px; /* sube un poco burbuja + botones junto a Rogy */
  bottom: auto;
  width: auto !important;
  max-width: none !important;
  margin-left: 0 !important;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 0;
  padding-bottom: 0;
}

/*
 * Burbuja a ancho casi completo del body (hueco superior marcado).
 * content-layer ≈ desde 50% → speech = 200%, offset = -100%.
 */
.rogy-demo__body.is-step-2.is-rogy-enter .rogy-demo__speech {
  width: 200% !important;
  max-width: none !important;
  margin-left: -100% !important;
  margin-right: 0;
  margin-bottom: 10px;
  padding: 0 2px;
  box-sizing: border-box;
  z-index: 7;
  min-height: 4.8rem; /* misma reserva con o sin texto → botones fijos */
  transition: opacity 0.35s ease;
}

/* Oculta solo visualmente: reserva altura para que los botones no salten */
.rogy-demo__body.is-step-2.is-rogy-enter.is-qa-pending .rogy-demo__speech {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  min-height: 4.4rem;
  margin-bottom: 10px;
  overflow: hidden;
}

.rogy-demo__body.is-step-2.is-rogy-enter .rogy-demo__info {
  display: none !important;
}

.rogy-demo__body.is-step-2.is-rogy-enter .rogy-demo__dialogue {
  font-size: 0.78rem;
  padding: 11px 14px;
  line-height: 1.4;
  width: 100%;
  box-sizing: border-box;
}

/* Cola hacia abajo, apuntando a Rogy (abajo-izq) */
.rogy-demo__body.is-step-2.is-rogy-enter .rogy-demo__dialogue::after {
  left: 26%;
  right: auto;
  bottom: -5px;
  top: auto;
  transform: rotate(45deg);
  border-left: 0;
  border-top: 0;
  border-right: 1px solid rgba(8, 106, 216, 0.12);
  border-bottom: 1px solid rgba(8, 106, 216, 0.12);
  box-shadow: 2px 2px 4px rgba(0, 26, 77, 0.04);
}

.rogy-demo__body.is-step-2.is-rogy-enter .rogy-demo__actions--secondary {
  gap: 8px;
  margin-top: 0;
}

.rogy-demo__body.is-step-2.is-rogy-enter .rogy-demo__actions--secondary button.rogy-cta {
  min-height: 52px;
  padding: 9px 12px 9px 14px;
  border-radius: 14px;
}

.rogy-demo__body.is-step-2.is-rogy-enter .rogy-demo__actions--secondary button.rogy-cta .rogy-chip-label {
  font-size: 0.8rem;
}

.rogy-demo__body.is-step-2.is-rogy-enter .rogy-demo__actions--secondary button.rogy-cta .rogy-cta__sub {
  font-size: 0.64rem;
}

.rogy-demo__body.is-step-2.is-rogy-enter .rogy-demo__back {
  margin-top: 8px;
  margin-bottom: 2px;
}

/* QA: salto (chico arriba-izq → grande abajo-izq) */
.rogy-stage.is-rogy-enter {
  overflow: visible;
  z-index: 4;
  pointer-events: none;
}

.rogy-stage.is-rogy-enter .rogy-stage__veil {
  display: none;
}

.rogy-stage.is-rogy-enter .rogy-stage__wrapper {
  left: var(--rogy-qa-left, var(--rogy-stage-left, -18px)) !important;
  right: auto !important;
  bottom: var(--rogy-qa-bottom, var(--rogy-stage-bottom, -6px)) !important;
  top: auto !important;
  width: var(--rogy-qa-size, var(--rogy-stage-size, 250px)) !important;
  height: var(--rogy-qa-size, var(--rogy-stage-size, 250px)) !important;
  overflow: visible;
  transform: none !important;
  transform-origin: center bottom;
  pointer-events: auto;
  transition:
    width 0.15s cubic-bezier(0.33, 1, 0.68, 1),
    height 0.15s cubic-bezier(0.33, 1, 0.68, 1),
    left 0.15s cubic-bezier(0.33, 1, 0.68, 1),
    bottom 0.16s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: width, height, left, bottom;
}

.rogy-stage.is-rogy-enter .rogy-stage__wrapper.is-qa-pinning,
.rogy-stage.is-rogy-enter .rogy-stage__wrapper.is-qa-pinning .rogy-stage__character {
  transition: none !important;
}

/* Durante el salto: pose la mueve el rAF (sin transition de layout) */
.rogy-stage.is-rogy-enter .rogy-stage__wrapper.is-jumping {
  transition: none !important;
}

.rogy-stage.is-rogy-enter .rogy-stage__wrapper.is-jumping .rogy-stage__character {
  transition: none !important;
}

/* Aterrizaje: también lo mueve rAF (sin transition que pelee con el lerp) */
.rogy-stage.is-rogy-enter .rogy-stage__wrapper.is-settling {
  transition: none !important;
}

.rogy-stage.is-rogy-enter .rogy-stage__wrapper.is-settling .rogy-stage__character {
  transition: none !important;
}

.rogy-stage.is-rogy-enter .rogy-stage__wrapper.is-entering,
.rogy-stage.is-rogy-enter .rogy-stage__wrapper.is-visible,
.rogy-stage.is-rogy-enter .rogy-stage__wrapper.is-exiting {
  animation: none;
  opacity: 1;
  transform: none !important;
}

.rogy-stage.is-rogy-enter .rogy-stage__character {
  object-fit: contain;
  object-position: center bottom;
  transform-origin: 50% 88%;
  transform: scale(var(--rogy-qa-scale, var(--rogy-stage-scale, 1)));
  /* Sin transition de opacity: al cambiar src provocaba pestañazos blancos */
  transition: transform 0.15s cubic-bezier(0.33, 1, 0.68, 1);
  will-change: transform;
  /* Sin drop-shadow: en el salto se veía un círculo gris sobre el fondo blanco */
  filter: none;
}

.rogy-stage.is-rogy-enter .rogy-stage__wrapper:hover .rogy-stage__character {
  filter: none;
  transform: scale(calc(var(--rogy-qa-scale, var(--rogy-stage-scale, 1)) * 1.012));
}

.rogy-stage.is-rogy-enter .rogy-stage__character.is-breathing {
  animation: rogyQaBreath var(--rogy-breath-duration) ease-in-out infinite;
}

/* Respiración suave mientras duerme */
.rogy-stage.is-rogy-enter .rogy-stage__character.is-sleeping-breath {
  --rogy-breath-duration: 3.4s;
  --rogy-breath-scale: 1.012;
  --rogy-breath-y: -1.5px;
  animation: rogyQaBreath var(--rogy-breath-duration) ease-in-out infinite;
}

@keyframes rogyQaBreath {
  0%, 100% {
    transform: scale(var(--rogy-qa-scale, var(--rogy-stage-scale, 1)));
  }
  50% {
    transform:
      translateY(var(--rogy-breath-y))
      scale(calc(var(--rogy-qa-scale, var(--rogy-stage-scale, 1)) * var(--rogy-breath-scale)));
  }
}

.rogy-stage__wrapper.is-entering {
  animation: rogyStageEnter var(--rogy-entry-duration) cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.rogy-stage__wrapper.is-visible {
  opacity: 1;
  transform: translateX(0) translateY(0) scale(1);
}

.rogy-stage__wrapper.is-exiting {
  animation: rogyStageExit 0.26s ease forwards;
}

/* Zzz dormido en Paso 2: ida z→zz→zzz / vuelta zzz→zz→z */
.rogy-stage__zzz {
  position: absolute;
  top: 0;
  left: 54%;
  width: 46%;
  height: 34%;
  z-index: 5;
  display: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
  overflow: visible;
}

.rogy-stage__zzz:not([hidden]) {
  display: block;
}

.rogy-stage__z {
  position: absolute;
  display: none;
  line-height: 1;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  color: #0c5abe;
  text-shadow:
    -1.5px -1.5px 0 #fff,
    1.5px -1.5px 0 #fff,
    -1.5px 1.5px 0 #fff,
    1.5px 1.5px 0 #fff,
    0 0 10px rgba(12, 90, 190, 0.35);
  transform: rotate(-12deg);
}

.rogy-stage__zzz[data-level="1"] .rogy-stage__z[data-z="1"],
.rogy-stage__zzz[data-level="2"] .rogy-stage__z[data-z="1"],
.rogy-stage__zzz[data-level="2"] .rogy-stage__z[data-z="2"],
.rogy-stage__zzz[data-level="3"] .rogy-stage__z[data-z="1"],
.rogy-stage__zzz[data-level="3"] .rogy-stage__z[data-z="2"],
.rogy-stage__zzz[data-level="3"] .rogy-stage__z[data-z="3"] {
  display: block;
}

.rogy-stage__z[data-z="1"] {
  left: 8%;
  bottom: 8%;
  font-size: clamp(0.78rem, 2.2vw, 1.12rem);
}

.rogy-stage__z[data-z="2"] {
  left: 34%;
  bottom: 36%;
  font-size: clamp(0.98rem, 2.7vw, 1.35rem);
}

.rogy-stage__z[data-z="3"] {
  left: 58%;
  bottom: 62%;
  font-size: clamp(1.18rem, 3.2vw, 1.62rem);
}

.rogy-stage__stack {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}

.rogy-stage__character {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center 18%;
  transform: scale(var(--rogy-stage-scale));
  transform-origin: 50% 80%;
  filter: drop-shadow(0 12px 22px rgba(0, 26, 77, 0.22));
  user-select: none;
  pointer-events: none;
}

/* Doble buffer: B cubre a A mientras decodifica el siguiente fotograma (sin flash blanco) */
.rogy-stage__stack .rogy-stage__character {
  position: absolute;
  inset: 0;
}

.rogy-stage__stack #rogyStageImg {
  z-index: 1;
}

.rogy-stage__stack #rogyStageImgB {
  display: block;
  z-index: 2;
  opacity: 0;
  transition: none;
}

.rogy-stage__stack #rogyStageImgB.is-active {
  opacity: 1;
}

.rogy-stage__character.is-breathing {
  animation: rogyStageBreath var(--rogy-breath-duration) ease-in-out infinite;
}

.rogy-stage__character.is-react-tilt {
  animation: rogyStageTilt 0.42s ease;
}

.rogy-stage__character.is-react-bounce {
  animation: rogyStageMicroBounce 0.45s ease;
}

.rogy-stage__wrapper:hover .rogy-stage__character.is-breathing {
  animation-play-state: paused;
}

.rogy-stage__wrapper:hover .rogy-stage__character {
  transform: scale(calc(var(--rogy-stage-scale) * 1.012));
  transition: transform 0.2s ease;
}

@keyframes rogyStageEnter {
  0% {
    opacity: 0;
    transform: translateX(var(--rogy-stage-enter-x, 15px)) translateY(15px) scale(0.92);
  }
  62% {
    opacity: 1;
    transform: translateX(var(--rogy-stage-overshoot-x, -2px)) translateY(-2px) scale(1.015);
  }
  100% {
    opacity: 1;
    transform: translateX(0) translateY(0) scale(1);
  }
}

@keyframes rogyStageExit {
  to {
    opacity: 0;
    transform: translateX(var(--rogy-stage-exit-x, 10px)) translateY(10px) scale(0.96);
  }
}

@keyframes rogyStageBreath {
  0% {
    transform: translateY(0) scale(var(--rogy-stage-scale));
  }
  40% {
    transform: translateY(calc(var(--rogy-breath-y) * 0.65))
      scale(calc(var(--rogy-stage-scale) * (1 + (var(--rogy-breath-scale) - 1) * 0.7)));
  }
  55% {
    transform: translateY(var(--rogy-breath-y))
      scale(calc(var(--rogy-stage-scale) * var(--rogy-breath-scale)));
  }
  100% {
    transform: translateY(0) scale(var(--rogy-stage-scale));
  }
}

@keyframes rogyStageTilt {
  0%, 100% { transform: rotate(0deg) scale(var(--rogy-stage-scale)); }
  40% { transform: rotate(-0.7deg) scale(calc(var(--rogy-stage-scale) * 1.01)); }
}

@keyframes rogyStageMicroBounce {
  0%, 100% { transform: translateY(0) scale(var(--rogy-stage-scale)); }
  35% { transform: translateY(-3px) scale(calc(var(--rogy-stage-scale) * 1.015)); }
  60% { transform: translateY(0) scale(calc(var(--rogy-stage-scale) * 0.995)); }
}

.rogy-demo__progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--rogy-blue);
  font-size: 0.74rem;
  font-weight: 700;
  position: relative;
  z-index: 6;
}

.rogy-demo__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
}

.rogy-demo__dot.is-on {
  background: var(--rogy-blue);
  box-shadow: 0 0 0 3px rgba(8, 106, 216, 0.15);
}

.rogy-demo__bar {
  width: 28px;
  height: 2px;
  background: #dbe5f2;
  border-radius: 2px;
}

.rogy-demo__progress-label {
  margin-left: auto;
  color: var(--rogy-muted);
  font-weight: 600;
}

.rogy-demo__speech {
  position: relative;
  margin-bottom: 10px;
  min-height: 2.4rem;
}

.rogy-demo__dialogue {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(160deg, #fff8ef 0%, #f7faff 100%);
  border: 1px solid rgba(8, 106, 216, 0.18);
  color: var(--rogy-navy);
  font-size: 0.9rem;
  line-height: 1.45;
  font-weight: 600;
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  transition: opacity 0.28s ease, transform 0.28s ease;
  box-shadow: 0 4px 14px rgba(0, 26, 77, 0.06);
}

.rogy-demo__dialogue.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.rogy-demo__typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.rogy-demo__typing[hidden] {
  display: none !important;
}

.rogy-demo__typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  animation: rogyDot 1s ease-in-out infinite;
}

.rogy-demo__typing span:nth-child(2) { animation-delay: 0.15s; }
.rogy-demo__typing span:nth-child(3) { animation-delay: 0.3s; }

.rogy-demo__info {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(0, 26, 77, 0.06) 0%, rgba(8, 106, 216, 0.05) 100%);
  border: 1px solid rgba(0, 26, 77, 0.14);
  border-left: 4px solid var(--rogy-navy);
  color: var(--rogy-navy);
  font-size: 0.84rem;
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: -0.01em;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.rogy-demo__info.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.rogy-demo__info[hidden] {
  display: none !important;
}

.rogy-demo__label {
  margin: 0 0 8px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--rogy-muted);
  letter-spacing: 0.02em;
}

.rogy-demo__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rogy-demo__actions--services {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.rogy-demo__actions--services button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 58px;
  padding: 8px 4px;
  text-align: center;
  border-radius: 11px;
  background: #f8fafc;
  border-color: #e2e8f0;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.rogy-demo__actions--services .rogy-chip-icon {
  width: auto;
  font-size: 0.95rem;
  transition: transform 0.18s ease;
}

.rogy-demo__actions--services .rogy-chip-label {
  flex: 0 1 auto;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--rogy-navy);
}

.rogy-demo__actions--services button:hover {
  background: #f0f7ff;
  border-color: rgba(8, 106, 216, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(8, 106, 216, 0.12);
}

.rogy-demo__actions--services button:hover .rogy-chip-icon {
  transform: scale(1.08);
}

.rogy-demo__actions--services button:active {
  transform: scale(0.98);
}

.rogy-demo__actions--services button.is-selected {
  background: #e8f2ff;
  border-color: rgba(8, 106, 216, 0.55);
  color: var(--rogy-navy);
}

.rogy-demo__actions--secondary {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.rogy-demo__actions button {
  border: 1px solid #dbe5f2;
  background: #fff;
  color: #0f172a;
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, opacity 0.2s ease, box-shadow 0.15s ease;
}

.rogy-demo__actions--secondary button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  text-align: left;
  width: 100%;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

.rogy-demo__actions--secondary button .rogy-chip-arrow {
  font-size: 0.78rem;
  color: var(--rogy-blue);
  transition: transform 0.18s ease;
  opacity: 0.75;
  margin-left: auto;
}

.rogy-demo__actions--secondary button.rogy-cta .rogy-chip-arrow {
  color: #fff;
}

.rogy-demo__actions button:hover:not(.rogy-cta) {
  background: #f0f7ff;
  border-color: rgba(8, 106, 216, 0.35);
  color: var(--rogy-navy);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(8, 106, 216, 0.1);
}

.rogy-demo__actions--secondary button:hover .rogy-chip-arrow {
  transform: translateX(3px);
  opacity: 1;
}

.rogy-demo__actions button:active {
  transform: scale(0.98);
  box-shadow: none;
}

.rogy-demo__actions button.is-entering {
  animation: rogyFadeUp 0.32s ease both;
}

.rogy-demo__actions button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.rogy-demo__actions--secondary button {
  text-align: left;
  width: 100%;
}

.rogy-demo__back {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  position: relative;
  z-index: 8;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(8, 106, 216, 0.18);
  background: #fff;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--rogy-navy);
  font-size: 0.8rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  transition:
    transform 200ms ease,
    border-color 200ms ease,
    box-shadow 200ms ease,
    background 200ms ease,
    color 200ms ease;
}

.rogy-demo__back-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: rgba(13, 110, 253, 0.1);
  color: var(--rogy-blue);
  font-size: 0.78rem;
  line-height: 1;
  flex-shrink: 0;
}

.rogy-demo__back-label {
  line-height: 1;
}

.rogy-demo__back:hover {
  transform: translateX(-2px);
  border-color: rgba(13, 110, 253, 0.38);
  background: #fff;
  color: var(--rogy-navy);
  box-shadow: 0 4px 14px rgba(13, 110, 253, 0.14);
}

.rogy-demo__back:active {
  transform: translateX(-1px) scale(0.98);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.rogy-demo__back[hidden] {
  display: none !important;
}

.rogy-demo__footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 12px;
  border-top: 1px solid #eef2f7;
  background: #fafbfd;
  position: relative;
  z-index: 8;
  isolation: isolate;
}

.rogy-demo__wsp {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: 10px;
  background: #25d366;
  color: #fff !important;
  text-decoration: none !important;
  font-size: 0.86rem;
  font-weight: 700;
  transition: filter 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 6px 14px rgba(37, 211, 102, 0.28);
  animation: rogyCtaBreath var(--cta-breath-duration) ease-in-out infinite;
  animation-delay: 0.7s;
}

.rogy-demo__wsp:hover {
  filter: brightness(1.05);
  transform: translateY(-1px) scale(1);
  animation-play-state: paused;
  box-shadow: 0 8px 18px rgba(37, 211, 102, 0.38);
}

@keyframes rogyCtaBreath {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 6px 14px rgba(37, 211, 102, 0.28);
  }
  50% {
    transform: scale(var(--cta-breath-scale));
    box-shadow: 0 8px 18px rgba(37, 211, 102, 0.36);
  }
}

.rogy-demo__contact {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--rogy-blue) !important;
  text-decoration: none !important;
  white-space: nowrap;
}

.rogy-demo__contact:hover {
  text-decoration: underline !important;
}

/* Paws celebration */
.rogy-demo__paws {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.rogy-demo__paws span {
  position: absolute;
  font-size: 0.85rem;
  opacity: 0;
  animation: rogyPaw 0.9s ease forwards;
}

/* ---- Keyframes ---- */
@keyframes rogyBreath {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@keyframes rogyBounce {
  0% { transform: scale(1); }
  30% { transform: scale(1.08) translateY(-3px); }
  55% { transform: scale(0.98); }
  100% { transform: scale(1); }
}

@keyframes rogyThink {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-2px) rotate(1.5deg); }
}

@keyframes rogyDot {
  0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

@keyframes rogyFadeUp {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes rogyZzz {
  0%, 100% { opacity: 0.4; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}

@keyframes rogyPaw {
  0% { opacity: 0; transform: translateY(8px) scale(0.8); }
  30% { opacity: 0.9; }
  100% { opacity: 0; transform: translateY(-28px) scale(1.1); }
}

@keyframes rogyPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.rogy-demo__toggle.has-attention {
  animation: rogyPulse 1.15s ease-in-out infinite;
}

/* ---- Responsive ---- */
@media (max-width: 430px) {
  :root {
    --rogy-stage-size: 210px;
    --rogy-stage-right: -48px;
    --rogy-stage-bottom: -52px;
    --rogy-stage-scale: 1.12;
    --rogy-content-width: 62%;
    --rogy-breath-scale: 1.006;
    --rogy-welcome-height: 156px;
    --rogy-welcome-size: 150px;
    --rogy-welcome-right: -14px;
    --rogy-welcome-bottom: -4px;
    --rogy-welcome-scale: 1;
    --rogy-welcome-bubble-width: 58%;
  }

  /* Solo Tech Talent / QA: contain (sin forzar bottom; lo controla el stage.y) */
  .rogy-stage.is-rogy-enter .rogy-stage__character {
    object-fit: contain;
  }

  .rogy-demo {
    right: 12px;
    bottom: 12px;
  }

  .rogy-demo__panel {
    width: calc(100vw - 24px);
    max-height: min(82vh, 640px);
    bottom: 78px;
  }

  .rogy-demo__toggle {
    width: 62px;
    height: 62px;
  }

  .rogy-demo__teaser {
    bottom: 76px;
    width: min(78vw, 240px);
  }

  .rogy-demo__avatar,
  .rogy-demo__avatar-frame {
    width: 50px;
    height: 50px;
  }

  .rogy-demo__body.is-step-1 .rogy-demo__dialogue {
    font-size: 0.78rem;
    padding: 8px 9px;
  }

  .rogy-demo__actions--services button {
    min-height: 54px;
    padding: 7px 3px;
  }

  .rogy-demo__actions--services .rogy-chip-label {
    font-size: 0.64rem;
  }

  .rogy-demo__body.is-step-2 {
    padding: 8px 10px 4px;
  }

  .rogy-demo__body.is-step-2 .rogy-demo__dialogue {
    font-size: 0.78rem;
    padding: 7px 9px;
  }

  .rogy-demo__body.is-step-2 .rogy-demo__info {
    font-size: 0.72rem;
    padding: 7px 9px;
    max-height: 5.2em;
  }

  .rogy-stage__veil {
    background: linear-gradient(
      102deg,
      rgba(255, 255, 255, 0.94) 0%,
      rgba(255, 255, 255, 0.6) 34%,
      rgba(255, 255, 255, 0.15) 52%,
      rgba(255, 255, 255, 0) 72%
    );
  }

  .rogy-stage[data-stage-side="left"] .rogy-stage__veil,
  .rogy-stage.rogy-stage--left .rogy-stage__veil {
    background: linear-gradient(
      90deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0) 40%,
      rgba(255, 255, 255, 0.1) 68%,
      rgba(255, 255, 255, 0.28) 100%
    );
  }

  .rogy-demo__body.is-step-2[data-stage-side="left"] .rogy-demo__content-layer {
    --rogy-content-start: 50%;
    --rogy-content-width: 50%;
  }
}

@media (max-width: 375px) {
  :root {
    --rogy-stage-size: 185px;
    --rogy-stage-right: -54px;
    --rogy-stage-bottom: -56px;
    --rogy-stage-scale: 1.14;
    --rogy-content-width: 64%;
    --rogy-welcome-height: 144px;
    --rogy-welcome-size: 138px;
    --rogy-welcome-right: -18px;
    --rogy-welcome-bottom: -2px;
    --rogy-welcome-bubble-width: 60%;
  }

  .rogy-cta .rogy-chip-label {
    font-size: 0.72rem;
  }

  .rogy-cta__icon {
    width: 26px;
    height: 26px;
  }
}

@media (max-width: 359.98px) {
  :root {
    --rogy-stage-size: 168px;
    --rogy-stage-right: -58px;
    --rogy-stage-bottom: -58px;
    --rogy-content-width: 66%;
    --rogy-welcome-height: 132px;
    --rogy-welcome-size: 128px;
    --rogy-welcome-right: -20px;
    --rogy-welcome-bottom: 0px;
  }

  .rogy-demo__brand-copy p {
    display: none;
  }

  .rogy-demo__footer {
    flex-wrap: wrap;
  }

  .rogy-demo__wsp {
    flex: 1 1 100%;
  }

  .rogy-demo__actions--services .rogy-chip-label {
    font-size: 0.6rem;
  }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .rogy-demo__panel,
  .rogy-demo__dialogue,
  .rogy-demo__info,
  .rogy-demo__avatar img,
  .rogy-demo__avatar-frame,
  .rogy-demo__actions button,
  .rogy-stage__wrapper,
  .rogy-stage__character,
  .rogy-welcome__wrapper,
  .rogy-welcome__character,
  .rogy-options,
  .rogy-demo__wsp,
  .rogy-cta--primary,
  .rogy-cta--primary::after,
  .rogy-demo__toggle-zzz span,
  .rogy-stage__zzz {
    transition: none !important;
    animation: none !important;
  }

  .rogy-demo__avatar.is-breathing .rogy-demo__avatar-frame,
  .rogy-demo__avatar.is-thinking .rogy-demo__avatar-frame,
  .rogy-demo__avatar.is-bounce .rogy-demo__avatar-frame,
  .rogy-demo__toggle.has-attention,
  .rogy-demo__typing span,
  .rogy-demo__z,
  .rogy-stage__character.is-breathing,
  .rogy-stage__character.is-react-tilt,
  .rogy-stage__character.is-react-bounce,
  .rogy-stage__wrapper.is-entering,
  .rogy-stage__wrapper.is-exiting,
  .rogy-welcome__character.is-breathing,
  .rogy-welcome__character.is-react-tilt,
  .rogy-welcome__character.is-react-bounce,
  .rogy-welcome__character.is-waking,
  .rogy-welcome__character.is-swapping,
  .rogy-welcome__wrapper.is-entering,
  .rogy-welcome__wrapper.is-exiting,
  .rogy-welcome__zzz span,
  .rogy-options.is-entering,
  .rogy-demo__body.is-step-2 .rogy-demo__dialogue.is-visible,
  .rogy-cta--primary {
    animation: none !important;
  }

  .rogy-demo__panel {
    opacity: 1;
    transform: none;
  }

  .rogy-demo__dialogue,
  .rogy-demo__info {
    opacity: 1;
    transform: none;
  }

  .rogy-stage__wrapper.is-visible,
  .rogy-welcome__wrapper.is-visible {
    opacity: 1;
    transform: none;
  }

  .rogy-stage__character {
    transform: scale(var(--rogy-stage-scale));
  }

  .rogy-welcome__zzz span {
    animation: none !important;
    opacity: 0.45;
  }

  .rogy-welcome__character {
    transform: scale(var(--rogy-welcome-scale));
  }

  .rogy-goto,
  .rogy-goto.is-on {
    transition: none;
  }

  .rogy-goto__card {
    transform: none;
  }
}

/* ---- Transición CTA: Ver solución / Hablar con especialista ---- */
.rogy-goto {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  border-radius: inherit;
  background: rgba(0, 18, 52, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.rogy-goto[hidden] {
  display: none !important;
}

.rogy-goto.is-on {
  opacity: 1;
  pointer-events: auto;
}

.rogy-goto__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  transform: translateY(10px) scale(0.96);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.rogy-goto.is-on .rogy-goto__card {
  transform: none;
}

.rogy-goto__gif {
  display: block;
  width: min(210px, 58vw);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 18px 28px rgba(0, 10, 40, 0.45));
  pointer-events: none;
  user-select: none;
}

.rogy-goto__text {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0, 20, 60, 0.45);
}
