/* ==========================================================================
   Salutis · Quiz de diagnóstico
   Paleta e fontes do Manual de Marca (verde dominante, creme no lugar do branco)
   ========================================================================== */
:root {
  --verde: #1A4D3C;
  --verde-medio: #2E7D5E;
  --verde-medio-escuro: #276B51;
  --verde-claro: #E8F5EF;
  --creme: #F7F4EF;
  --texto: #1C1C1C;
  --texto-suave: #52605A;
  --borda: #D6E3DC;
  --marca-vazia: #9DB5A9;
  --superficie: #FCFBF8;
  --erro: #A8322D;

  --raio: 14px;
  --coluna: 560px;

  --fonte-titulo: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --fonte-texto: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  color-scheme: light;
}

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

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

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--creme);
  color: var(--texto);
  font-family: var(--fonte-texto);
  font-size: 1.1875rem; /* 19px: leitura confortável pra quem tem mais de 40 */
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

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

/* ==========================================================================
   Topo: voltar + logotipo + barra de progresso
   ========================================================================== */
.topo {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--creme);
  padding: 10px 20px 12px;
  padding-top: calc(10px + env(safe-area-inset-top));
}

.topo__linha {
  max-width: var(--coluna);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 52px;
}

.logo {
  grid-column: 2;
  font-family: var(--fonte-titulo);
  font-weight: 700;
  font-size: 1.75rem;
  letter-spacing: 0.02em;
  color: var(--verde);
  line-height: 1;
}

.voltar {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 48px;
  padding: 0 12px 0 2px;
  margin-left: -4px;
  background: none;
  border: 0;
  border-radius: 10px;
  color: var(--verde);
  font-size: 1.0625rem;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .voltar:hover { background: var(--verde-claro); }
}

.progresso {
  max-width: var(--coluna);
  margin: 8px auto 0;
  height: 8px;
  background: var(--borda);
  border-radius: 99px;
  overflow: hidden;
}
.progresso__barra {
  display: block;
  height: 100%;
  width: 0;
  background: var(--verde-medio);
  border-radius: inherit;
  transition: width 0.35s ease;
}

/* ==========================================================================
   Palco (uma tela por vez)
   ========================================================================== */
.palco {
  flex: 1;
  width: 100%;
  max-width: calc(var(--coluna) + 40px);
  margin: 0 auto;
  padding: 16px 20px 32px;
}

.tela { animation: entrar 0.32s ease both; }

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

/* ==========================================================================
   Tela inicial: a cena do WhatsApp depois do expediente
   ========================================================================== */
.cena {
  background: var(--verde);
  border-radius: 22px;
  padding: 14px 14px 12px;
  margin-bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 18px 36px -22px rgba(26, 77, 60, 0.7);
}

.cena__rotulo {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(232, 245, 239, 0.72);
  margin: 0 0 2px 2px;
}

.balao {
  align-self: flex-start;
  max-width: 94%;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 2px 10px;
  padding: 8px 12px 7px;
  background: var(--creme);
  color: var(--texto);
  border-radius: 4px 16px 16px 16px;
  font-size: 1rem;
  line-height: 1.35;
  animation: chegar 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.balao:nth-of-type(1) { animation-delay: 0.25s; }
.balao:nth-of-type(2) { animation-delay: 0.85s; }

.balao__hora {
  margin-left: auto;
  font-size: 0.8125rem;
  color: var(--texto-suave);
  font-variant-numeric: tabular-nums;
}

@keyframes chegar {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}

.cena__status {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: rgba(232, 245, 239, 0.8);
  animation: chegar 0.4s ease both;
  animation-delay: 1.5s;
}

.titulo {
  font-family: var(--fonte-titulo);
  font-weight: 700;
  font-size: clamp(1.85rem, 8vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--verde);
  margin-bottom: 14px;
  text-wrap: balance;
}
.titulo em {
  display: block;
  margin-top: 4px;
  font-style: italic;
  color: var(--verde-medio);
}

.sub { margin-bottom: 20px; text-wrap: pretty; }

.nota {
  margin-top: 12px;
  text-align: center;
  font-size: 1rem;
  color: var(--texto-suave);
}

/* ==========================================================================
   Botões (grandes, fáceis de tocar)
   ========================================================================== */
.botao {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 66px;
  padding: 16px 22px;
  border: 2px solid transparent;
  border-radius: var(--raio);
  font-family: var(--fonte-texto);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.botao--principal {
  background: var(--verde-medio);
  color: var(--creme);
  box-shadow: 0 10px 22px -12px rgba(26, 77, 60, 0.75), inset 0 -3px 0 rgba(0, 0, 0, 0.14);
}
@media (hover: hover) {
  .botao--principal:hover { background: var(--verde-medio-escuro); }
  .botao--secundario:hover { background: var(--verde-claro); }
}
.botao--principal:active { transform: translateY(2px); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2); }
.botao--principal:focus-visible { outline-color: var(--verde); }

.botao--secundario {
  background: transparent;
  color: var(--verde);
  border-color: var(--verde);
}
.botao--secundario:active { transform: translateY(2px); }

.botao__icone { flex: none; width: 26px; height: 26px; }

.link {
  display: block;
  min-height: 48px;
  margin: 28px auto 0;
  padding: 0 14px;
  background: none;
  border: 0;
  color: var(--verde);
  font-size: 1.0625rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

/* ==========================================================================
   Perguntas
   ========================================================================== */
.olho {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--verde-medio);
  margin-bottom: 8px;
}

.pergunta {
  font-family: var(--fonte-titulo);
  font-weight: 700;
  font-size: clamp(1.75rem, 7.4vw, 2.3rem);
  line-height: 1.18;
  color: var(--verde);
  text-wrap: balance;
}

.dica {
  margin-top: 8px;
  font-size: 1.0625rem;
  color: var(--texto-suave);
}

.opcoes {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.opcao {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 66px;
  padding: 14px 18px;
  background: var(--superficie);
  border: 2px solid var(--borda);
  border-radius: var(--raio);
  font-size: 1.1875rem;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
@media (hover: hover) {
  .opcao:hover { border-color: var(--verde-medio); background: var(--verde-claro); }
}
.opcao:active { transform: scale(0.99); }

.opcao__marca {
  flex: none;
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--marca-vazia);
  background: var(--creme);
}

.opcao.is-marcada {
  background: var(--verde);
  border-color: var(--verde);
  color: var(--creme);
}
.opcao.is-marcada .opcao__marca { border-color: var(--creme); background: var(--creme); }
.opcao.is-marcada .opcao__marca::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 7px;
  height: 12px;
  border: solid var(--verde);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

/* Especialidade: 7 opções curtas em duas colunas pra caber sem rolar */
.opcoes--grade { grid-template-columns: 1fr 1fr; }
.opcoes--grade .opcao { justify-content: center; text-align: center; padding: 14px 10px; }
.opcoes--grade .opcao__marca { display: none; }
@media (max-width: 339px) {
  .opcoes--grade { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Campos (nome da clínica e cidade)
   ========================================================================== */
.campos {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.campo { display: grid; gap: 8px; }

.campo__rotulo {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--verde);
}
.campo__rotulo small {
  font-size: inherit;
  font-weight: 400;
  color: var(--texto-suave);
}

.campo__entrada {
  width: 100%;
  min-height: 66px;
  padding: 14px 18px;
  background: var(--superficie);
  border: 2px solid var(--borda);
  border-radius: var(--raio);
  font-size: 1.25rem;
  color: var(--texto);
  -webkit-appearance: none;
  appearance: none;
}
.campo__entrada::placeholder { color: #8A958F; }
.campo__entrada:focus {
  outline: none;
  border-color: var(--verde-medio);
  box-shadow: 0 0 0 4px rgba(46, 125, 94, 0.2);
}
.campo__entrada[aria-invalid="true"] { border-color: var(--erro); }

.erro {
  color: var(--erro);
  font-size: 1.0625rem;
  font-weight: 500;
}

.campos .botao { margin-top: 6px; }

/* ==========================================================================
   Resultado
   ========================================================================== */
.resultado__clinica {
  font-family: var(--fonte-titulo);
  font-weight: 700;
  font-size: clamp(1.9rem, 7.8vw, 2.4rem);
  line-height: 1.15;
  color: var(--verde);
  overflow-wrap: anywhere;
  margin-bottom: 16px;
}

.ficha {
  background: var(--verde);
  color: var(--creme);
  border-radius: 20px;
  padding: 22px 20px 24px;
  margin-bottom: 20px;
  box-shadow: 0 18px 36px -24px rgba(26, 77, 60, 0.8);
}

.ficha__titulo {
  font-family: var(--fonte-titulo);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.22;
  color: var(--creme);
  margin-bottom: 10px;
}

.ficha__texto {
  font-size: 1.1875rem;
  line-height: 1.55;
  color: var(--verde-claro);
}

.ponte { margin-bottom: 22px; }

.previa { margin: 16px 0 28px; }

.previa__rotulo {
  font-size: 1rem;
  color: var(--texto-suave);
  margin-bottom: 8px;
}

.previa__balao {
  margin-left: 8%;
  padding: 13px 15px;
  background: var(--verde-claro);
  border: 1px solid var(--borda);
  border-radius: 16px 16px 4px 16px;
  font-size: 1.0625rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.ajuda {
  margin-top: 10px;
  text-align: center;
  font-size: 1rem;
  color: var(--texto-suave);
}

/* Encerramento (quem ainda não tem clínica) */
.encerramento { padding-top: 12px; }
.encerramento .pergunta { margin-bottom: 14px; }

/* ==========================================================================
   Rodapé
   ========================================================================== */
.rodape {
  padding: 18px 20px calc(22px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 0.9375rem;
  color: var(--texto-suave);
}

/* ==========================================================================
   Telas maiores
   ========================================================================== */
@media (min-width: 720px) {
  .palco { padding-top: 36px; }
  .cena { padding: 20px 20px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .tela, .balao, .cena__status { animation: none; }
  .progresso__barra, .opcao, .botao { transition: none; }
}
