/* Visual IGUAL ao do formulario original (decisao do dono, 22/10), medido na copia de teste: Lato 400, pergunta #263238,
   resposta/botao #2979FF, fundo branco, uma pergunta por tela centralizada na altura, botao "Avancar" pequeno a esquerda,
   cartoes com letra, etiqueta vermelha de erro, barra fina no topo, setas laterais. Sem a marca dele.
   Cores chegam por variaveis CSS definidas via CSSOM pelo app.js a partir do schema (CSP sem style inline).
   Lato e servida daqui (SIL OFL), nao do Google Fonts. */
@font-face { font-family: "Lato"; font-style: normal; font-weight: 400; font-display: swap; src: url(/static/lato-400.woff2) format("woff2"); }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 700; font-display: swap; src: url(/static/lato-700.woff2) format("woff2"); }

:root {
  --cor-botao: #2979ff;
  --cor-texto: #263238;
  --cor-fundo: #ffffff;
  --azul-claro: color-mix(in srgb, var(--cor-botao) 12%, var(--cor-fundo));
  --azul-suave: color-mix(in srgb, var(--cor-botao) 45%, var(--cor-fundo));
  --erro: #ff1744;
  --fonte: "Lato", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--cor-fundo); color: var(--cor-texto);
  font: 400 16px/1.5 var(--fonte);
}
/* barra fina azul no topo, SEM trilho cinza */
.progresso { position: fixed; top: 0; left: 0; right: 0; z-index: 5; height: 4px; pointer-events: none; }
#barra { height: 100%; width: 0; background: var(--cor-botao); transition: width .3s ease; }

/* a pergunta fica centralizada na altura da tela (a tela cresce e rola quando o conteudo e maior, como a abertura) */
main {
  flex: 1; width: 100%; max-width: 732px; margin: 0 auto; outline: none;
  padding: 40px 16px 96px; display: flex; flex-direction: column; justify-content: center;
}
.carregando { opacity: .7; padding: 40px 0; }

.tela { width: 100%; }
/* transicao: slide vertical suave entre perguntas (para frente sobe, para tras desce) */
@keyframes sobe { from { opacity: 0; transform: translateY(44px); } to { opacity: 1; transform: none; } }
@keyframes desce { from { opacity: 0; transform: translateY(-44px); } to { opacity: 1; transform: none; } }
.entra-frente { animation: sobe .4s cubic-bezier(.22, .8, .3, 1); }
.entra-tras { animation: desce .4s cubic-bezier(.22, .8, .3, 1); }
@media (prefers-reduced-motion: reduce) { .entra-frente, .entra-tras { animation: none; } #barra { transition: none; } }

h1.titulo { font-size: 1.5rem; line-height: 1.3; margin: 0 0 14px; color: var(--cor-texto); font-weight: 400; }
.descricao { white-space: pre-wrap; margin: 0 0 18px; line-height: 1.55; font-weight: 400; }
h1.titulo-grande { font-size: 1.9rem; }
#titulo:focus { outline: none; }

/* Abertura: titulo grande, texto, video LARGO abaixo do texto (celular e computador), botao pequeno abaixo do video */
h1.titulo-boasvindas { font-size: clamp(1.9rem, 6.4vw, 2.15rem); line-height: 1.2; margin: 0 0 18px; }
.tela-boas-vindas .descricao { font-size: 1rem; margin-bottom: 14px; }
.video { aspect-ratio: 9 / 16; width: 100%; max-width: 350px; margin: 4px 0 22px; background: #202124; border-radius: 8px; overflow: hidden; }
.video iframe { width: 100%; height: 100%; border: 0; display: block; }
@media (max-width: 899px) { .video { max-width: none; } }

/* campos: linha sublinhada, texto digitado em azul */
input[type=text], input[type=email], input[type=tel], textarea, select {
  width: 100%; font: inherit; font-size: 1.3rem; font-weight: 400;
  padding: 8px 0; color: var(--cor-botao); background: transparent;
  border: 0; border-bottom: 1px solid var(--azul-suave); border-radius: 0; outline: none;
}
input::placeholder, textarea::placeholder { color: var(--azul-suave); opacity: 1; }
input:focus, textarea:focus, select:focus { border-bottom-color: var(--cor-botao); }
textarea { display: block; resize: none; overflow: hidden; min-height: 2.4em; line-height: 1.35; }
select { appearance: none; -webkit-appearance: none; border-radius: 0; cursor: pointer; }
select:invalid, select option[value=""] { color: var(--azul-suave); }
.dica-quebra { font-size: .75rem; color: var(--azul-suave); margin: 8px 0 0; }
.dica-quebra b { font-weight: 700; }
.dica-multi { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--azul-suave); margin: -4px 0 12px; }
.icone { flex: none; }

/* WhatsApp: bandeira + ( 00 ) + 00000-0000 numa linha so */
.tel { display: flex; align-items: center; gap: 6px; max-width: 300px; border-bottom: 1px solid var(--azul-suave); padding: 4px 0; }
.tel:focus-within { border-bottom-color: var(--cor-botao); }
.tel .bandeira { flex: none; margin: 0 14px 0 4px; border-radius: 2px; }
.tel .par { color: var(--azul-suave); font-size: 1.3rem; }
.tel input { border: 0; padding: 4px 2px; font-size: 1.3rem; min-width: 0; }
.tel #ddd { width: 2.3em; text-align: center; border-radius: 4px; }
.tel #ddd:focus { background: var(--azul-claro); }
.tel #tel { flex: 1; }

/* escolha: cartoes com letra */
.opcoes { display: grid; gap: 10px; margin: 8px 0 0; padding: 0; border: 0; }
.opcao { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 12px; cursor: pointer;
  border: 1px solid var(--cor-botao); border-radius: 4px; background: var(--cor-fundo); color: var(--cor-botao); font-size: 1.2rem; line-height: 1.3; }
.opcao input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.letra { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: color-mix(in srgb, var(--cor-botao) 16%, var(--cor-fundo)); color: var(--cor-botao); font-size: .65rem; font-weight: 400; }
.opcao.multipla { font-size: 1.1rem; }
.opcao.multipla .letra { border-radius: 4px; }
.opcao:hover { background: color-mix(in srgb, var(--cor-botao) 5%, var(--cor-fundo)); }
.opcao.marcada { background: var(--azul-claro); font-weight: 700; }
.opcao.marcada .letra { background: var(--cor-botao); color: #fff; font-weight: 700; }
.opcao:focus-within { outline: 2px solid color-mix(in srgb, var(--cor-botao) 40%, transparent); outline-offset: 1px; }

/* botao principal pequeno a esquerda; "Voltar" nosso, discreto, junto */
.acoes { display: flex; gap: 14px; align-items: center; margin-top: 16px; }
.acoes-centro { justify-content: center; }
button { font: inherit; cursor: pointer; }
.primario { display: inline-flex; align-items: center; justify-content: center; height: 34px; padding: 0 20px; min-width: 97px; background: var(--cor-botao); color: #fff;
  border: 0; border-radius: 4px; font-weight: 400; font-size: 1rem; line-height: 1; box-shadow: 0 1px 3px rgba(38, 50, 56, .25); }
.primario:hover:not([disabled]) { filter: brightness(.94); }
.primario[disabled] { opacity: .5; cursor: progress; }
.voltar { background: transparent; border: 0; padding: 0 4px; height: 34px; color: var(--cor-texto); opacity: .55; font-size: .85rem; text-decoration: underline; }
.voltar:hover { opacity: .9; }

/* setas: celular = bloco azul arredondado embaixo a direita; computador = duas setas escuras soltas, meio da altura, lateral direita */
.setas { position: fixed; right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); z-index: 4; display: flex; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 8px rgba(38, 50, 56, .25); }
.setas[hidden] { display: none; }
.setas button { width: 47px; height: 44px; border: 0; background: var(--cor-botao); color: #fff; font-size: 1.3rem; line-height: 1; padding: 0; }
.setas button:hover:not([disabled]) { filter: brightness(.92); }
.setas button[disabled] { opacity: .45; cursor: default; }
.setas button:focus-visible { outline: 3px solid color-mix(in srgb, var(--cor-botao) 45%, #fff); outline-offset: -3px; }
@media (min-width: 900px) {
  .setas { top: 50%; bottom: auto; right: 22px; transform: translateY(-50%); flex-direction: column; gap: 4px; background: none; box-shadow: none; border-radius: 0; overflow: visible; }
  .setas button { width: 36px; height: 36px; background: transparent; color: var(--cor-texto); font-size: 1.5rem; border-radius: 6px; }
  .setas button:hover:not([disabled]) { filter: none; background: color-mix(in srgb, var(--cor-texto) 8%, transparent); }
  .setas button[disabled] { opacity: .3; }
  main { padding: 40px 24px; }
}

/* erro: etiqueta vermelha com texto branco */
.erro { display: inline-block; margin: 8px 0 0; padding: 3px 8px; background: var(--erro); color: #fff; font-size: .78rem; line-height: 1.3; border-radius: 4px; font-weight: 400; }
.erro:empty { display: none; }

/* CEP */
.linha-cep { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px 18px; }
.linha-cep .f { flex: 0 1 200px; min-width: 150px; }
.nao-sei { display: inline-flex; align-items: center; gap: 4px; padding-bottom: 10px; color: #607d8b; font-size: .8rem; text-decoration: none; }
.nao-sei:hover { text-decoration: underline; }
.resto { margin-top: 22px; }
.resto[hidden] { display: none; }
.f { position: relative; min-width: 0; }
.f .mini { display: block; min-height: 1em; font-size: .7rem; line-height: 1; color: var(--cor-botao); visibility: hidden; }
.f.cheio .mini { visibility: visible; }
.resto input, .resto select { font-size: 1.1rem; padding: 4px 0 6px; }
.linha-cidade { display: grid; grid-template-columns: 1fr 112px; gap: 16px; }
.linha-cidade > :nth-child(3) { grid-column: 1 / -1; }
.painel-rua { margin-top: 18px; padding: 14px 16px 18px; background: var(--azul-claro); border-radius: 4px; display: grid; gap: 14px; }

/* upload */
.chips { display: grid; gap: 8px; margin: 4px 0 8px; }
.chip-linha { display: flex; gap: 8px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 16px; max-width: calc(100% - 50px); background: var(--cor-botao); color: #fff; border-radius: 4px; font-size: 1rem; box-shadow: 0 1px 3px rgba(38, 50, 56, .25); }
.chip-enviando { opacity: .6; }
.chip-nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lixeira { display: inline-grid; place-items: center; width: 40px; height: 34px; padding: 0; background: var(--cor-fundo); color: var(--cor-botao); border: 1px solid var(--cor-botao); border-radius: 4px; box-shadow: 0 1px 3px rgba(38, 50, 56, .2); }
.envio { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; color: var(--cor-botao); background: var(--cor-fundo); border: 1px solid var(--cor-botao); border-radius: 4px; font-size: 1rem; cursor: pointer; }
.envio[hidden] { display: none; }
.envio input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.envio:focus-within { outline: 2px solid color-mix(in srgb, var(--cor-botao) 40%, transparent); outline-offset: 2px; }

/* obrigado final: aviaozinho de papel escuro + texto centralizado escuro */
.fim { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 24px 0; color: var(--cor-texto); }
.aviao { color: var(--cor-texto); margin-bottom: 14px; }
.titulo-fim { font-size: 1.5rem; line-height: 1.3; font-weight: 400; margin: 0; max-width: 620px; color: var(--cor-texto); }
.descricao-fim { margin: 10px 0 0; max-width: 620px; white-space: pre-wrap; }

/* faixa de ambiente de teste: uma linha no pe da pagina, nunca por cima de botao */
.rodape { padding: 8px 132px 8px 16px; font-size: .72rem; opacity: .75; background: #eceff1; }
.rodape strong { font-weight: 700; }

@media (max-width: 480px) {
  h1.titulo:not(.titulo-boasvindas):not(.titulo-grande) { font-size: 1.5rem; }
}
