/* ============================================================
   ENCUESTA DE INICIO — pop-up de calificación de proyecto
   Sin cajas duras: papel, hairlines y aire. Las respuestas se
   arman en un mensaje listo para WhatsApp.
   ============================================================ */

.encuesta[hidden] { display: none; }

.encuesta {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}

.encuesta__velo {
  position: absolute; inset: 0;
  background: rgba(16, 15, 14, .5);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .4s ease;
}
.encuesta.is-open .encuesta__velo { opacity: 1; }

.encuesta__panel {
  position: relative; width: 100%; max-width: 520px;
  background: var(--paper); border-radius: 18px;
  padding: 44px 44px 36px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .28);
  opacity: 0; transform: translateY(14px) scale(.985);
  transition: opacity .45s ease, transform .45s cubic-bezier(.22, 1, .36, 1);
}
.encuesta.is-open .encuesta__panel { opacity: 1; transform: none; }
/* El panel recibe el foco al abrir (para que Tab entre aquí), pero no debe
   dibujarse el aro: el contenedor no es un control. Los botones sí lo llevan. */
.encuesta__panel:focus, .encuesta__panel:focus-visible { outline: none; }

/* Blanco de toque de 44 px y fondo propio: tiene que verse y atinarse a la
   primera, sobre todo en teléfono. */
.encuesta__cerrar {
  position: absolute; top: 12px; right: 12px;
  width: 44px; height: 44px; border: 0; cursor: pointer;
  background: var(--paper-warm); color: var(--ink-soft);
  font-size: 26px; line-height: 1;
  border-radius: 50%; transition: background .3s ease, color .3s ease;
}
.encuesta__cerrar:hover { background: var(--ink); color: #fff; }

/* ---------- encabezado ---------- */
.encuesta__paso {
  font-size: 11px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--orange-text); font-weight: 700; margin-bottom: 14px;
}
.encuesta__titulo {
  font-size: 28px; font-weight: 300; line-height: 1.15; letter-spacing: -.01em;
  color: var(--ink); margin-bottom: 6px;
}
.encuesta__sub { font-size: 15px; color: var(--ink-soft); line-height: 1.5; margin-bottom: 26px; }

/* ---------- opciones: filas con hairline, no botones ---------- */
.encuesta__opciones { display: flex; flex-direction: column; margin-top: 22px; }
.encuesta__opcion {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; width: 100%; padding: 17px 4px; border: 0; background: none;
  border-top: 1px solid #e8e4db; cursor: pointer; text-align: left;
  font-family: inherit; font-size: 17px; color: var(--ink);
  transition: color .3s ease, padding-left .3s cubic-bezier(.22, 1, .36, 1);
}
.encuesta__opcion:last-child { border-bottom: 1px solid #e8e4db; }
.encuesta__opcion::after {
  content: "›"; font-size: 22px; color: #c9c3b6; line-height: 1;
  transition: color .3s ease, transform .3s cubic-bezier(.22, 1, .36, 1);
}
.encuesta__opcion:hover, .encuesta__opcion:focus-visible {
  color: var(--orange-text); padding-left: 10px;
}
.encuesta__opcion:hover::after, .encuesta__opcion:focus-visible::after {
  color: var(--orange); transform: translateX(4px);
}
.encuesta__opcion.is-elegida { color: var(--orange-text); }

/* Pie: "Atrás" a la izquierda y la salida a la derecha. La salida está
   siempre visible en todos los pasos — es un pop-up que aparece solo, tiene
   que ser evidente cómo quitárselo de encima. */
.encuesta__pie {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-top: 22px; min-height: 34px;
}
.encuesta__atras, .encuesta__descartar {
  border: 0; background: none; cursor: pointer; font-family: inherit;
  font-size: 14px; color: var(--ink-soft); padding: 8px 2px;
  transition: color .3s ease;
}
.encuesta__atras:hover, .encuesta__descartar:hover { color: var(--ink); }
.encuesta__atras[hidden] { display: none; }
.encuesta__descartar {
  margin-left: auto; text-decoration: underline; text-underline-offset: 4px;
}

/* ---------- resumen final ---------- */
.encuesta__resumen {
  margin: 24px 0 30px; padding: 20px 22px;
  background: var(--paper-warm); border-radius: 12px;
}
.encuesta__resumen div {
  display: flex; justify-content: space-between; gap: 18px;
  font-size: 15px; padding: 7px 0;
}
.encuesta__resumen dt, .encuesta__resumen span:first-child { color: var(--ink-soft); }
.encuesta__resumen span:last-child { color: var(--ink); font-weight: 600; text-align: right; }

.encuesta__acciones { display: flex; flex-direction: column; gap: 12px; }
.encuesta__wa {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 24px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 16px; font-weight: 600;
  transition: background .3s ease, transform .3s ease;
}
.encuesta__wa:hover { background: var(--orange); transform: translateY(-2px); }
.encuesta__wa svg { width: 19px; height: 19px; fill: currentColor; flex: 0 0 auto; }
.encuesta__seguir {
  border: 0; background: none; cursor: pointer; font-family: inherit;
  font-size: 15px; color: var(--ink-soft); padding: 10px;
  text-decoration: underline; text-underline-offset: 4px;
  transition: color .3s ease;
}
.encuesta__seguir:hover { color: var(--ink); }

/* ---------- botón flotante para reabrir ---------- */
.encuesta-abrir {
  position: fixed; right: 20px; bottom: 20px; z-index: 120;
  display: flex; align-items: center; gap: 9px;
  padding: 13px 20px; border: 0; border-radius: 999px; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 600;
  background: var(--ink); color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .45s ease, transform .45s cubic-bezier(.22, 1, .36, 1), background .3s ease;
}
/* Visible solo si además NO está tapado. `is-tapado` lo pone el JS mientras la
   secuencia del Home ocupa la pantalla: ahí el botón se encimaba con el texto
   de las etapas y competía con el riel de puntos de la misma esquina. */
.encuesta-abrir.is-visible:not(.is-tapado) { opacity: 1; transform: none; pointer-events: auto; }
.encuesta-abrir:hover { background: var(--orange); }
.encuesta-abrir svg { width: 17px; height: 17px; fill: currentColor; }

@media (max-width: 767px) {
  .encuesta { padding: 16px; align-items: flex-end; }
  .encuesta__panel { padding: 34px 24px 26px; border-radius: 18px; max-width: none; }
  .encuesta__titulo { font-size: 24px; }
  .encuesta__opcion { font-size: 16px; padding: 16px 2px; }
  .encuesta-abrir { right: 14px; bottom: 14px; padding: 12px 17px; font-size: 13px; }
  /* El riel de la secuencia vive en la misma esquina: se sube el botón
     para que no se encimen. */
  .encuesta-abrir { bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .encuesta__velo, .encuesta__panel, .encuesta-abrir,
  .encuesta__opcion, .encuesta__wa { transition: none; }
}
