/* Encuesta de satisfacción GABOTRIX — hoja de estilo única.
 *
 * Sin compilador ni framework: la página se sirve tal cual desde GitHub Pages,
 * así que lo que hay aquí es lo que llega al navegador. Cualquiera puede abrir
 * el archivo y cambiar un color sin instalar nada.
 *
 * El azul y el degradado son los de la web pública (brand-override.css de
 * gabotrix-ai-nova); la tipografía, la misma DM Sans. */

:root {
  --marca: #1a73e8;
  --marca-claro: #5ab4ff;
  --degradado: linear-gradient(135deg, #1a73e8 0%, #5ab4ff 100%);

  --fondo: #05070d;
  --tinta: #f2f6fb;
  --tinta-2: #9aa8bd;
  --tinta-3: #67748a;

  --vidrio: rgba(255, 255, 255, 0.045);
  --vidrio-alto: rgba(255, 255, 255, 0.075);
  --borde: rgba(255, 255, 255, 0.10);
  --borde-alto: rgba(255, 255, 255, 0.22);

  --bien: #34d399;
  --medio: #fbbf24;
  --mal: #f87171;

  --radio: 18px;
  --radio-sm: 14px;
  --ancho: 720px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  background: var(--fondo);
  color: var(--tinta);
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* La aurora del fondo: dos manchas de color muy desenfocadas que se mueven
 * despacio. Van en un pseudo-elemento fijo para que no entren en el flujo ni
 * provoquen barra horizontal en móvil. */
body::before {
  content: "";
  position: fixed;
  inset: -30vmax;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(38vmax 38vmax at 22% 18%, rgba(26, 115, 232, 0.30), transparent 62%),
    radial-gradient(32vmax 32vmax at 80% 78%, rgba(90, 180, 255, 0.20), transparent 62%),
    radial-gradient(26vmax 26vmax at 62% 8%, rgba(120, 80, 255, 0.14), transparent 65%);
  filter: blur(18px);
  animation: aurora 26s ease-in-out infinite alternate;
}

/* Una retícula finísima encima: le da textura de producto y evita que el
 * degradado se vea como una mancha lisa. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(70% 60% at 50% 30%, #000 30%, transparent 100%);
}

@keyframes aurora {
  from { transform: translate3d(-3%, -2%, 0) scale(1); }
  to   { transform: translate3d(4%, 3%, 0) scale(1.12); }
}

/* ------------------------------------------------------------------ armazón */

.envoltura {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.cabecera {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 18px 16px 12px;
  background: linear-gradient(to bottom, rgba(5, 7, 13, 0.92) 55%, transparent);
  backdrop-filter: blur(8px);
}

.cabecera-fila {
  max-width: var(--ancho);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo { height: 26px; width: auto; display: block; }

.paso-de {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tinta-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.barra {
  max-width: var(--ancho);
  margin: 14px auto 0;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.barra-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--degradado);
  box-shadow: 0 0 14px rgba(90, 180, 255, 0.55);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.escena {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px 40px;
}

.paso {
  width: 100%;
  max-width: var(--ancho);
}

/* Entrada de cada pantalla. La clase se quita y se vuelve a poner al cambiar
 * de paso para que la animación se repita. */
.entra { animation: entra 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; }
.entra-atras { animation: entra-atras 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; }

@keyframes entra {
  from { opacity: 0; transform: translate3d(0, 22px, 0); }
  to   { opacity: 1; transform: none; }
}
@keyframes entra-atras {
  from { opacity: 0; transform: translate3d(0, -18px, 0); }
  to   { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- tipografía */

.epigrafe {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 10px;
  margin-bottom: 18px;
  border-radius: 999px;
  border: 1px solid var(--borde);
  background: var(--vidrio);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tinta-2);
}

.punto {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--marca-claro);
  box-shadow: 0 0 0 0 rgba(90, 180, 255, 0.6);
  animation: latido 2.2s ease-out infinite;
}

@keyframes latido {
  0%   { box-shadow: 0 0 0 0 rgba(90, 180, 255, 0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(90, 180, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(90, 180, 255, 0); }
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 6.5vw, 46px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

h2 {
  margin: 0 0 8px;
  font-size: clamp(22px, 4.6vw, 30px);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.ayuda {
  margin: 0 0 26px;
  color: var(--tinta-2);
  font-size: 15px;
}

.opcional {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tinta-3);
  vertical-align: middle;
}

/* ------------------------------------------------------------------ portada */

.portada-marco {
  padding: 34px 26px;
  border-radius: 26px;
  border: 1px solid var(--borde);
  background: var(--vidrio);
  backdrop-filter: blur(14px);
}

.datos-portada {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 28px;
}

.dato {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid var(--borde);
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
  color: var(--tinta-2);
}

.dato svg { width: 15px; height: 15px; flex: none; color: var(--marca-claro); }

/* ------------------------------------------------------------------ opciones */

.opciones {
  display: grid;
  gap: 10px;
  margin: 0 0 8px;
}

.opcion {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  border-radius: var(--radio);
  border: 1px solid var(--borde);
  background: var(--vidrio);
  color: var(--tinta);
  font: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease,
              background 0.18s ease, box-shadow 0.18s ease;
  animation: sube 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--retraso, 0s);
}

@keyframes sube {
  from { opacity: 0; transform: translate3d(0, 14px, 0); }
  to   { opacity: 1; transform: none; }
}

@media (hover: hover) {
  .opcion:hover {
    transform: translateY(-2px);
    border-color: var(--borde-alto);
    background: var(--vidrio-alto);
  }
}

.opcion:focus-visible {
  outline: 2px solid var(--marca-claro);
  outline-offset: 3px;
}

.opcion[aria-checked="true"] {
  border-color: rgba(90, 180, 255, 0.65);
  background: linear-gradient(135deg, rgba(26, 115, 232, 0.24), rgba(90, 180, 255, 0.10));
  box-shadow: 0 0 0 1px rgba(90, 180, 255, 0.28), 0 10px 30px -12px rgba(26, 115, 232, 0.8);
}

/* La tecla que selecciona esta opción. En móvil no se enseña: no hay teclado. */
.tecla {
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--borde);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  font-weight: 700;
  color: var(--tinta-3);
  transition: all 0.18s ease;
}

.opcion[aria-checked="true"] .tecla {
  border-color: transparent;
  background: var(--degradado);
  color: #fff;
}

.opcion-emoji { font-size: 22px; line-height: 1; flex: none; }
.opcion-texto { flex: 1; }

.marca-check {
  flex: none;
  width: 22px;
  height: 22px;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: var(--marca-claro);
}

.opcion[aria-checked="true"] .marca-check { opacity: 1; transform: none; }

/* ---------------------------------------------------------------------- NPS */

.nps-escala {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 14px;
}

.nps-chip {
  aspect-ratio: 1;
  min-height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--borde);
  background: var(--vidrio);
  color: var(--tinta-2);
  font: inherit;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease,
              background 0.16s ease, color 0.16s ease;
}

@media (hover: hover) {
  .nps-chip:hover { transform: translateY(-3px); border-color: var(--borde-alto); color: var(--tinta); }
}

.nps-chip:focus-visible { outline: 2px solid var(--marca-claro); outline-offset: 2px; }

.nps-chip[aria-checked="true"] {
  color: #06121f;
  border-color: transparent;
  background: var(--tono, var(--marca-claro));
  box-shadow: 0 8px 24px -10px var(--tono, var(--marca-claro));
  transform: translateY(-3px) scale(1.06);
}

/* Once casillas cuadradas no caben en 375 px: salían de la pantalla y la del 10
 * quedaba cortada. En pantalla estrecha la escala baja a dos filas de seis, que
 * deja cada casilla en unos 52 px y se puede tocar con el pulgar. */
@media (max-width: 560px) {
  .nps-escala { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
  .nps-chip { aspect-ratio: auto; height: 52px; min-height: 0; }
}

.nps-pies {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--tinta-3);
  margin-bottom: 20px;
}

.nps-lectura {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 12px 18px;
  border-radius: var(--radio);
  border: 1px solid var(--borde);
  background: var(--vidrio);
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.3s ease;
}

.nps-lectura[data-visible="true"] { opacity: 1; transform: none; }
.nps-lectura .cara { font-size: 26px; line-height: 1; }
.nps-lectura strong { display: block; font-size: 15px; }
.nps-lectura span { font-size: 13px; color: var(--tinta-2); }

/* ------------------------------------------------------- escalas de 1 a 5 */

.criterio {
  padding: 16px 18px;
  border-radius: var(--radio);
  border: 1px solid var(--borde);
  background: var(--vidrio);
  margin-bottom: 10px;
  animation: sube 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--retraso, 0s);
  transition: border-color 0.2s ease;
}

.criterio[data-respondido="true"] { border-color: rgba(90, 180, 255, 0.34); }

.criterio-cabeza {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.criterio-titulo { font-weight: 600; font-size: 15px; }

.criterio-valor {
  font-size: 13px;
  font-weight: 600;
  color: var(--tinta-3);
  white-space: nowrap;
  transition: color 0.2s ease;
}

.criterio[data-respondido="true"] .criterio-valor { color: var(--marca-claro); }

.estrellas { display: flex; gap: 8px; }

.estrella {
  flex: 1;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: var(--radio-sm);
  border: 1px solid var(--borde);
  background: rgba(255, 255, 255, 0.03);
  color: var(--tinta-3);
  cursor: pointer;
  padding: 0;
  transition: all 0.16s ease;
}

.estrella svg { width: 22px; height: 22px; }
.estrella:focus-visible { outline: 2px solid var(--marca-claro); outline-offset: 2px; }

@media (hover: hover) {
  .estrella:hover { border-color: var(--borde-alto); color: var(--tinta-2); transform: translateY(-2px); }
}

/* `data-on` lo pone el JS en las estrellas hasta la elegida, para que se llenen
 * de izquierda a derecha como una barra y no sólo se marque la última. */
.estrella[data-on="true"] {
  border-color: transparent;
  background: var(--degradado);
  color: #fff;
  box-shadow: 0 8px 22px -12px rgba(26, 115, 232, 0.9);
}

/* ------------------------------------------------------------------ campos */

.campo { margin-bottom: 18px; }

.campo label {
  display: block;
  margin-bottom: 9px;
  font-size: 15px;
  font-weight: 600;
}

.campo input[type="text"],
.campo input[type="email"],
.campo input[type="password"],
.campo textarea {
  width: 100%;
  padding: 15px 17px;
  border-radius: var(--radio);
  border: 1px solid var(--borde);
  background: var(--vidrio);
  color: var(--tinta);
  font: inherit;
  resize: vertical;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.campo textarea { min-height: 112px; line-height: 1.5; }

.campo input::placeholder,
.campo textarea::placeholder { color: var(--tinta-3); }

.campo input:focus,
.campo textarea:focus {
  outline: none;
  border-color: rgba(90, 180, 255, 0.6);
  background: var(--vidrio-alto);
  box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.16);
}

.contador {
  display: block;
  margin-top: 6px;
  text-align: right;
  font-size: 12px;
  color: var(--tinta-3);
  font-variant-numeric: tabular-nums;
}

/* El campo trampa. No es `display:none` a propósito: algunos robots saltan lo
 * oculto de esa forma. Se saca de la pantalla, que sí lo rellenan. */
.trampa {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* El dato de contacto del último paso: aparece sólo si dice que sí. */
.desplegable {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}

.desplegable > div { overflow: hidden; }
.desplegable[data-abierto="true"] { grid-template-rows: 1fr; opacity: 1; margin-top: 14px; }

/* ------------------------------------------------------------------ botones */

.acciones {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 14px 28px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  /* Sin esto, "Prefiero no decirlo" parte en tres líneas y el pill se deforma
     en una mancha: el radio de 999px lo redondea todo. */
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease,
              background 0.18s ease, opacity 0.18s ease;
}

.pill:focus-visible { outline: 2px solid var(--marca-claro); outline-offset: 3px; }

.pill-marca {
  color: #fff;
  background: var(--degradado);
  box-shadow:
    inset 0 -3px 0 rgba(0, 60, 100, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 12px 30px -12px rgba(26, 115, 232, 0.9);
}

@media (hover: hover) {
  .pill-marca:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow:
      inset 0 -3px 0 rgba(0, 60, 100, 0.5),
      inset 0 1px 0 rgba(255, 255, 255, 0.34),
      0 18px 40px -14px rgba(26, 115, 232, 1);
  }
}

.pill-marca:disabled { opacity: 0.45; cursor: not-allowed; }

.pill-suave {
  color: var(--tinta-2);
  border-color: var(--borde);
  background: transparent;
}

@media (hover: hover) {
  .pill-suave:hover { color: var(--tinta); border-color: var(--borde-alto); background: var(--vidrio); }
}

.pista {
  margin-left: auto;
  font-size: 12px;
  color: var(--tinta-3);
}

.pista kbd {
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--borde);
  background: rgba(255, 255, 255, 0.05);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
}

/* Sólo hay teclado que valga la pena anunciar en pantallas grandes. */
@media (max-width: 720px) {
  .pista, .tecla { display: none; }
  .opcion { padding: 15px 16px; }
}

.error {
  margin-top: 16px;
  padding: 13px 16px;
  border-radius: var(--radio-sm);
  border: 1px solid rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.10);
  color: #fecaca;
  font-size: 14px;
}

.error[hidden] { display: none; }

/* Rueda del botón mientras se envía. */
.rueda {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: gira 0.7s linear infinite;
}

@keyframes gira { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ gracias */

.gracias { text-align: center; padding-top: 18px; }

.sello {
  width: 96px;
  height: 96px;
  margin: 0 auto 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--degradado);
  box-shadow: 0 0 0 10px rgba(26, 115, 232, 0.12), 0 22px 60px -18px rgba(26, 115, 232, 1);
  animation: sello 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes sello {
  from { opacity: 0; transform: scale(0.4); }
  to   { opacity: 1; transform: none; }
}

.sello svg { width: 46px; height: 46px; color: #fff; }

.sello path {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: traza 0.5s 0.35s ease forwards;
}

@keyframes traza { to { stroke-dashoffset: 0; } }

/* Los puntos que estallan detrás del sello. Los coloca el JS. */
.chispa {
  position: fixed;
  top: 0; left: 0;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 40;
  animation: chispa 1.1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes chispa {
  from { opacity: 1; transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  to   { opacity: 0; transform: translate3d(var(--dx), var(--dy), 0) rotate(var(--giro)) scale(0.3); }
}

.pie {
  padding: 0 16px 34px;
  text-align: center;
  font-size: 12px;
  color: var(--tinta-3);
}

.pie a { color: var(--tinta-2); }

/* Quien pide menos movimiento recibe la página quieta: sigue funcionando
 * igual, sólo que sin nada que se desplace ni parpadee. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
