:root {
  --azul: #0a5fe0;
  --azul-escuro: #0b2a7a;
  --azul-claro: #e8f1ff;
  --fundo: #f4f8ff;
  --texto: #14244a;
  --texto-suave: #5a6b8c;
  --borda: #c9d8f2;
  --erro: #c62828;
  --ok: #12925a;
  --raio: 16px;
}

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

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.4;
  color: var(--texto);
  background: var(--fundo);
  min-height: 100dvh;
}

.topo {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 10px) 12px 10px;
  background: linear-gradient(135deg, var(--azul), var(--azul-escuro));
  color: #fff;
}
.topo-titulo { flex: 1; font-weight: 700; font-size: 18px; text-align: center; }
.topo-btn {
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center;
}
.topo-btn svg { width: 22px; height: 22px; }
.topo-btn[hidden] + .topo-titulo { padding-left: 52px; }

.passos {
  display: flex; gap: 6px; list-style: none; margin: 0; padding: 12px 16px 0;
  max-width: 560px; margin-inline: auto;
}
.passos li {
  flex: 1; text-align: center; font-size: 12px; font-weight: 600; color: var(--texto-suave);
  padding-top: 8px; border-top: 4px solid var(--borda); border-radius: 2px;
}
.passos li.feito { border-color: var(--azul); color: var(--azul); }
.passos li.atual { border-color: var(--azul-escuro); color: var(--azul-escuro); }

main { max-width: 560px; margin: 0 auto; padding: 16px 16px calc(env(safe-area-inset-bottom) + 32px); }

/* Mascote */
/* Cartão: o corpo do mascote encosta na borda de baixo, como se estivesse atrás de um balcão. */
.mascote {
  position: relative; display: flex; align-items: flex-end; gap: 10px; margin-bottom: 18px;
  padding: 12px 12px 0; background: #fff; border: 1px solid var(--borda); border-radius: var(--raio);
  overflow: hidden; box-shadow: 0 4px 14px rgba(11,42,122,.08);
}
/* "Balcão": faixa na base que cobre o corte do corpo. */
.mascote::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 10px; z-index: 2;
  background: linear-gradient(var(--azul), var(--azul-escuro));
}
.mascote-fig { position: relative; flex: none; width: 116px; height: 116px; margin-bottom: 4px; }
.mascote img { display: block; width: 116px; height: 116px; object-fit: contain; }
/* Vídeo idle: fundo branco "some" no fundo da página com multiply. */
.mascote video {
  position: absolute; inset: 0; width: 116px; height: 116px; object-fit: contain;
  mix-blend-mode: multiply; opacity: 0; transition: opacity .3s; pointer-events: none;
}
.mascote.falando #mascoteFala, .mascote.idle #mascoteIdle, .mascote.comemora #mascoteJoinha { opacity: 1; }
.mascote.falando img, .mascote.idle img, .mascote.comemora img { opacity: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.balao {
  position: relative; flex: 1; margin: 0 0 24px; padding: 12px 14px;
  background: var(--azul-claro); border: 2px solid var(--azul); border-radius: 18px 18px 18px 4px;
  font-weight: 600;
}

/* Botões */
.btn {
  display: block; width: 100%; min-height: 54px; margin-top: 12px; padding: 12px 18px;
  border-radius: 999px; border: 2px solid transparent; font: inherit; font-weight: 700; cursor: pointer;
}
.btn.primario { background: var(--azul); color: #fff; box-shadow: 0 6px 16px rgba(10,95,224,.3); }
.btn.primario:active { background: var(--azul-escuro); }
.btn.secundario { background: #fff; color: var(--azul); border-color: var(--azul); }
.btn:disabled { opacity: .45; box-shadow: none; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--azul); font: inherit; font-weight: 700; padding: 10px 0; text-decoration: underline; }

/* Início */
.resumo { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.resumo li {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  background: #fff; border-radius: var(--raio); border: 1px solid var(--borda); font-weight: 600;
}
.resumo span {
  flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--azul); color: #fff; font-weight: 800;
}
.selo {
  display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 4px; padding: 12px;
  background: var(--azul-claro); border-radius: 12px; font-size: 14px; color: var(--azul-escuro);
}
.selo svg { flex: none; width: 20px; height: 20px; margin-top: 1px; }

.aviso {
  margin: 12px 0 0; padding: 12px; border-radius: 12px; font-size: 15px;
  background: #fdecea; color: var(--erro); border: 1px solid #f5c6c2;
}
.centro { text-align: center; }
.dica { display: block; color: var(--texto-suave); font-size: 13px; margin-top: 4px; }

/* Foto */
.foto-area {
  aspect-ratio: 3 / 4; max-height: 40dvh; width: 100%; margin: 0 auto;
  border: 3px dashed var(--azul); border-radius: var(--raio); background: #fff;
  display: grid; place-items: center; overflow: hidden;
}
.foto-area.tem-foto { border-style: solid; background: #0d1830; }
.foto-area { position: relative; }
.foto-area img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.foto-vazia { display: grid; justify-items: center; gap: 10px; padding: 20px; text-align: center; color: var(--texto-suave); }
.foto-vazia svg { width: 64px; height: 64px; color: var(--azul); }

/* Formulário */
.campo { display: block; margin: 0 0 14px; padding: 0; border: 0; min-width: 0; }
.campo > span, .campo > legend { display: block; font-weight: 700; font-size: 15px; margin-bottom: 6px; padding: 0; }
.campo b { color: var(--erro); }
.campo input, .campo select {
  width: 100%; min-height: 52px; padding: 10px 14px; font: inherit; color: var(--texto);
  background: #fff; border: 2px solid var(--borda); border-radius: 12px; appearance: none;
}
.campo select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%235a6b8c' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 20px; padding-right: 30px;
}
.campo input:focus, .campo select:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 3px rgba(10,95,224,.18); }
.campo input.invalido, .campo select.invalido { border-color: var(--erro); }
.campo input:disabled { background: #eef2f8; color: var(--texto-suave); }
.erro { display: block; color: var(--erro); font-size: 13px; font-weight: 600; margin-top: 4px; min-height: 0; }
.erro:empty { display: none; }
.linha { display: flex; gap: 10px; }
.cresce { flex: 1; }
.uf { flex: none; width: 96px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  min-height: 44px; padding: 8px 14px; border-radius: 999px; font: inherit; font-size: 15px; font-weight: 600;
  background: #fff; color: var(--texto); border: 2px solid var(--borda); cursor: pointer;
}
.chips button[aria-pressed="true"] { background: var(--azul); color: #fff; border-color: var(--azul); }

.check { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 14px; font-size: 15px; }
.check input { flex: none; width: 26px; height: 26px; margin: 0; accent-color: var(--azul); }

/* Revisar */
.cartao { background: #fff; border: 1px solid var(--borda); border-radius: var(--raio); padding: 14px; }
.miniatura { display: block; width: 100%; max-height: 180px; object-fit: contain; background: #0d1830; border-radius: 10px; margin-bottom: 10px; }
dl { margin: 0; }
dl div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--azul-claro); }
dt { color: var(--texto-suave); font-size: 14px; flex: none; }
dd { margin: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.destino { font-size: 14px; color: var(--texto-suave); overflow-wrap: anywhere; }

/* Enviado */
.sucesso { display: grid; place-items: center; margin: 10px 0; color: var(--ok); }
.sucesso svg { width: 96px; height: 96px; }

/* Sugestões de local */
.com-sugestoes { position: relative; }
.sugestoes {
  margin: 4px 0 0; padding: 4px; list-style: none;
  background: #fff; border: 2px solid var(--azul); border-radius: 12px; box-shadow: 0 8px 24px rgba(11,42,122,.18);
  max-height: 300px; overflow-y: auto;
}
.sugestoes button {
  display: block; width: 100%; text-align: left; padding: 10px 12px; min-height: 48px;
  background: none; border: 0; border-radius: 8px; font: inherit; color: var(--texto); cursor: pointer;
}
.sugestoes button:hover, .sugestoes button:focus { background: var(--azul-claro); }
.sugestoes b { display: block; font-size: 15px; color: var(--texto); }
.sugestoes small { display: block; font-size: 13px; color: var(--texto-suave); margin-top: 2px; }
.opcional { font-weight: 500; color: var(--texto-suave); }
