@font-face {
  font-family: "Lora";
  src: url("fontes/lora-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("fontes/nunito-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --fundo: #FBF7F2;
  --texto: #2E2236;
  --acao: #7A2E5C;
  --acao-pressionado: #6A254F;
  --acao-enchendo: #4F1A3B;
  --acao-apagado: #D8C2CF;
  --superficie: #FFFFFF;
  --borda: #E8DFD6;
  --borda-forte: #D5C8BC;
  --apoio: #6B5A70;
  --trilho: #EDE4DB;
  --destaque: #F4E9EF;
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --lateral: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow-wrap: break-word;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0 var(--lateral);
}

main { flex: 1; display: flex; flex-direction: column; }

h1, h2, h3, p, ul { margin: 0; }
[tabindex="-1"]:focus { outline: none; }
button { font: inherit; color: inherit; }

/* ---------- Topo: voltar e barra ---------- */

.topo {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding-top: env(safe-area-inset-top);
}

.voltar {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  margin-left: -6px;
  padding: 0 8px 0 2px;
  border: 0;
  border-radius: 12px;
  background: none;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.voltar svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.barra {
  flex: 1;
  height: 6px;
  border-radius: 99px;
  background: var(--trilho);
  overflow: hidden;
}
.barra span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--acao);
  transition: width .4s cubic-bezier(.2, .8, .2, 1);
}

/* ---------- Telas ---------- */

.tela {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
}

.chamada {
  margin-top: 18px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--acao);
}

.pergunta {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.22;
  font-weight: 700;
  margin: 22px 0 20px;
  text-wrap: balance;
}

.dica {
  margin: -10px 0 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--apoio);
}

/* ---------- Opções ---------- */

.opcoes { display: flex; flex-direction: column; gap: 12px; }

.opcao {
  appearance: none;
  width: 100%;
  min-height: 62px;
  padding: 14px 16px 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--texto);
  background: var(--superficie);
  border: 1.5px solid var(--borda);
  border-radius: 18px;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease, transform .1s ease;
}
.opcao:active { transform: scale(.98); }
.opcao[aria-pressed="true"] {
  background: var(--acao);
  border-color: var(--acao);
  color: #fff;
}

/* Quadradinho das perguntas de marcar várias */
.caixa {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 2px solid var(--borda-forte);
  background: #fff;
  display: grid;
  place-items: center;
}
.caixa svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--acao);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}
.opcao[aria-pressed="true"] .caixa {
  border-color: #fff;
  animation: pulinho .3s cubic-bezier(.3, 1.6, .5, 1);
}
.opcao[aria-pressed="true"] .caixa svg { opacity: 1; }

@keyframes pulinho {
  from { transform: scale(.5); }
  to { transform: scale(1); }
}

/* ---------- Botão principal e pé fixo ---------- */

.botao {
  appearance: none;
  width: 100%;
  min-height: 60px;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.25;
  color: #fff;
  text-decoration: none;
  background: var(--acao);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 10px 20px -10px rgba(122, 46, 92, .55);
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color .15s ease, box-shadow .15s ease, transform .12s ease;
}
.botao:active { transform: scale(.98); background-color: var(--acao-pressionado); }

/* "Continuar": ao tocar, enche da esquerda pra direita e só então avança (tempo igual ao quiz.js) */
.continuar {
  background-image: linear-gradient(var(--acao-enchendo), var(--acao-enchendo));
  background-repeat: no-repeat;
  background-size: 0% 100%;
}
.continuar.enchendo {
  background-size: 100% 100%;
  transition: background-size .3s ease-out;
}
.botao[aria-disabled="true"] {
  background: var(--acao-apagado);
  box-shadow: none;
  cursor: default;
  transform: none;
}

/* Telas com "Continuar" sempre visível no pé */
.tela-multipla, .tela[data-tipo="info"] { padding-bottom: 0; }
.pe {
  position: sticky;
  bottom: 0;
  margin: auto calc(var(--lateral) * -1) 0;
  padding: 22px var(--lateral) calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, rgba(251, 247, 242, 0), var(--fundo) 32%);
}

.opcao:focus-visible,
.botao:focus-visible,
.voltar:focus-visible {
  outline: 3px solid var(--texto);
  outline-offset: 3px;
}

@media (hover: hover) {
  .opcao:not([aria-pressed="true"]):hover { border-color: var(--borda-forte); }
  .botao:not([aria-disabled="true"]):hover { background-color: var(--acao-pressionado); }
}

/* ---------- Telas A, B e C ---------- */

.info { padding-top: 26px; }
.info .grande {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.25;
  font-weight: 700;
  text-wrap: balance;
}
.info [data-campo="resto"] p { margin-top: 14px; }
.info .grande + [data-campo="resto"] p:first-child { margin-top: 16px; }

/* ---------- Tela D ---------- */

.carregando {
  flex: 1;
  list-style: none;
  padding: 0 0 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
}
.linha {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  animation: aparece .35s ease-out;
}
.linha .ok {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--acao);
}
.linha .ok svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #fff;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.linha.esperando { color: var(--apoio); font-weight: 600; }
.linha.esperando .ok {
  background: none;
  border: 2.5px solid var(--borda-forte);
  border-top-color: var(--acao);
  animation: gira .8s linear infinite;
}
.linha.esperando .ok svg { display: none; }
.linha.feita .ok { animation: pulinho .3s cubic-bezier(.3, 1.6, .5, 1); }

@keyframes aparece { from { opacity: 0; transform: translateY(6px); } }
@keyframes gira { to { transform: rotate(360deg); } }

/* ---------- Tela E ---------- */

.tela-resultado { padding-top: calc(28px + env(safe-area-inset-top)); }

.titulo-resultado {
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
  margin-bottom: 14px;
}

.fase {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.4;
  background: var(--destaque);
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 18px;
}

.hormonios {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.35;
  margin: 6px 0 14px;
}

.ajuda { margin-bottom: 28px; }

.receber h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
}
.receber ul {
  list-style: none;
  padding: 0;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.receber li {
  position: relative;
  padding-left: 36px;
}
.receber li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--destaque) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%237A2E5C' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 13px no-repeat;
}

.preco {
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  color: var(--apoio);
  margin-bottom: 12px;
}

.aviso {
  margin-top: 36px;
  text-align: center;
  font-size: 13px;
  line-height: 1.45;
  color: var(--apoio);
}

/* ---------- Troca de tela ---------- */

/* Fade + deslize curto: 90ms saindo + 150ms entrando (tempos iguais ao quiz.js) */
.tela.saindo { animation: sai .09s ease-in forwards; }
.tela.saindo.voltando { animation-name: sai-voltando; }
.tela.entrando { animation: entra .15s ease-out; }
.tela.entrando.voltando { animation-name: entra-voltando; }

@keyframes sai { to { opacity: 0; transform: translateX(-16px); } }
@keyframes sai-voltando { to { opacity: 0; transform: translateX(16px); } }
@keyframes entra { from { opacity: 0; transform: translateX(16px); } }
@keyframes entra-voltando { from { opacity: 0; transform: translateX(-16px); } }

@media (prefers-reduced-motion: reduce) {
  .tela.saindo, .tela.entrando, .linha, .linha.feita .ok, .opcao[aria-pressed="true"] .caixa { animation: none; }
  .barra span, .opcao, .botao, .continuar.enchendo { transition: none; }
  .opcao:active, .botao:active { transform: none; }
}

/* ---------- Celular com tela baixa ---------- */

@media (max-height: 640px) {
  body { font-size: 17px; }
  .chamada { margin-top: 12px; font-size: 16px; }
  .pergunta { font-size: 23px; margin: 16px 0 16px; }
  .opcoes { gap: 10px; }
  .info .grande { font-size: 24px; }
}

/* ---------- Computador ---------- */

@media (min-width: 640px) {
  .pergunta { margin-top: 36px; }
  .info { padding-top: 40px; }
}
