/* =============================================================================
   PROTOCOLO ANSIEDADE: estilo do funil (mobile-first)
   Ajustado a partir dos prints do InLead.
   ========================================================================== */

:root {
  --coluna: 448px;
  --altura-topo: 70px;        /* altura real do topo fixo (logo + barra) */
  --respiro-funil: 72px;      /* padding de cima + de baixo do .funil */
  --margem-lateral: 16px;     /* respiro lateral da coluna */

  --fundo: #FFFFFF;
  --texto: #1F2937;
  --titulo: #111111;
  --borda: #E5E7EB;
  --vermelho: #DC2626;

  --amarelo: #F9C41B;        /* botão Continuar */
  --amarelo-escuro: #D4A514; /* borda inferior 3D */
  --amarelo-capa: #FFB900;   /* botão da capa (medido) */
  --amarelo-capa-escuro: #C98F00;
  --trilho: #FFF6DB;
  --barra: #F9C41B;
  --trilho-loading: #E8E8E8;
  --marcador: #FFC20E;

  --verde: #16A34A;
  --verde-escuro: #0F7A35;

  --rosa: #FEE2E2;
  --rosa-borda: #FCA5A5;
  --bege: #FFF3DC;
  --bege-borda: #F8D9A0;
  --tag-azul: #E0F2FE;
  --tag-azul-texto: #075985;
  --tag-bege: #FFEDD5;
  --tag-bege-texto: #9A3412;
  --cartao-borda: #BAE6FD;           /* oferta normal (R$37): borda azul clara */

  --raio-botao: 16px;
  --raio-opcao: 14px;
  --sombra: 0 2px 8px rgba(17, 24, 39, .12);
}

*, *::before, *::after { box-sizing: border-box; }

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

/* Sem o flash cinza do sistema ao tocar (Android/iOS); o retorno visual é a borda amarela */
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

:focus-visible { outline: 3px solid var(--titulo); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }

/* ---- Topo fixo --------------------------------------------------------------- */

.topo {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--fundo);
  padding: 10px 16px 8px;
}

.topo__interno {
  max-width: var(--coluna);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.topo__logo { height: 32px; width: auto; }

.progresso {
  width: 100%;
  height: 8px;
  background: var(--trilho);
  border-radius: 999px;
  overflow: hidden;
}

.progresso__barra {
  height: 100%;
  width: 0;
  background: var(--barra);
  border-radius: inherit;
  transition: width .45s ease;
}

/* ---- Coluna e telas ---------------------------------------------------------- */

.funil {
  max-width: var(--coluna);
  margin: 0 auto;
  padding: 24px var(--margem-lateral) 48px;
}

.tela {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: entrar .28s ease both;
}

.tela[hidden] { display: none; }

/* Perguntas e loadings ficam centralizados na altura da tela, como no original */
.tela--pergunta,
.tela--loading {
  min-height: calc(100vh - var(--altura-topo) - var(--respiro-funil));
  min-height: calc(100svh - var(--altura-topo) - var(--respiro-funil));
  justify-content: center;
}

@keyframes entrar {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ---- Tipografia -------------------------------------------------------------- */

.titulo {
  margin: 0;
  color: var(--titulo);
  font-size: 21px;
  line-height: 1.25;
  font-weight: 700;
  text-align: center;
  letter-spacing: -.01em;
}

#tela-capa .titulo { font-size: 26px; }

.titulo--pequeno { font-size: 16px; line-height: 1.5; }

.texto { margin: 0; text-align: center; }
.texto--esquerda { text-align: left; }
.texto--pequeno { font-size: 14px; }
.texto--aviso { color: var(--titulo); font-weight: 700; margin-top: 8px; }
.texto--ferida {
  align-self: center;          /* selo do tamanho do texto, centralizado */
  max-width: 100%;
  padding: 10px 22px;
  background: var(--trilho);
  border: 2px solid var(--barra);
  border-radius: 999px;
  color: var(--titulo);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
}

/* Na tela de resultado, o "ATENÇÃO" fica colado na frase de baixo */
.texto--aviso + .texto { margin-top: -10px; }

strong { color: var(--titulo); font-weight: 700; }
.titulo strong { font-weight: 900; }
strong.vermelho, .vermelho { color: var(--vermelho); font-weight: 700; }

mark {
  background: var(--marcador);
  color: var(--titulo);
  padding: 0 .15em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Placeholder visível: some sozinho quando o texto real é colado */
.ph {
  background: repeating-linear-gradient(45deg, #FFF7E0, #FFF7E0 6px, #FFF1C7 6px, #FFF1C7 12px);
  outline: 1px dashed #D4A017;
  color: #7A5A00;
  font-weight: 500;
  font-size: .85em;
  border-radius: 4px;
  padding: 0 .2em;
}

/* ---- Imagens ----------------------------------------------------------------- */

.imagem { width: 100%; border-radius: 12px; }

#tela-capa .imagem { max-width: 340px; margin: 0 auto; }

.imagem-vazia {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  border: 2px dashed #D4A017;
  border-radius: 12px;
  background: #FFFBEB;
}

/* ---- Botões ------------------------------------------------------------------ */

.botao {
  display: block;
  width: 100%;
  padding: 16px 20px;
  border: 0;
  border-bottom: 6px solid var(--amarelo-escuro);
  border-radius: var(--raio-botao);
  background: var(--amarelo);
  color: var(--titulo);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform .1s ease, filter .15s ease;
}

/* Hover só em aparelhos com mouse; no toque ele ficaria "preso" depois do clique */
@media (hover: hover) {
  .botao:hover { filter: brightness(1.04); }
  .opcao:hover:not(:disabled) { border-color: #FCD34D; }
}
.botao:active { transform: translateY(2px); }

/* Continuar sempre ao alcance: se o conteúdo da tela não couber, o botão fica preso
   no rodapé enquanto a pessoa rola. Quando cabe, fica no lugar de sempre. */
.tela--conteudo > button.botao {
  position: sticky;
  bottom: 10px;
  z-index: 5;
}
/* Acabamento só enquanto o botão está preso (classe posta pelo app.js): degradê
   branco em cima e faixa branca embaixo, cobrindo também a área do halo, para o
   texto que rola por trás não aparecer. O meio é transparente (não cobre o botão). */
.tela--conteudo > button.botao--preso::before {
  content: '';
  position: absolute;
  top: -30px;
  bottom: -26px;
  left: calc(-1 * var(--margem-lateral));
  right: calc(-1 * var(--margem-lateral));
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0), var(--fundo) 14px) top / 100% 30px no-repeat,
    linear-gradient(var(--fundo), var(--fundo)) bottom / 100% 20px no-repeat;
}
/* cobre as quinas fora do arredondamento (fica atrás do botão e abaixo do halo) */
.tela--conteudo > button.botao--preso { box-shadow: 0 0 0 14px var(--fundo); }
.botao strong, .botao .ph { color: inherit; }

/* Botão da capa: amarelo mais alaranjado e texto branco */
.botao--branco {
  background: var(--amarelo-capa);
  border-bottom-color: var(--amarelo-capa-escuro);
  color: #FFFFFF;
}

.botao--verde { background: var(--verde); border-bottom-color: var(--verde-escuro); color: #FFFFFF; }

/* Halo pulsante: camada própria (::after) desenhada acima do acabamento do ::before */
.botao--halo { position: relative; }
.botao--halo::after {
  content: '';
  position: absolute;
  inset: 0 0 -6px 0;          /* inclui a borda inferior 3D */
  border-radius: inherit;
  z-index: -1;
  pointer-events: none;
  animation: halo 1.6s ease-out infinite;
}

@keyframes halo {
  0%   { box-shadow: 0 0 0 0 rgba(255, 185, 0, .55); }
  70%  { box-shadow: 0 0 0 14px rgba(255, 185, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 185, 0, 0); }
}

/* ---- Opções das perguntas ---------------------------------------------------- */

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

.opcao {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 12px 14px;
  background: #FFFFFF;
  border: 1px solid var(--borda);
  border-radius: var(--raio-opcao);
  box-shadow: var(--sombra);
  color: var(--titulo);
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}

.opcao:disabled { cursor: default; }

/* "Botão apertado": afunda de leve enquanto o dedo está na opção */
.opcao:active:not(:disabled) { transform: scale(.97); }

.opcao__emoji { font-size: 28px; line-height: 1; flex: none; }

.opcao__radio {
  flex: none;
  width: 26px;
  height: 26px;
  border: 1px solid #D1D5DB;
  border-radius: 50%;
  background: #FFFFFF;
  position: relative;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.opcao__texto { flex: 1; }

.opcoes--centro .opcao__texto { text-align: center; padding-right: 38px; } /* compensa o círculo para centralizar */

.opcao--marcada {
  border-color: var(--amarelo-capa);
  box-shadow: 0 0 0 1px var(--amarelo-capa), var(--sombra);
  animation: opcao-pop .32s ease-out both;   /* solta com um "pop" suave */
}
.opcao--marcada .opcao__radio {
  border: 2px solid var(--amarelo-capa);
  background: var(--amarelo-capa);
  animation: radio-pop .3s ease-out both;
}
/* ✓ branco desenhado dentro do círculo */
.opcao--marcada .opcao__radio::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 45%;
  width: 27%;
  height: 50%;
  border: solid #FFFFFF;
  border-width: 0 2.5px 2.5px 0;
  transform: translate(-50%, -50%) rotate(45deg) scale(0);
  animation: check-in .22s .08s ease-out forwards;
}

@keyframes opcao-pop {
  0%   { transform: scale(.97); }
  55%  { transform: scale(1.025); }
  100% { transform: scale(1); }
}
@keyframes radio-pop {
  0%   { transform: scale(.6); }
  60%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}
@keyframes check-in {
  to { transform: translate(-50%, -50%) rotate(45deg) scale(1); }
}

/* ---- Listas e caixas --------------------------------------------------------- */

.lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.lista li { display: flex; gap: 8px; align-items: flex-start; }
.lista__icone { flex: none; }

.lista--negrito { color: var(--titulo); font-weight: 700; }

.lista--bege {
  background: var(--bege);
  border: 1px solid var(--bege-borda);
  border-radius: 14px;
  padding: 16px;
  font-size: 16px;
  line-height: 1.45;
}

.caixa { border-radius: 14px; padding: 16px 18px; text-align: center; }
.caixa--rosa {
  background: var(--rosa);
  border: 1px solid var(--rosa-borda);
  color: var(--texto);
  margin: 0 24px;
  line-height: 1.45;
}
.caixa--rosa strong { color: var(--titulo); font-weight: 800; }

/* ---- Oferta ------------------------------------------------------------------ */

.tag {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 12px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}
.tag--azul { background: var(--tag-azul); color: var(--tag-azul-texto); }
.tag--bege { background: var(--tag-bege); color: var(--tag-bege-texto); }
.tag strong { color: inherit; }
.tag > span:last-child { min-width: 0; overflow-wrap: anywhere; } /* texto sempre quebra dentro da caixa */

/* Cartão de cada plano: a etiqueta vira a faixa de título; a imagem vai de borda a
   borda (não encolhe); botão e nota ganham respiro lateral. Fundo branco; a borda
   colorida e a sombra separam cada oferta da página e uma da outra. */
.cartao {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 20px;
  padding-bottom: 18px;
  background: #FFFFFF;
  border: 2px solid var(--cartao-borda);
  border-radius: 20px;
  box-shadow: 0 4px 18px rgba(17, 24, 39, .08);
  overflow: hidden;
}
.cartao > .tag { margin: 0; border-radius: 0; padding: 12px 16px; }
.cartao > .imagem { border-radius: 0; }
.cartao > .botao,
.cartao > .texto { margin: 0 16px; width: auto; }

.cartao--destaque {
  border-color: var(--amarelo-capa);
  box-shadow: 0 6px 24px rgba(255, 185, 0, .25);
}

/* ---- Vídeo (VTurb) ----------------------------------------------------------- */
/* Com o embed colado, o próprio player define a proporção (quadrado, máx. 400 px). */

.video-slot {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
}

.video-slot--vazio {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  color: #FFFFFF;
  font-weight: 600;
}

/* O wrapper do VTurb limita a 400 px; no celular ocupa a largura toda. */
.video-slot [id$="_wrapper"] { border-radius: 14px; overflow: hidden; }

/* ---- Loadings ---------------------------------------------------------------- */

.tela--loading { gap: 10px; }

.loading__pct { margin: 0; text-align: right; color: var(--titulo); font-size: 15px; font-weight: 600; }

.loading__trilho {
  width: 100%;
  height: 12px;
  background: var(--trilho-loading);
  border-radius: 999px;
  overflow: hidden;
}

.loading__barra { height: 100%; width: 0; background: var(--barra); border-radius: inherit; }

.loading__texto { margin: 0; text-align: left; color: var(--titulo); }

.loading__itens { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.loading__item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 15px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .35s ease, transform .35s ease;
}

.loading__item--visivel { opacity: 1; transform: none; }
.loading__icone { flex: none; }

/* ---- Celulares estreitos (até 374 px: iPhone SE 1ª geração, Androids compactos) -- */
/* Do iPhone 14 (390 px) para cima nada aqui se aplica. */

@media (max-width: 374px) {
  :root { --margem-lateral: 14px; }
  .titulo { font-size: 20px; }
  #tela-capa .titulo { font-size: 23px; }

  .opcoes { gap: 8px; }
  .opcao { gap: 8px; min-height: 54px; padding: 10px 12px; font-size: 15px; line-height: 1.35; }
  .opcao__emoji { font-size: 24px; }
  .opcao__radio { width: 22px; height: 22px; }
  .opcoes--centro .opcao__texto { padding-right: 30px; } /* círculo 22 + espaço 8 */

  .caixa--rosa { margin: 0; padding: 14px; }
  .lista--bege { padding: 14px; font-size: 15px; line-height: 1.4; gap: 8px; }
  .texto--ferida { font-size: 18px; padding: 8px 18px; }
}

/* ---- Colagens de fotos (telas 4 e 12) em telas baixas -------------------------- */
/* Limita a altura mantendo a proporção, para o Continuar caber na tela. */

@media (max-height: 800px) {
  #tela-inflamacoes .imagem,
  #tela-explicacao .imagem { width: auto; max-width: 100%; max-height: 36svh; margin: 0 auto; }
}

@media (max-height: 700px) {
  #tela-inflamacoes .imagem,
  #tela-explicacao .imagem { max-height: 28svh; }
}

/* ---- Celulares baixos (até 700 px de altura: SE, 8, Androids 640) ------------- */

@media (max-height: 700px) {
  :root { --altura-topo: 60px; --respiro-funil: 48px; }
  .topo { padding: 8px 16px 6px; }
  .topo__interno { gap: 8px; }
  .topo__logo { height: 28px; }
  .funil { padding-top: 16px; padding-bottom: 32px; }
  .tela { gap: 12px; }
  .lista { gap: 10px; }
  .texto--aviso + .texto { margin-top: -8px; }
  /* vídeo quadrado: limita pela altura para o Continuar caber junto */
  .video-slot { max-width: min(100%, calc(100svh - 290px)); margin: 0 auto; }
}

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

@media (min-width: 768px) and (min-height: 701px) {
  :root { --altura-topo: 76px; --respiro-funil: 80px; }
  .topo { padding-top: 16px; }
  .funil { padding-top: 32px; }
}

/* ---- Movimento reduzido ------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .botao--halo::after { animation: none; box-shadow: 0 0 0 6px rgba(255, 185, 0, .22); }
}
