/* Quiz no formato padrão: coluna única centralizada, logo e barra de progresso no topo,
   fundo claro do começo ao fim e cada tela cabendo na altura do celular. */

.quiz__app {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100svh;
}

/* ---------- topo: logo + barra ---------- */
.topo {
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;
  max-width: 480px;
  padding: 8px var(--gutter) 6px;
  background: var(--cal);
}

.topo__fila {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  min-height: 40px;
}

.topo__marca {
  justify-self: center;
  gap: 8px;
  font-size: 0.95rem;
}

.topo__marca .marca__sello {
  width: 28px;
  height: 28px;
}

.topo__atras {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}

.topo__atras:hover {
  background: rgba(27, 32, 20, 0.06);
}

.topo__atras svg {
  width: 22px;
  height: 22px;
}

.topo__pista {
  height: 6px;
  margin-top: 6px;
  border-radius: var(--pildora);
  background: rgba(27, 32, 20, 0.1);
  overflow: hidden;
}

.topo__relleno {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--azafran);
  transition: width 0.5s var(--ease);
}

/* ---------- tela ---------- */
.paso {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 480px;
  flex: 1;
  padding: 14px var(--gutter) 20px;
  text-align: center;
}

.paso__cabeza {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.paso__cabeza h1 {
  font-size: clamp(1.55rem, 1.2rem + 1.8vw, 2.1rem);
  line-height: 1.06;
  outline: none;
}

.paso__cabeza h2 {
  font-size: clamp(1.4rem, 1.15rem + 1.4vw, 1.85rem);
  line-height: 1.1;
  outline: none;
}

.paso__antetitulo,
.paso__contador {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.paso__antetitulo {
  padding: 4px 12px;
  border-radius: var(--pildora);
  background: var(--azafran);
}

.paso__contador {
  color: var(--hoja);
}

.paso__ayuda {
  max-width: 36ch;
  color: var(--tinta-suave);
  font-size: 0.98rem;
  line-height: 1.45;
}

.paso__nota {
  color: var(--tinta-suave);
  font-size: 0.8rem;
  font-weight: 600;
}

.paso__pie {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding: 12px 0 calc(6px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--cal) 72%, rgba(245, 243, 238, 0));
}

.paso__pie[hidden] {
  display: none;
}

.boton:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.aparece {
  animation: fadeInUp 0.6s var(--ease) both;
}

/* ---------- opções ---------- */
.opciones {
  display: grid;
  gap: 10px;
}

.opcion {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 8px 14px 8px 10px;
  border: 2px solid rgba(27, 32, 20, 0.08);
  border-radius: 18px;
  background: var(--blanco);
  box-shadow: 0 1px 2px rgba(27, 32, 20, 0.06);
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  animation: fadeInUp 0.45s var(--ease) both;
  transition:
    border-color 0.2s,
    background 0.2s,
    transform 0.15s var(--ease);
}

.opcion:hover {
  border-color: rgba(27, 32, 20, 0.22);
}

.opcion:active {
  transform: scale(0.98);
}

.opcion[aria-checked='true'] {
  border-color: var(--noche);
  background: #fffbef;
}

.opcion__emoji {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--hoja-claro);
  font-size: 1.2rem;
  line-height: 1;
}

.opcion__texto {
  flex: 1;
}

.opcion__marca {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border: 2px solid rgba(27, 32, 20, 0.22);
  border-radius: 50%;
  background: var(--blanco);
  transition:
    background 0.2s,
    border-color 0.2s;
}

.opcion[role='checkbox'] .opcion__marca {
  border-radius: 8px;
}

.opcion__marca svg {
  width: 14px;
  height: 14px;
  color: var(--noche);
  transform: scale(0);
  transition: transform 0.25s cubic-bezier(0.12, 0.4, 0.29, 1.46);
}

.opcion[aria-checked='true'] .opcion__marca {
  border-color: var(--azafran);
  background: var(--azafran);
}

.opcion[aria-checked='true'] .opcion__marca svg {
  transform: scale(1);
}

/* rejilla: cartões em 2 ou 3 colunas, emoji (ou foto, mais abaixo) em cima e texto embaixo */
.opciones--rejilla {
  grid-template-columns: 1fr 1fr;
}

.opciones--rejilla3 {
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

/* a altura acompanha a tela para os cartões ocuparem o espaço sem empurrar o botão para fora */
.opciones--rejilla .opcion,
.opciones--rejilla3 .opcion {
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-height: clamp(108px, calc((100svh - 330px) / 2), 180px);
  padding: 14px 10px;
  text-align: center;
}

.opciones--rejilla3 .opcion {
  min-height: clamp(96px, calc((100svh - 400px) / 2), 150px);
  padding: 12px 6px;
  font-size: 0.9rem;
}

.opciones--rejilla .opcion__emoji,
.opciones--rejilla3 .opcion__emoji {
  width: 48px;
  height: 48px;
  font-size: 1.55rem;
}

.opciones--rejilla .opcion__texto,
.opciones--rejilla3 .opcion__texto {
  flex: none;
}

.opciones--rejilla .opcion__marca,
.opciones--rejilla3 .opcion__marca {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
}

/* idade: fotos da mesma personagem, 2 por fileira, altura presa à tela */
.opciones--edad {
  --fila: clamp(132px, calc((100svh - 330px) / 2), 250px);
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: var(--fila);
  gap: 10px;
}

.opciones--edad .opcion {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.opcion__foto {
  flex: 1;
  width: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: center 12%;
  transition: transform 0.4s var(--ease);
}

.opciones--edad .opcion__texto {
  flex: none;
  padding: 7px 4px 8px;
  text-align: center;
  font-family: var(--f-titulo);
  font-size: 1.02rem;
  font-weight: 700;
  transition: background 0.2s;
}

.opciones--edad .opcion__marca {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  background: rgba(255, 255, 255, 0.9);
}

.opciones--edad .opcion[aria-checked='true'] {
  border-color: var(--azafran);
}

.opciones--edad .opcion[aria-checked='true'] .opcion__texto {
  background: var(--azafran);
}

.opciones--edad .opcion[aria-checked='true'] .opcion__foto {
  transform: scale(1.05);
}

/* rejilla com fotos: a foto ocupa o cartão e o texto fica numa faixa de duas linhas embaixo,
   para as fotos de uma mesma fileira ficarem do mesmo tamanho */
.opciones--rejilla.opciones--fotos {
  --fila: clamp(124px, calc((100svh - 212px) / 2), 236px);
}

.opciones--rejilla3.opciones--fotos {
  --fila: clamp(110px, calc((100svh - 316px) / 2), 180px);
}

.opciones--fotos {
  grid-auto-rows: var(--fila);
}

.opciones--fotos .opcion {
  justify-content: flex-start;
  align-items: stretch;
  gap: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.opciones--fotos .opcion__foto {
  object-position: center 55%;
}

.opciones--fotos .opcion__texto {
  display: grid;
  place-items: center;
  flex: none;
  min-height: calc(2.3em + 10px);
  padding: 5px 6px;
  line-height: 1.15;
  transition: background 0.2s;
}

.opciones--rejilla3.opciones--fotos .opcion__texto {
  font-size: 0.86rem;
}

.opciones--fotos .opcion__marca {
  background: rgba(255, 255, 255, 0.9);
}

.opciones--fotos .opcion[aria-checked='true'] {
  border-color: var(--azafran);
}

.opciones--fotos .opcion[aria-checked='true'] .opcion__texto {
  background: var(--azafran);
}

.opciones--fotos .opcion[aria-checked='true'] .opcion__foto {
  transform: scale(1.05);
}

/* ---------- eco da idade e "como funciona" ---------- */
.eco__foto,
.como__foto {
  align-self: center;
  margin: 2px 0 0;
  overflow: hidden;
  box-shadow: var(--sombra);
}

.eco__foto {
  height: clamp(170px, 36svh, 320px);
  aspect-ratio: 4 / 5;
  border-radius: 24px;
}

.como__foto {
  height: clamp(96px, 18svh, 150px);
  aspect-ratio: 1;
  border: 4px solid var(--azafran);
  border-radius: 50%;
}

.eco__foto img,
.como__foto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 14%;
}

/* a foto de perfil dela: o rosto costuma estar no meio */
.como__foto--propia img {
  object-position: center;
}
.como__pasos {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.como__pasos li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--blanco);
  animation: fadeInUp 0.5s var(--ease) both;
}

.como__emoji {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--hoja-claro);
  font-size: 1.25rem;
}

.como__pasos strong,
.previa strong {
  display: block;
  font-family: var(--f-titulo);
  font-size: 1.02rem;
  line-height: 1.2;
}

.como__pasos small,
.previa small {
  display: block;
  margin-top: 2px;
  color: var(--tinta-suave);
  font-size: 0.86rem;
  line-height: 1.35;
}

/* ---------- nome ---------- */
.nombre {
  display: grid;
  gap: 12px;
}

.nombre input {
  width: 100%;
  height: 60px;
  padding: 0 20px;
  border: 2px solid rgba(27, 32, 20, 0.16);
  border-radius: 18px;
  background: var(--blanco);
  color: var(--tinta);
  text-align: center;
  font: 600 1.2rem var(--f-texto);
}

.nombre input:focus {
  outline: none;
  border-color: var(--noche);
}

/* foto de perfil (opcional): círculo com câmera que vira a foto dela */
.retrato {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 2px dashed rgba(27, 32, 20, 0.22);
  border-radius: 18px;
  background: var(--blanco);
  text-align: left;
  cursor: pointer;
}

.retrato:hover,
.retrato:focus-within {
  border-color: var(--noche);
}

.retrato__circulo {
  display: grid;
  flex: none;
  place-items: center;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border: 3px solid var(--azafran);
  border-radius: 50%;
  background: var(--cal);
  color: var(--tinta);
}

.retrato__circulo svg {
  width: 28px;
  height: 28px;
}

.retrato__circulo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.retrato__texto {
  display: grid;
  gap: 2px;
}

.retrato__texto strong {
  font-size: 1.02rem;
}

.retrato__texto small {
  color: var(--tinta-suave);
  font-size: 0.86rem;
}

.nombre__saltar {
  justify-self: center;
  padding: 8px;
  border: 0;
  background: none;
  color: var(--tinta-suave);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- prévia das receitas ---------- */
.previa {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.previa__receta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 8px 8px;
  border-radius: 18px;
  background: var(--blanco);
  animation: fadeInUp 0.5s var(--ease) both;
}

.previa__receta img {
  flex: none;
  width: 66px;
  height: 66px;
  border-radius: 14px;
  object-fit: cover;
}

.previa__receta > span:nth-child(2) {
  flex: 1;
}

.previa__ok {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--azafran);
}

.previa__ok svg {
  width: 15px;
  height: 15px;
}

/* ---------- carregando o plano ---------- */
.paso--cargando {
  justify-content: center;
}

.anillo {
  position: relative;
  align-self: center;
  width: 132px;
  height: 132px;
}

.anillo svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.anillo circle {
  fill: none;
  stroke-width: 10;
}

.anillo__pista {
  stroke: rgba(27, 32, 20, 0.1);
}

.anillo__valor {
  stroke: var(--azafran);
  stroke-linecap: round;
  stroke-dasharray: 327;
  stroke-dashoffset: 327;
}

.anillo__pct {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--f-titulo);
  font-size: 1.8rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* com a foto dela dentro do anel, a porcentagem desce para uma etiqueta embaixo */
.anillo__retrato {
  position: absolute;
  inset: 15px;
  width: calc(100% - 30px);
  height: calc(100% - 30px);
  border-radius: 50%;
  object-fit: cover;
}

.anillo--retrato .anillo__pct {
  inset: auto 50% -12px auto;
  translate: 50% 0;
  padding: 2px 12px;
  border-radius: 999px;
  background: var(--noche);
  color: var(--azafran);
  font-size: 1rem;
}

.cargando__pasos {
  display: grid;
  gap: 12px;
  align-self: center;
  width: 100%;
  max-width: 340px;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
  font-weight: 600;
}

.cargando__pasos li {
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0.35;
  transition: opacity 0.4s;
}

.cargando__pasos li.hecho {
  opacity: 1;
}

.cargando__ok {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border: 2px solid rgba(27, 32, 20, 0.25);
  border-radius: 50%;
}

.cargando__ok svg {
  width: 15px;
  height: 15px;
  color: var(--noche);
  transform: scale(0);
  transition: transform 0.3s cubic-bezier(0.12, 0.4, 0.29, 1.46);
}

.hecho .cargando__ok {
  border-color: var(--azafran);
  background: var(--azafran);
}

.hecho .cargando__ok svg {
  transform: scale(1);
}

.paso--cargando .paso__pie {
  margin-top: 8px;
}

.cargando-datos {
  padding: 40px var(--gutter);
}

/* celular pequeno (iPhone SE dentro do Instagram): tudo um pouco mais compacto */
@media (max-height: 640px) {
  .paso {
    gap: 12px;
    padding-top: 10px;
  }

  .paso__cabeza {
    gap: 6px;
  }

  .opcion {
    min-height: 50px;
  }

  .opcion__emoji {
    width: 32px;
    height: 32px;
    font-size: 1.05rem;
  }

  .opciones {
    gap: 8px;
  }
}
