:root {
  --navy: #172464;
  --navy-2: #26409a;
  --azul: #3f7cf4;
  --tinta: #1b2140;
  --suave: #67718f;
  --fondo: #eef3fc;
  --linea: #dce4f3;
  --mala: #ff7b70;
  --regular: #ffca3d;
  --buena: #6fd98b;
  --excelente: #5b9bff;
}

* { box-sizing: border-box; }

html,
body { margin: 0; }

body {
  min-height: 100dvh;
  color: var(--tinta);
  background: var(--fondo);
  font-family: "Nunito", "Segoe UI", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

button { font: inherit; }

.app {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 460px;
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: #fff;
}

@media (min-width: 520px) {
  body { padding: 28px 0; }
  .app {
    min-height: min(860px, calc(100dvh - 56px));
    border-radius: 34px;
    box-shadow: 0 30px 70px rgba(23, 36, 100, 0.14);
  }
}

.pantalla,
.vista {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.entra { animation: entra 0.34s ease both; }
.vuelve { animation: vuelve 0.34s ease both; }

@keyframes entra {
  from { opacity: 0; transform: translateX(28px); }
  to { opacity: 1; transform: none; }
}

@keyframes vuelve {
  from { opacity: 0; transform: translateX(-28px); }
  to { opacity: 1; transform: none; }
}

/* Caritas */

.cara {
  display: block;
  width: 64px;
  aspect-ratio: 1;
}

.cara svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.piel-mala { fill: var(--mala); }
.piel-regular { fill: var(--regular); }
.piel-buena { fill: var(--buena); }
.piel-excelente { fill: var(--excelente); }

/* Bienvenida */

.bienvenida {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.hero {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 34px 26px 28px;
  border-radius: 0 0 40px 40px;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
  text-align: center;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
}

.hero::before { width: 280px; height: 280px; top: -110px; right: -90px; }
.hero::after { width: 200px; height: 200px; bottom: -90px; left: -70px; }

.hero > * { position: relative; z-index: 1; }

.hero .logo {
  width: 170px;
  height: auto;
}

.deco {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 38px 0 28px;
}

.deco .cara {
  width: 58px;
  filter: drop-shadow(0 8px 14px rgba(5, 12, 50, 0.3));
  animation: flota 3.2s ease-in-out infinite;
}

.deco .cara:nth-child(2) { animation-delay: 0.25s; }
.deco .cara:nth-child(3) { animation-delay: 0.5s; }
.deco .cara:nth-child(4) { animation-delay: 0.75s; }

@keyframes flota {
  50% { transform: translateY(-8px); }
}

.hero h1 {
  margin: 0 0 12px;
  font-size: 2.15rem;
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.hero p {
  max-width: 320px;
  margin: 0 auto;
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.4;
  opacity: 0.86;
}

.hero-pie {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  padding: 22px 22px 28px;
}

.datos {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: -48px 0 0;
  padding: 18px 10px;
  list-style: none;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(23, 36, 100, 0.13);
  text-align: center;
}

.datos li {
  color: var(--suave);
  font-size: 0.82rem;
  font-weight: 700;
}

.datos li + li { border-left: 1.5px solid var(--linea); }

.datos strong {
  display: block;
  margin-bottom: 2px;
  color: var(--navy);
  font-size: 1.22rem;
  font-weight: 900;
}

.temas-titulo {
  margin: 0 0 12px 4px;
  color: var(--suave);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.temas ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.temas li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 20px;
  background: var(--fondo);
}

.tema-icono {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: #fff;
  color: var(--navy);
}

.tema-icono svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.temas strong {
  display: block;
  color: var(--navy);
  font-size: 1rem;
  font-weight: 900;
}

.temas li span:not(.tema-icono) {
  color: var(--suave);
  font-size: 0.9rem;
  font-weight: 600;
}

.hero-pie .boton { margin-top: auto; }

/* Botones */

.boton {
  width: 100%;
  min-height: 60px;
  border: 0;
  border-radius: 22px;
  background: var(--navy);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 26px rgba(23, 36, 100, 0.26);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.boton:active { transform: translateY(2px); box-shadow: 0 8px 16px rgba(23, 36, 100, 0.22); }
.boton:disabled { opacity: 0.6; cursor: wait; }
.boton:focus-visible { outline: 3px solid rgba(63, 124, 244, 0.55); outline-offset: 3px; }

/* Barra superior */

.arriba {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 20px 0;
}

.atras {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 15px;
  background: var(--fondo);
  color: var(--navy);
  cursor: pointer;
}

.atras svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.barra {
  flex: 1;
  height: 10px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--fondo);
}

.barra span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--azul), var(--navy));
  transition: width 0.4s ease;
}

.contador {
  min-width: 40px;
  color: var(--suave);
  font-size: 0.88rem;
  font-weight: 800;
  text-align: right;
}

/* Pregunta */

.cuerpo {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  padding: 26px 22px 96px;
  text-align: center;
}

.cuerpo-form {
  justify-content: flex-start;
  padding-top: 40px;
  padding-bottom: 26px;
}

.chip {
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 99px;
  background: #e8f0ff;
  color: var(--navy);
  font-size: 0.88rem;
  font-weight: 800;
}

.chip svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pregunta {
  margin: 18px 0 8px;
  color: var(--navy);
  font-size: 1.85rem;
  font-weight: 900;
  line-height: 1.14;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.ayuda {
  margin: 0 0 38px;
  color: var(--suave);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.4;
}

.cuerpo-form .ayuda { margin-bottom: 26px; }

.caras {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.caras-3 {
  justify-content: center;
  gap: 14px;
}

.cara-btn {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px 2px 10px;
  border: 0;
  border-radius: 24px;
  background: transparent;
  cursor: pointer;
  transition: opacity 0.2s ease, background-color 0.2s ease;
}

.caras-3 .cara-btn { flex: 1 1 0; max-width: 130px; }

.marca {
  margin: 0;
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.marca-pie { margin-top: 46px; font-size: 0.95rem; }

.atras-vacio { background: transparent; }

.aviso {
  margin: 0 0 22px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--fondo);
  color: var(--suave);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.45;
  text-align: left;
}

.caras-3 .etiqueta {
  min-height: 2.3em;
  font-size: 0.8rem;
}

.cara-btn .cara {
  width: min(72px, 100%);
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.caras-3 .cara-btn .cara { width: min(84px, 100%); }

.cara-btn:hover .cara { transform: translateY(-4px); }
.cara-btn:active .cara { transform: scale(0.9); }
.cara-btn:focus-visible { outline: 3px solid rgba(63, 124, 244, 0.55); outline-offset: 2px; }

.etiqueta {
  max-width: 100%;
  color: var(--suave);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.15;
}

.caras.con-eleccion .cara-btn { opacity: 0.38; }

.caras.con-eleccion .cara-btn.elegida {
  opacity: 1;
  background: var(--fondo);
}

.cara-btn.elegida .cara { transform: scale(1.14); }
.cara-btn.elegida .etiqueta { color: var(--navy); }

/* Formularios */

.campo {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  text-align: left;
}

.campo > span {
  color: var(--navy);
  font-size: 0.95rem;
  font-weight: 800;
}

textarea,
input {
  width: 100%;
  padding: 15px 17px;
  border: 2px solid var(--linea);
  border-radius: 18px;
  outline: none;
  background: #f7f9fe;
  color: var(--tinta);
  font: inherit;
  font-size: 1.02rem;
  font-weight: 600;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

textarea {
  min-height: 160px;
  resize: none;
  line-height: 1.45;
}

textarea::placeholder,
input::placeholder { color: #a3abc2; }

textarea:focus,
input:focus {
  border-color: var(--azul);
  background: #fff;
}

.acciones {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  padding-top: 22px;
}

.nota {
  margin: 0;
  color: var(--suave);
  font-size: 0.9rem;
  font-weight: 700;
}

.error {
  margin: 0 0 4px;
  padding: 13px 15px;
  border-radius: 16px;
  background: #fff0ee;
  color: #b3261e;
  font-weight: 700;
  text-align: left;
}

.oculto,
.trampa {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.trampa { left: -9999px; }

/* Gracias */

.gracias {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 30px 36px;
  background: radial-gradient(circle at 50% 34%, #e4edff 0, #fff 62%);
  text-align: center;
}

.festejo {
  position: relative;
  width: 200px;
  height: 200px;
  display: grid;
  place-items: center;
}

.festejo .cara {
  width: 132px;
  filter: drop-shadow(0 16px 24px rgba(23, 36, 100, 0.18));
  animation: aparece 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes aparece {
  from { opacity: 0; transform: scale(0.3) rotate(-12deg); }
  to { opacity: 1; transform: none; }
}

.chispa {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  animation: chispa 0.9s ease-out 0.25s both;
}

.chispa-1 { top: 8px; left: 50%; background: var(--regular); }
.chispa-2 { top: 34px; right: 22px; background: var(--excelente); width: 9px; height: 9px; }
.chispa-3 { top: 50%; right: 2px; background: var(--buena); }
.chispa-4 { bottom: 30px; right: 26px; background: var(--mala); width: 9px; height: 9px; }
.chispa-5 { bottom: 4px; left: 46%; background: var(--excelente); }
.chispa-6 { bottom: 34px; left: 22px; background: var(--regular); width: 9px; height: 9px; }
.chispa-7 { top: 48%; left: 0; background: var(--mala); }
.chispa-8 { top: 30px; left: 26px; background: var(--buena); width: 9px; height: 9px; }

@keyframes chispa {
  from { opacity: 0; transform: scale(0); }
  60% { opacity: 1; transform: scale(1.3); }
  to { opacity: 1; transform: scale(1); }
}

.gracias h2 {
  margin: 18px 0 10px;
  color: var(--navy);
  font-size: 2.1rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.gracias p {
  max-width: 310px;
  margin: 0;
  color: var(--suave);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.45;
}

.logo-pie {
  width: 150px;
  height: auto;
  margin-top: 46px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
