/* =========================================================
   Mítica · mitica.css
   Especificaciones aprobadas en "Diseño visual y UX".
   Base móvil de 375 px; en escritorio, columna de 480 px centrada.
   ========================================================= */

/* ---------- 1. Fuentes (alojadas en el sitio) ---------- */
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 800; font-display: swap; src: url('../fuentes/fraunces-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: italic; font-weight: 400; font-display: swap; src: url('../fuentes/fraunces-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fuentes/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fuentes/inter-latin-500-normal.woff2') format('woff2'); }

/* ---------- 2. Variables ---------- */
:root {
  /* Colores de la interfaz */
  --crema: #F6EFE4;
  --tinta: #1E1A2E;
  --texto-secundario: #5C566B;
  --pista: #E3DACB;
  --opcion-fondo: #FFFFFF;
  --error: #A32D2D;

  /* Colores del arquetipo (los fija app.js en el resultado) */
  --arq-fondo: #E8492F;
  --arq-texto: #2A0E08;
  --arq-boton-fondo: #2A0E08;
  --arq-boton-texto: #F6EFE4;

  /* Tipografía */
  --fuente-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --fuente-texto: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* Medidas */
  --ancho-max: 480px;
  --margen: 20px;
  --sep-bloque: 24px;
  --sep-seccion: 40px;
  --boton-alto: 52px;
  --boton-radio: 26px;
  --opcion-alto: 64px;
  --opcion-radio: 16px;
  --campo-alto: 48px;
  --campo-radio: 12px;
  --borde: 1.5px;
  --tactil: 44px;

  /* Tiempos */
  --t-progreso: 250ms;
  --t-cambio: 200ms;

  color-scheme: light;
}

/* ---------- 3. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--crema);
  color: var(--tinta);
  font-family: var(--fuente-texto);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--tinta); outline-offset: 3px; }
[hidden] { display: none !important; }

.contenedor {
  width: 100%;
  max-width: var(--ancho-max);
  margin: 0 auto;
  padding-left: max(var(--margen), env(safe-area-inset-left, 0px));
  padding-right: max(var(--margen), env(safe-area-inset-right, 0px));
}

.pantalla { min-height: 100vh; min-height: 100dvh; }
.pantalla.entra { animation: entrar var(--t-cambio) ease-out both; }
@keyframes entrar { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- 4. Componentes comunes ---------- */
.boton {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: var(--boton-alto);
  border: 0; border-radius: var(--boton-radio);
  font-family: var(--fuente-texto); font-weight: 500; font-size: 16px;
  text-decoration: none;
  transition: transform 80ms ease;
}
.boton:active { transform: scale(0.98); }
.boton--tinta { background: var(--tinta); color: var(--crema); }
.boton--crema { background: var(--crema); color: var(--tinta); }
.boton--arquetipo { background: var(--arq-boton-fondo); color: var(--arq-boton-texto); }
.boton--secundario {
  background: transparent; color: var(--tinta);
  border: var(--borde) solid var(--tinta);
}

.discos { display: flex; gap: 6px; justify-content: center; }
.disco { width: 14px; height: 14px; border-radius: 50%; flex: none; }

/* Discos de la portada: ola que recorre la fila y descansa (opción B aprobada) */
.discos--ola { height: 24px; align-items: center; }
.discos--ola .disco { animation: ola 3.2s ease-in-out infinite; animation-delay: calc(var(--i) * 0.09s); }
@keyframes ola { 0% { transform: translateY(0); } 9% { transform: translateY(-6px); } 18%, 100% { transform: translateY(0); } }

.aviso-legal {
  font-size: 12px; line-height: 1.5; color: var(--texto-secundario);
  margin: 0;
}
.pie {
  display: flex; flex-direction: column; gap: 12px;
  padding-top: var(--sep-bloque);
  padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
  text-align: center;
}
.pie a { font-size: 12px; color: var(--texto-secundario); }

/* ---------- 5. Portada ---------- */
.portada {
  display: flex; flex-direction: column;
}
.portada__centro {
  flex: 1;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: var(--sep-bloque);
  text-align: center;
  padding-block: 48px var(--sep-bloque);
}
.portada__titulo {
  font-family: var(--fuente-display); font-weight: 800;
  font-size: 44px; line-height: 1; margin: 0; letter-spacing: -0.01em;
}
.portada__subtitulo {
  font-family: var(--fuente-display); font-style: italic; font-weight: 400;
  font-size: 18px; margin: -12px 0 0;
}
.portada__texto { max-width: 300px; margin: 0; color: var(--texto-secundario); text-wrap: balance; }
.portada__dato { color: var(--tinta); font-weight: 500; }
.portada__accion { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.portada__linea { font-size: 13px; font-weight: 500; color: var(--texto-secundario); margin: 0; }

/* ---------- 6. Pregunta ---------- */
.pregunta { padding-bottom: 32px; }
.cabecera-test {
  display: grid; grid-template-columns: var(--tactil) 1fr auto;
  align-items: center; gap: 12px;
  padding-top: 12px; padding-bottom: 12px;
}
.volver {
  width: var(--tactil); height: var(--tactil);
  display: grid; place-items: center;
  background: none; border: 0; padding: 0; margin-left: -10px;
}
.volver[aria-hidden="true"] { visibility: hidden; }
.progreso { height: 6px; background: var(--pista); border-radius: 3px; overflow: hidden; }
.progreso__relleno {
  height: 100%; width: 0; background: var(--tinta); border-radius: 3px;
  transition: width var(--t-progreso) ease;
}
.contador {
  font-size: 13px; font-weight: 500; color: var(--texto-secundario);
  font-variant-numeric: tabular-nums; min-width: 40px; text-align: right;
}
.pregunta__cuerpo {
  text-align: center;
  display: flex; flex-direction: column; gap: var(--sep-bloque);
  padding-top: var(--sep-bloque);
}
.pregunta__cuerpo.cambia { animation: entrar var(--t-cambio) ease-out both; }
.instrucciones { font-size: 14px; line-height: 1.5; color: var(--texto-secundario); margin: 0; }
.pregunta__texto {
  font-family: var(--fuente-display); font-weight: 800;
  font-size: 24px; line-height: 1.25; margin: 0;
  text-wrap: balance;
}
.opciones { display: flex; flex-direction: column; gap: 12px; }
.opcion {
  min-height: var(--opcion-alto);
  padding: 16px;
  background: var(--opcion-fondo); color: var(--tinta);
  border: var(--borde) solid var(--tinta); border-radius: var(--opcion-radio);
  text-align: center; font-size: 16px; line-height: 1.4;
  transition: transform 80ms ease, background-color 120ms ease, color 120ms ease;
}
.opcion:active { transform: scale(0.98); }
.opcion[aria-pressed="true"] { background: var(--tinta); color: var(--crema); }

/* ---------- 7. Pantalla previa ---------- */
.previa {
  background: var(--tinta); color: var(--crema);
  display: flex; align-items: center; justify-content: center;
}
.previa__contenido {
  display: flex; flex-direction: column; align-items: center; gap: var(--sep-bloque);
  text-align: center;
}
.rueda { position: relative; width: 120px; height: 120px; }
.rueda.gira { animation: girar 1.5s ease-in-out both; }
.rueda .disco { position: absolute; left: 53px; top: 53px; }
@keyframes girar { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.previa__cargando { font-size: 16px; margin: 0; }
.previa__listo {
  display: flex; flex-direction: column; align-items: center; gap: var(--sep-bloque);
  width: 100%;
  animation: fundido 300ms ease-out both;
}
.previa__titulo {
  font-family: var(--fuente-display); font-weight: 800;
  font-size: 28px; line-height: 1.15; margin: 0; text-wrap: balance;
}
@keyframes fundido { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 8. Resultado ---------- */
.resultado__cabecera {
  background: var(--arq-fondo); color: var(--arq-texto);
  padding-block: 32px;
  text-align: center;
}
.resultado__cabecera .contenedor {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.resultado__etiqueta { font-size: 14px; font-weight: 500; margin: 0; }
.resultado__simbolo { width: 160px; height: 160px; }
.resultado__nombre {
  font-family: var(--fuente-display); font-weight: 800;
  font-size: 40px; line-height: 1; margin: 0;
}
.resultado__ejes { font-size: 13px; font-weight: 500; margin: 0; text-wrap: balance; }
.resultado__esencia {
  font-family: var(--fuente-display); font-style: italic; font-weight: 400;
  font-size: 18px; line-height: 1.35; margin: 0 0 8px; text-wrap: balance;
}

.resultado__cuerpo {
  display: flex; flex-direction: column; gap: var(--sep-seccion);
  padding-block: var(--sep-seccion);
  text-align: center;
}
.seccion { display: flex; flex-direction: column; gap: 12px; }
.seccion__titulo {
  font-family: var(--fuente-display); font-weight: 800;
  font-size: 22px; line-height: 1.2; margin: 0;
}
.seccion p { margin: 0; }
.dones { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; text-wrap: balance; }
.dones li::before { /* disco del color del arquetipo en lugar de la viñeta */
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--arq-fondo); margin-right: 8px; vertical-align: 0.1em;
}
.frase {
  font-family: var(--fuente-display); font-style: italic; font-weight: 400;
  font-size: 22px; line-height: 1.35; text-align: center; margin: 0;
  text-wrap: balance;
}
/* Tarjeta de "Con quién": color del otro arquetipo, contenido en columna */
.vinculo {
  display: flex; flex-direction: column; align-items: center;
  padding: var(--sep-bloque) var(--margen);
  border-radius: var(--opcion-radio);
  background: var(--v-fondo); color: var(--v-texto);
}
.vinculo img { width: 56px; height: 56px; margin-bottom: 12px; }
.vinculo__tipo {
  font-family: var(--fuente-display); font-style: italic; font-weight: 400;
  font-size: 18px; line-height: 1.3; margin: 0;
}
.vinculo__nombre {
  font-family: var(--fuente-display); font-weight: 800;
  font-size: 26px; line-height: 1.1; margin: 0 0 8px;
}
.vinculo__texto { margin: 0; text-wrap: balance; }

.campo {
  width: 100%; height: var(--campo-alto);
  padding: 0 14px;
  border: var(--borde) solid var(--tinta); border-radius: var(--campo-radio);
  text-align: center;
  background: var(--opcion-fondo); color: var(--tinta);
  font: 16px/1 var(--fuente-texto);
}
.campo[aria-invalid="true"] { border-color: var(--error); }
.desbloqueo__error { font-size: 13px; color: var(--error); margin: -4px 0 0; }
.desbloqueo__consentimiento { font-size: 12px; line-height: 1.5; color: var(--texto-secundario); margin: 0; }
.solo-lector, .trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.cierre { background: var(--arq-fondo); color: var(--arq-texto); padding-block: var(--sep-seccion); }
.cierre .contenedor { display: flex; flex-direction: column; gap: var(--sep-bloque); text-align: center; }
.cierre p { margin: 0; }

/* ---------- 8b. Desbloqueo del informe ---------- */
.desbloqueo {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--opcion-fondo); border: var(--borde) solid var(--tinta); border-radius: var(--opcion-radio);
  padding: var(--sep-bloque) var(--margen);
  scroll-margin-top: 16px;
  animation: fundido var(--t-cambio) ease-out both;
}
.desbloqueo__texto { color: var(--texto-secundario); margin: 0; }
.desbloqueo__form { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.desbloqueo__consentimiento a { color: inherit; }
.desbloqueo__confirmacion {
  margin: 0; padding: 12px 16px; border-radius: 12px;
  background: var(--arq-fondo); color: var(--arq-texto);
  font-size: 14px; font-weight: 500; line-height: 1.4;
  animation: fundido var(--t-cambio) ease-out both;
}
.boton:disabled { cursor: default; }

/* Casilla de novedades: 20 × 20, esquinas de 4 px; marcada, fondo tinta y marca crema */
.casilla {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--tactil); cursor: pointer; text-align: left;
}
.casilla input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.casilla__caja {
  position: relative; flex: none; width: 20px; height: 20px;
  border: var(--borde) solid var(--tinta); border-radius: 4px; background: var(--opcion-fondo);
}
.casilla input:checked + .casilla__caja {
  /* Marca crema centrada con un SVG: se ve igual en cualquier navegador y densidad de pantalla */
  background: var(--tinta) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-4.9' fill='none' stroke='%23F6EFE4' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px 12px no-repeat;
}
.casilla input:focus-visible + .casilla__caja { outline: 2px solid var(--tinta); outline-offset: 3px; }
.casilla__texto { font-size: 14px; line-height: 1.4; }

/* ---------- 8c. Informe completo ---------- */
.informe { display: flex; flex-direction: column; gap: var(--sep-seccion); }
.informe.aparece { animation: fundido 300ms ease-out both; }
.apartados { display: flex; flex-direction: column; gap: 16px; }
.apartado { display: flex; flex-direction: column; gap: 4px; }
.etiqueta {
  font-family: var(--fuente-display); font-style: italic; font-weight: 400;
  font-size: 18px; line-height: 1.3;
}
.tarjeta-arq {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: var(--sep-bloque) var(--margen); border-radius: var(--opcion-radio);
  background: var(--v-fondo); color: var(--v-texto);
}
.informe__pregunta-etiqueta { font-size: 13px; font-weight: 500; }
.informe__pregunta-texto {
  font-family: var(--fuente-display); font-style: italic; font-weight: 400;
  font-size: 22px; line-height: 1.3; text-wrap: balance;
}
.mapa__fila { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.mapa__texto strong { font-weight: 500; }
.mapa__barra { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; width: 100%; max-width: 280px; }
.mapa__segmento { height: 8px; border-radius: 4px; background: var(--pista); }
.mapa__alma { font-family: var(--fuente-display); font-weight: 800; font-size: 22px; line-height: 1.2; text-wrap: balance; }
.mapa__alma-frase {
  font-family: var(--fuente-display); font-style: italic; font-weight: 400;
  font-size: 18px; line-height: 1.35; text-wrap: balance;
}
.seccion--mapa .vinculo { margin-top: 12px; } /* 24 px entre las barras y la tarjeta del secundario */

/* Tú y los otros arquetipos: tarjetas como "Con quién", más compactas */
.tarjetas { display: flex; flex-direction: column; gap: 8px; }
.tarjeta-arq--compacta { gap: 4px; padding: 16px var(--margen); }
.tarjeta-arq--compacta img { width: 40px; height: 40px; margin-bottom: 4px; }
.tarjeta-arq__nombre { font-family: var(--fuente-display); font-weight: 800; font-size: 20px; line-height: 1.2; margin: 0; }

/* Cómo creces: número arriba y texto centrado */
.practicas { display: flex; flex-direction: column; gap: var(--sep-bloque); }
.practica { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.practica__numero {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-size: 14px; font-weight: 500;
}
.practica strong { font-weight: 500; }
.informe__cierre {
  font-family: var(--fuente-display); font-style: italic; font-weight: 400;
  font-size: 22px; line-height: 1.35; text-wrap: balance;
}
/* Oferta del audio: discreta, tras un separador */
.audio { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 12px; }
.audio::before { content: ""; width: 240px; max-width: 100%; height: 1px; background: var(--pista); margin-bottom: 12px; }
.audio__titulo { font-family: var(--fuente-display); font-style: italic; font-weight: 400; font-size: 18px; line-height: 1.35; text-wrap: balance; }
.audio__texto { font-size: 14px; line-height: 1.5; color: var(--texto-secundario); text-wrap: balance; }
.audio__texto strong { font-weight: 500; color: var(--tinta); }
.audio__boton { width: auto; height: var(--tactil); padding: 0 24px; font-size: 15px; margin-top: 4px; }

/* ---------- 9. Aviso breve (tras descargar y copiar) ---------- */
.aviso {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 40px);
  background: var(--tinta); color: var(--crema);
  font-size: 14px; line-height: 1.4; text-align: center;
  padding: 12px 16px; border-radius: 12px;
  animation: fundido var(--t-cambio) ease-out both;
  z-index: 20;
}

/* ---------- 10. Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  .pantalla.entra, .pregunta__cuerpo.cambia { animation-name: fundido; }
  .informe.aparece, .desbloqueo, .desbloqueo__confirmacion { animation: none; }
  .rueda.gira, .discos--ola .disco { animation: none; }
  .boton:active, .opcion:active { transform: none; }
}

/* ---------- 11. Página legal ---------- */
.legal { display: flex; flex-direction: column; gap: 16px; padding-block: 24px 48px; }
.legal p { margin: 0; }
.legal__volver { font-size: 14px; font-weight: 500; min-height: var(--tactil); display: inline-flex; align-items: center; }
.baja { text-align: center; align-items: center; padding-top: 30vh; }
