/* ════════════════════════════════════════════════════════════════════════════
 *  GOLDEN CHAT — onboarding/onboarding.css   (bienvenida guiada del cliente)
 *  Todo está acotado a #gcOnboard (y a html.gc-onboarding-active mientras está
 *  activo, para fijar el fondo): no cambia otros estilos globales.
 *  Usa los tokens del tema (golden-theme.css) con valores de respaldo.
 * ════════════════════════════════════════════════════════════════════════════ */
#gcOnboard {
  --gob-gold: var(--gold, #d4af37);
  --gob-gold-soft: var(--gold-soft, #e6be5a);
  --gob-grad: var(--gold-gradient, linear-gradient(135deg, #bf953f 0%, #fcf6ba 28%, #b38728 52%, #fbf5b7 76%, #aa771c 100%));
  /* PANTALLA COMPLETA: capa fija y opaca sobre toda la app (por debajo sólo del
     splash y del video "Gran Premio"). El alto sigue al área visible (teclado móvil:
     onboarding.js lo ajusta con visualViewport) y respeta las zonas seguras. */
  position: fixed; z-index: 2147482900;
  top: 0; left: 0; right: 0;
  width: 100%; height: 100vh; height: 100dvh;
  margin: 0; box-sizing: border-box;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  display: flex; flex-direction: column;
  background: radial-gradient(ellipse at 50% 0%, rgba(212,175,55,.10), transparent 60%), linear-gradient(180deg, #1a1a1e, #0d0d0f);
  background-color: #0d0d0f;
  color: var(--text, #f5f1e6);
  font-family: var(--font, -apple-system, "Segoe UI", Roboto, Arial, sans-serif);
  overflow: hidden;
  outline: none;
  overscroll-behavior: contain;
  animation: gobIn 260ms ease-out;
}
#gcOnboard[hidden] { display: none; }
@keyframes gobIn { from { opacity: 0; } to { opacity: 1; } }
/* Fondo fijo mientras el onboarding está activo (no se desplaza el chat de atrás). */
html.gc-onboarding-active, html.gc-onboarding-active body { overflow: hidden !important; overscroll-behavior: none; }

/* Encabezado */
#gcOnboard .gob-head {
  display: flex; align-items: center; gap: 10px;
  width: 100%; max-width: 1100px; margin: 0 auto; box-sizing: border-box;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(212,175,55,.22);
  flex-shrink: 0;
}
#gcOnboard .gob-head-txt { flex: 1; min-width: 0; }
#gcOnboard .gob-kicker { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gob-gold-soft); }
#gcOnboard .gob-title { margin: 2px 0 0; font-size: 16px; font-weight: 800; line-height: 1.2; color: #fff; font-family: var(--font-display, inherit); }
#gcOnboard .gob-dots { display: flex; gap: 6px; }
#gcOnboard .gob-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.18); }
#gcOnboard .gob-dot.done { background: var(--gob-gold); }
#gcOnboard .gob-dot.on { background: var(--gob-grad); box-shadow: 0 0 8px rgba(212,175,55,.7); }

/* Cuerpo: ocupa todo el alto restante; si no entra (pantallas bajas / teclado), se desplaza. */
#gcOnboard .gob-body {
  flex: 1 1 auto; min-height: 0;
  width: 100%; max-width: 1100px; margin: 0 auto; box-sizing: border-box;
  padding: 12px 16px 16px; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; justify-content: safe center; gap: 10px;
}
#gcOnboard .gob-center { align-items: center; text-align: center; padding: 26px 18px; }
#gcOnboard .gob-hint { margin: 0; font-size: 13px; line-height: 1.4; color: var(--text-muted, #a0a0a0); text-align: center; min-height: 1.4em; }
#gcOnboard .gob-hint strong { color: var(--gob-gold-soft); }
#gcOnboard .gob-legend { font-size: 13px; text-align: center; color: var(--text-muted, #a0a0a0); }
#gcOnboard .gob-legend strong { color: var(--gob-gold-soft); }
#gcOnboard .gob-msg { margin: 0; font-size: 15px; line-height: 1.45; }
#gcOnboard .gob-sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Botón principal (dorado) */
#gcOnboard .gob-next {
  align-self: stretch; min-height: 46px; padding: 0 18px;
  border: 1px solid rgba(255,236,170,.6); border-radius: 10px;
  background: var(--gob-grad); color: #111; font-weight: 800; font-size: 15px; cursor: pointer;
  box-shadow: 0 3px 14px rgba(212,175,55,.3), inset 0 1px 0 rgba(255,255,255,.5);
}
#gcOnboard .gob-center .gob-next { align-self: center; min-width: 200px; }
#gcOnboard .gob-next:disabled { background: #2a2a2f; color: #8d8d93; border-color: #3a3a40; box-shadow: none; cursor: not-allowed; }
#gcOnboard .gob-actions { display: flex; justify-content: center; }
#gcOnboard .gob-back {
  background: transparent; border: 1px solid rgba(212,175,55,.45); color: var(--gob-gold-soft);
  border-radius: 999px; padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
}
#gcOnboard .gob-back:hover { background: rgba(212,175,55,.08); }

/* ── Paso 1 · video ── */
#gcOnboard .gob-video-wrap {
  /* Lo más grande posible manteniendo 16:9 y dejando lugar a los controles. */
  position: relative; aspect-ratio: 16 / 9; flex-shrink: 0;
  width: min(100%, calc((100vh - 250px) * 16 / 9)); width: min(100%, calc((100dvh - 250px) * 16 / 9));
  min-width: min(100%, 260px); margin: 0 auto;
  background: #000; border-radius: 12px; overflow: hidden;
  border: 1px solid rgba(212,175,55,.35);
}
#gcOnboard .gob-video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
#gcOnboard .gob-bigplay {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 10px; max-width: 90%;
  padding: 12px 20px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255,236,170,.7); background: var(--gob-grad); color: #111;
  font-weight: 800; font-size: 15px; line-height: 1.2; text-align: left;
  box-shadow: 0 6px 26px rgba(0,0,0,.6), 0 0 0 6px rgba(212,175,55,.18);
  animation: gobPulse 1.8s ease-in-out infinite;
}
#gcOnboard .gob-bigplay[hidden] { display: none; }
#gcOnboard .gob-bigplay-ic { font-size: 20px; }
#gcOnboard .gob-vbar { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 900px; margin: 0 auto; }
#gcOnboard .gob-video-wrap ~ .gob-next { width: 100%; max-width: 900px; margin: 0 auto; }
#gcOnboard .gob-vbtn {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(212,175,55,.55); background: rgba(20,20,23,.9); color: var(--gob-gold-soft); font-size: 15px;
}
#gcOnboard .gob-progress { flex: 1; height: 8px; border-radius: 999px; background: rgba(255,255,255,.12); overflow: hidden; }
#gcOnboard .gob-progress-fill { height: 100%; width: 0; background: var(--gob-grad); transition: width 240ms linear; }
#gcOnboard .gob-time { font-size: 12px; color: var(--text-muted, #a0a0a0); font-variant-numeric: tabular-nums; min-width: 74px; text-align: right; }

/* ── Escenas ilustradas (encuesta / usuario nuevo / WhatsApp) ──
   Se muestra el panel central de la ilustración (recorte x 140..960 de 1100). Los
   controles reales se posicionan en % sobre ESTE recorte → quedan alineados con el
   dibujo en cualquier tamaño de pantalla. */
#gcOnboard .gob-scene {
  /* Lo más grande posible manteniendo la proporción de la ilustración. */
  position: relative; flex-shrink: 0; margin: 0 auto;
  width: min(100%, calc((100vh - 230px) * 820 / 614)); width: min(100%, calc((100dvh - 230px) * 820 / 614));
  min-width: min(100%, 280px);
  aspect-ratio: 820 / 614; overflow: hidden; border-radius: 14px;
  border: 1px solid rgba(212,175,55,.4); background: #0d0d0f;
  box-shadow: 0 8px 28px rgba(0,0,0,.45);
  user-select: none; -webkit-user-select: none;
}
#gcOnboard .gob-scene-img {
  position: absolute; top: 0; left: -17.073%; width: 134.146%; height: auto;
  pointer-events: none; display: block;
}
/* Controles sobre los botones dibujados: reales, con foco/hover/selección visibles. */
#gcOnboard .gob-hit {
  position: absolute; padding: 0; margin: 0; border: 0; background: transparent;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: box-shadow 160ms ease, background-color 160ms ease, transform 120ms ease;
}
#gcOnboard .gob-hit:hover,
#gcOnboard .gob-hit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255,236,170,.95), 0 0 22px rgba(255,214,102,.75);
}
#gcOnboard .gob-hit:active { transform: scale(.97); }
/* Encuesta: halo suave que indica que los dos botones se pueden tocar. */
#gcOnboard .gob-choice { animation: gobHalo 2.2s ease-in-out infinite; }
#gcOnboard .gob-choice[data-choice="whatsapp"] { animation-delay: 1.1s; }
/* Plataformas: selección claramente marcada (borde dorado + resplandor + ✓). */
#gcOnboard .gob-plat.on {
  box-shadow: 0 0 0 3px #fff3c4, 0 0 0 7px rgba(212,175,55,.75), 0 0 26px rgba(255,214,102,.9);
}
#gcOnboard .gob-check {
  position: absolute; top: -8px; right: -4px; width: 26px; height: 26px; border-radius: 50%;
  display: none; align-items: center; justify-content: center;
  background: var(--gob-grad); color: #111; font-weight: 900; font-size: 15px;
  border: 2px solid #fff3c4; box-shadow: 0 2px 8px rgba(0,0,0,.5);
}
#gcOnboard .gob-plat.on .gob-check { display: flex; }
/* Continuar: deshabilitado = se oscurece el botón dibujado; habilitado = halo dorado. */
#gcOnboard .gob-submit[aria-disabled="true"] {
  background-color: rgba(8,8,10,.6);
  -webkit-backdrop-filter: grayscale(1); backdrop-filter: grayscale(1);
  cursor: not-allowed;
}
#gcOnboard .gob-submit.ready { animation: gobHalo 1.6s ease-in-out infinite; }
/* Campo de texto real sobre el pergamino (tapa el texto de ejemplo dibujado). */
#gcOnboard .gob-input {
  position: absolute; box-sizing: border-box; margin: 0;
  padding: 0 8px; border-radius: 6px;
  border: 2px solid rgba(120,78,18,.6);
  background: #f6ead0; color: #2b1d08;
  font: 600 16px/1 var(--font, -apple-system, "Segoe UI", Roboto, Arial, sans-serif);  /* 16px: iOS no hace zoom */
  box-shadow: inset 0 1px 3px rgba(80,50,10,.25);
}
#gcOnboard .gob-input::placeholder { color: #8a7650; font-weight: 500; opacity: 1; }
#gcOnboard .gob-input:focus { outline: none; border-color: #c58a1a; box-shadow: 0 0 0 3px rgba(255,200,80,.55), inset 0 1px 3px rgba(80,50,10,.25); }

@keyframes gobHalo {
  0%, 100% { box-shadow: 0 0 0 2px rgba(255,236,170,.55), 0 0 10px rgba(255,214,102,.35); }
  50%      { box-shadow: 0 0 0 4px rgba(255,236,170,.95), 0 0 24px rgba(255,214,102,.8); }
}
@keyframes gobPulse {
  0%, 100% { box-shadow: 0 6px 26px rgba(0,0,0,.6), 0 0 0 4px rgba(212,175,55,.2); }
  50%      { box-shadow: 0 6px 26px rgba(0,0,0,.6), 0 0 0 10px rgba(212,175,55,.32); }
}

/* Envío / listo */
#gcOnboard .gob-spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid rgba(212,175,55,.25); border-top-color: var(--gob-gold);
  animation: gobSpin .9s linear infinite;
}
@keyframes gobSpin { to { transform: rotate(360deg); } }
#gcOnboard .gob-ok {
  width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--gob-grad); color: #111; font-size: 30px; font-weight: 900;
  box-shadow: 0 0 22px rgba(212,175,55,.5);
}

@media (max-width: 480px) {
  #gcOnboard .gob-body { padding: 10px 10px 12px; }
  #gcOnboard .gob-head { padding: 10px 12px; }
  #gcOnboard .gob-title { font-size: 15px; }
  #gcOnboard .gob-bigplay { font-size: 14px; padding: 10px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  #gcOnboard, #gcOnboard .gob-choice, #gcOnboard .gob-submit.ready, #gcOnboard .gob-bigplay { animation: none; }
}
