/* Quiz EnerSolar. Visual sóbrio, no padrão do site enersolar.eng.br:
   topo azul-marinho com a logo, tela branca, um azul para ação e as cores da logo só na barra de progresso. */

:root {
  --marinho: #0b1d3a;
  --azul: #1f4fa3;
  --azul-escuro: #183f84;
  --azul-claro: #edf2fa;
  --texto: #1b2433;
  --suave: #5a6473;
  --borda: #cfd6e0;
  --cinza: #f4f6f9;
  --verde: #1f7a1d;
  --verde-escuro: #19651a;
  --laranja: #f28b15;
  --erro: #b42318;
  --marca: linear-gradient(90deg, #36a78f, #a1a94b 30%, #f4a014 60%, #eb6221);
  --fonte: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: only light;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: #fff;
  color: var(--texto);
  font-family: var(--fonte);
  font-size: 16px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
p,
ul {
  margin: 0;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--laranja);
  outline-offset: 2px;
}

[tabindex='-1']:focus {
  outline: none;
}

/* ---------- topo e progresso ---------- */

.topo {
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 20px;
  padding-top: env(safe-area-inset-top);
  box-sizing: content-box;
  background: var(--marinho);
}

.logo {
  display: block;
  width: 154px;
  height: auto;
}

.topo {
  justify-content: space-between;
}

/* Cadeado discreto no topo do quiz: leva ao painel da equipe. */
.cadeado {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  color: rgba(255, 255, 255, 0.5);
}

.cadeado:active {
  color: #fff;
}

.topo-acao {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}

.progresso {
  height: 4px;
  background: #e3e8ef;
}

.progresso-barra {
  width: 0;
  height: 100%;
  background: var(--marca);
  background-size: 100vw 100%;
  transition: width 0.2s ease-out;
}

/* ---------- estrutura ---------- */

.app {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 24px 20px max(28px, env(safe-area-inset-bottom));
}

h1 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--marinho);
}

h2 {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--marinho);
}

.texto {
  margin-top: 12px;
  color: var(--suave);
  font-size: 17px;
}

.nota {
  margin-top: 12px;
  color: var(--suave);
  font-size: 14px;
}

/* Abertura: chamada compacta e a primeira pergunta logo abaixo, sem botão "Começar". */
.tela-inicio h1 {
  font-size: 25px;
}

.tela-inicio .texto {
  margin-top: 8px;
  font-size: 16px;
}

.primeira-pergunta {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #e6eaf0;
}

.passo-abertura {
  margin-bottom: 6px;
  color: var(--suave);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.primeira-pergunta .opcoes {
  margin-top: 14px;
}

.rodape {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid #e6eaf0;
  color: #8a93a1;
  font-size: 13px;
}

/* ---------- botões ---------- */

.botao {
  display: block;
  width: 100%;
  min-height: 52px;
  margin-top: 24px;
  padding: 14px 20px;
  border: 0;
  border-radius: 6px;
  background: var(--azul);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}

.botao:active {
  background: var(--azul-escuro);
}

.botao:disabled {
  opacity: 0.7;
  cursor: progress;
}

.botao-whats {
  min-height: 60px;
  background: var(--verde);
  font-size: 19px;
}

.botao-whats:active {
  background: var(--verde-escuro);
}

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--azul);
  font-size: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- linha de cima das perguntas ---------- */

.passo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  color: var(--suave);
  font-size: 14px;
}

.voltar {
  min-height: 44px;
  margin-left: -8px;
  padding: 0 8px;
  border: 0;
  background: none;
  color: var(--azul);
  font-size: 15px;
  font-weight: 600;
}

/* ---------- opções ---------- */

.opcoes {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.opcao {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 56px;
  padding: 12px 16px;
  border: 1px solid var(--borda);
  border-radius: 8px;
  background: #fff;
  font-size: 17px;
  line-height: 1.35;
  text-align: left;
}

.opcao:active {
  background: var(--cinza);
}

.radio {
  flex: none;
  width: 20px;
  height: 20px;
  border: 2px solid #9aa4b2;
  border-radius: 50%;
}

.opcao[aria-checked='true'] {
  border-color: var(--azul);
  background: var(--azul-claro);
  box-shadow: inset 0 0 0 1px var(--azul);
}

.opcao[aria-checked='true'] .radio {
  border-color: var(--azul);
  background: radial-gradient(circle, var(--azul) 45%, transparent 50%);
}

/* ---------- formulário ---------- */

.formulario {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.campo label {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 600;
}

.campo input,
.campo select {
  width: 100%;
  height: 50px;
  padding: 0 12px;
  border: 1px solid #b9c2cf;
  border-radius: 6px;
  background: #fff;
  font-size: 17px; /* 16px ou mais evita o zoom automático do iPhone */
  -webkit-appearance: none;
  appearance: none;
}

.campo select {
  padding-right: 28px;
  background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m7 10 5 5 5-5' fill='none' stroke='%235a6473' stroke-width='2.2'/%3E%3C/svg%3E")
    right 6px center / 18px no-repeat;
}

.campo input:focus,
.campo select:focus {
  border-color: var(--azul);
  outline: none;
  box-shadow: 0 0 0 1px var(--azul);
}

.campo [aria-invalid='true'] {
  border-color: var(--erro);
  box-shadow: 0 0 0 1px var(--erro);
}

.linha {
  display: grid;
  grid-template-columns: 1fr 88px;
  gap: 12px;
}

/* "Este número é WhatsApp?" Sim / Não, como dois botões lado a lado */
.escolha {
  margin: 0;
  padding: 0;
  border: 0;
}

.escolha legend {
  margin-bottom: 6px;
  padding: 0;
  font-size: 15px;
  font-weight: 600;
}

.escolha-opcoes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.escolha label {
  position: relative;
  display: block;
  cursor: pointer;
}

.escolha input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.escolha span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid #b9c2cf;
  border-radius: 6px;
  font-size: 17px;
}

.escolha input:checked + span {
  border-color: var(--azul);
  background: var(--azul-claro);
  box-shadow: inset 0 0 0 1px var(--azul);
  color: var(--azul-escuro);
  font-weight: 600;
}

.escolha input:focus-visible + span {
  outline: 3px solid var(--laranja);
  outline-offset: 2px;
}

/* Espaço embaixo para o botão "Ver resultado" poder subir acima do teclado. */
.tela-contato {
  padding-bottom: 40vh;
}

.erro {
  margin-top: 6px;
  color: var(--erro);
  font-size: 14px;
}

.erro:empty {
  display: none;
}

.erro-geral {
  margin: 0;
}

.erro-geral a {
  color: var(--erro);
}

.armadilha {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.formulario .botao {
  margin-top: 4px;
}

.formulario .nota {
  margin-top: 0;
  font-size: 13px;
}

/* ---------- resultado ---------- */

.rotulo {
  margin-bottom: 8px;
  color: var(--suave);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* "Até 20% de desconto todo mês": o benefício em destaque.
   Cartão azul-marinho como o topo, com o número grande nas cores da logo. */
.beneficio {
  position: relative;
  margin-top: 20px;
  padding: 24px 20px 20px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--marinho);
  color: #fff;
  text-align: center;
}

.beneficio::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--marca);
}

.beneficio-rotulo {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.beneficio-destaque {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 8px;
  line-height: 1;
}

.beneficio-antes {
  color: rgba(255, 255, 255, 0.88);
  font-size: 20px;
  font-weight: 600;
}

.beneficio-numero {
  margin-top: 2px;
  color: var(--laranja);
  font-size: 92px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .beneficio-numero {
    background: linear-gradient(90deg, #36a78f, #a1a94b 35%, #f4a014 65%, #eb6221);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

#contador {
  display: inline-block;
  min-width: 2ch;
  text-align: right;
}

.beneficio-depois {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 700;
}

.beneficio-texto {
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
}

.so-leitor {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Entrada da tela do resultado: tudo termina em menos de 1 segundo. */
.resultado > * {
  animation: resultado-entra 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.resultado > :nth-child(2) {
  animation-delay: 0.05s;
}

.resultado > :nth-child(3) {
  animation-delay: 0.1s;
}

.resultado > :nth-child(4) {
  animation-delay: 0.15s;
}

.resultado > :nth-child(5) {
  animation-delay: 0.2s;
}

.resultado > :nth-child(6) {
  animation-delay: 0.25s;
}

.resultado > :nth-child(7) {
  animation-delay: 0.3s;
}

.resultado .beneficio {
  animation-name: beneficio-entra;
}

/* Botão do WhatsApp: entra e depois pulsa de leve, chamando o toque. */
.resultado .botao-whats {
  animation:
    resultado-entra 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) 0.25s both,
    pulso 2s ease-out 1.1s infinite;
}

@keyframes resultado-entra {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@keyframes beneficio-entra {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
}

@keyframes pulso {
  0% {
    box-shadow: 0 0 0 0 rgba(31, 122, 29, 0.5);
  }
  70% {
    box-shadow: 0 0 0 14px rgba(31, 122, 29, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(31, 122, 29, 0);
  }
}

.motivos {
  margin-top: 16px;
  padding-left: 20px;
  color: var(--texto);
}

.motivos li + li {
  margin-top: 6px;
}

.proximo {
  margin-top: 16px;
}

/* Compartilhar no WhatsApp: botão secundário, contornado, abaixo do "Falar no WhatsApp". */
.botao-compartilhar {
  margin-top: 12px;
  border: 1.5px solid var(--verde);
  background: #fff;
  color: var(--verde);
}

.botao-compartilhar:active {
  background: #eef7ee;
}

/* ---------- painel admin ---------- */

.painel {
  max-width: 760px;
}

.botao-pequeno {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 44px;
  margin-top: 0;
  padding: 10px 14px;
  font-size: 15px;
}

.botao-contorno {
  border: 1px solid var(--azul);
  background: #fff;
  color: var(--azul);
}

.botao-contorno:active {
  background: var(--azul-claro);
}

.painel-topo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.painel-topo h1 {
  font-size: 24px;
}

.painel-aviso {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #fff7e6;
  color: #7a4b00;
  font-size: 14px;
}

.resumo {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 18px 0 0;
}

.resumo div {
  padding: 10px 8px;
  border-radius: 6px;
  background: var(--cinza);
  text-align: center;
}

.resumo dt {
  color: var(--suave);
  font-size: 12px;
  font-weight: 600;
}

.resumo dd {
  margin: 2px 0 0;
  color: var(--marinho);
  font-size: 22px;
  font-weight: 700;
}

.filtros {
  display: grid;
  grid-template-columns: 1fr 112px;
  gap: 8px;
  margin-top: 16px;
}

.filtros input,
.filtros select {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 1px solid #b9c2cf;
  border-radius: 6px;
  background: #fff;
  font-size: 16px;
}

.filtros input:focus,
.filtros select:focus {
  border-color: var(--azul);
  outline: none;
  box-shadow: 0 0 0 1px var(--azul);
}

.lista-contatos {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  padding: 0;
  list-style: none;
}

.contato {
  padding: 14px;
  border: 1px solid var(--borda);
  border-radius: 8px;
}

.contato-cabeca {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.contato-cabeca strong {
  color: var(--marinho);
  font-size: 17px;
  overflow-wrap: anywhere;
}

.selo-perfil {
  flex: none;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.selo-apto {
  background: #e6f4e6;
  color: var(--verde-escuro);
}

.selo-analise {
  background: #fff1dc;
  color: #8a4b00;
}

.contato-linha {
  margin-top: 4px;
  color: var(--suave);
  font-size: 14px;
}

.contato-acoes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.contato-acoes .botao-whats {
  font-size: 15px;
  animation: none;
}

.contato-detalhes {
  margin-top: 10px;
  font-size: 14px;
}

.contato-detalhes summary {
  min-height: 32px;
  color: var(--azul);
  font-weight: 600;
  cursor: pointer;
}

.contato-detalhes dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 12px;
  margin: 8px 0 0;
}

.contato-detalhes dt {
  color: var(--suave);
}

.contato-detalhes dd {
  margin: 0;
}

@media (max-width: 370px) {
  .resumo {
    grid-template-columns: repeat(2, 1fr);
  }

  .filtros {
    grid-template-columns: 1fr;
  }
}

/* ---------- texto sobre os dados ---------- */

.folha {
  width: calc(100% - 32px);
  max-width: 480px;
  padding: 24px 20px 20px;
  border: 0;
  border-radius: 8px;
  color: var(--texto);
}

.folha::backdrop {
  background: rgba(11, 29, 58, 0.55);
}

.folha h2 {
  font-size: 20px;
}

.folha p {
  margin-top: 12px;
  font-size: 15px;
}

.folha a {
  color: var(--azul);
}

.folha .botao {
  margin-top: 20px;
}

.sem-js {
  max-width: 520px;
  margin: 20px auto;
  padding: 0 20px;
}

/* Celulares estreitos (360 px ou menos) e navegadores de dentro do Instagram/Facebook/WhatsApp. */
@media (max-width: 370px) {
  .app {
    padding: 20px 16px max(24px, env(safe-area-inset-bottom));
  }

  .topo {
    padding-left: 16px;
    padding-right: 16px;
  }

  h1,
  .tela-inicio h1 {
    font-size: 22px;
  }

  h2 {
    font-size: 20px;
  }

  .tela-inicio .texto {
    font-size: 15px;
  }

  .texto {
    font-size: 16px;
  }

  .opcao {
    font-size: 16px;
  }

  .linha {
    grid-template-columns: 1fr 84px;
  }
}

/* Telas baixas (celular pequeno ou navegador do Instagram com as barras):
   resultado mais compacto para o botão do WhatsApp aparecer sem rolar. */
@media (max-height: 700px) {
  .resultado .rotulo {
    display: none;
  }

  .resultado h2 {
    font-size: 19px;
  }

  .beneficio {
    margin-top: 14px;
    padding: 16px 16px 14px;
  }

  .beneficio-antes {
    font-size: 17px;
  }

  .beneficio-numero {
    font-size: 64px;
  }

  .beneficio-depois {
    font-size: 19px;
  }

  .beneficio-texto {
    margin-top: 8px;
    font-size: 13px;
  }

  .resultado .proximo {
    margin-top: 12px;
    font-size: 15px;
  }

  .resultado .botao-whats {
    margin-top: 14px;
  }
}

@media (min-width: 700px) {
  .app {
    padding-top: 48px;
  }

  h1 {
    font-size: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .resultado > *,
  .resultado .botao-whats {
    animation: none;
  }

  .progresso-barra {
    transition: none;
  }
}
