/* Tokens (docs/DESIGN.md) */
:root {
  --background: #F4EFE5;
  --surface: #FFFFFF;
  --bar: #EBE2CD;
  --primary: #1E4D8C;
  --on-primary: #F4EFE5;
  --accent: #C96442;
  --foreground: #0E1417;
  --muted: #5B636A;
  --border: #D8D1C2;
  --error: #D6161C;
  --focus: #1E4D8C;
  --logo-lua: #1E4D8C;
  /* Abertura e lista de espera: azul e creme nos dois temas */
  --hero-bg: #1E4D8C;
  --hero-fg: #F4EFE5;
  --hero-ink: #0E1417;
  --hero-ink-muted: #5B636A;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Cinzas um pouco mais claros que o #0E1417 do app (o site ficava escuro
       demais), todos na mesma família azul-acinzentada. */
    --background: #161D22;
    --surface: #212A31;
    --bar: #1D252B;
    /* Só no site: o #4A7EC4 do app fica abaixo do AA sobre esses fundos.
       #6493D3 dá 4,94:1 sobre o fundo, 4,62:1 sobre os cartões e 5,88:1
       com texto #0E1417 por cima (botões). */
    --primary: #6493D3;
    --on-primary: #0E1417;
    --accent: #D4784A;
    --foreground: #F4EFE5;
    --muted: #8F979D;
    --border: #343F47;
    --error: #F04040;
    --focus: #F4EFE5;
    --logo-lua: #4A7EC4;
  }
}

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/assets/fonts/plus-jakarta-sans.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Space Mono";
  src: url("/assets/fonts/space-mono.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.125rem;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
h1, h2, h3 { font-weight: 800; line-height: 1.2; margin: 0 0 0.5em; }
p { margin: 0 0 1em; }
img, svg { max-width: 100%; }
a { color: var(--primary); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Layout base */
main { flex: 1; }
main:focus { outline: none; }
.secao { max-width: 46rem; margin: 0 auto; padding: 3rem 1.25rem; }
.mono { font-family: "Space Mono", ui-monospace, monospace; }
.aviso-erro {
  max-width: 46rem;
  margin: 1rem auto 0;
  padding: 0.75rem 1rem;
  border: 2px solid var(--error);
  border-radius: 12px;
  background: var(--surface);
}
.aviso-erro:focus { outline: none; }

/* Páginas legais (rascunho para revisão jurídica) */
.legal { overflow-wrap: break-word; }
.legal h2 { margin-top: 2.5rem; }
.legal h3 { font-size: 1.25rem; margin-top: 1.5rem; }
.aviso-rascunho {
  margin: 0 0 2rem;
  padding: 1rem 1.25rem;
  border: 3px solid var(--accent);
  border-radius: 12px;
  background: var(--surface);
  font-weight: 700;
}
.sumario-titulo { font-weight: 700; margin-bottom: 0.25rem; }
.sumario ol { margin: 0 0 1rem; padding-left: 1.75rem; }
.sumario a { display: inline-block; padding: 0.5rem 0; }
.legal-versao { color: var(--muted); margin-top: 2.5rem; }
.pular {
  position: absolute; /* acima do cabeçalho fixo (z-index 20) */
  left: 0.5rem;
  top: -4rem;
  padding: 0.75rem 1rem;
  background: var(--primary);
  color: var(--on-primary);
  border-radius: 8px;
  z-index: 30;
}
.pular:focus { top: 0.5rem; }

/* Botão */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  border: 2px solid transparent; /* aparece no modo de alto contraste */
  background: var(--primary);
  color: var(--on-primary);
  font: inherit;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { text-decoration: underline; text-underline-offset: 0.2em; }
/* Botão flutuante de compartilhar (só na página inicial): canto inferior
   direito, acima da barra de gestos do iPhone. */
.fab-compartilhar {
  position: fixed;
  right: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 15; /* abaixo do cabeçalho fixo (20) e do "pular" (30) */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  /* Borda creme: destaca o botão também sobre as faixas azuis */
  border: 2px solid var(--hero-fg);
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 6px 18px rgba(14, 20, 23, 0.28);
}
.fab-compartilhar:active { transform: scale(0.96); }
/* Só aparece depois de rolar um pouco: na primeira tela ele cobriria o texto
   de aceite do formulário. Navegador sem suporte mostra sempre (como antes). */
@supports (animation-timeline: scroll()) {
  .fab-compartilhar {
    animation: fab-aparece linear both;
    animation-timeline: scroll(root);
    animation-range: 0 70vh;
  }
  @keyframes fab-aparece {
    0%, 85% { opacity: 0; visibility: hidden; transform: scale(0.8); }
    100% { opacity: 1; visibility: visible; transform: none; }
  }
  /* "Reduzir movimento" desliga as animações do site: aqui fica só o
     esmaecimento, sem escala, para o botão não voltar a cobrir o aceite. */
  @media (prefers-reduced-motion: reduce) {
    .fab-compartilhar {
      animation: fab-aparece-fixo linear both !important;
      animation-timeline: scroll(root) !important;
      animation-range: 0 70vh !important;
    }
  }
  @keyframes fab-aparece-fixo {
    0%, 85% { opacity: 0; visibility: hidden; }
    100% { opacity: 1; visibility: visible; }
  }
}
/* O botão não cobre o fim do rodapé quando a página termina */
body:has(.fab-compartilhar) .rodape-interno { padding-bottom: 6rem; }
@media print { .fab-compartilhar { display: none; } }

/* Cabeçalho
   Celular primeiro: 1ª linha com a marca e "Entrar na lista", 2ª linha com os
   links de seção. A partir de 40em, tudo numa linha. Fixo no topo enquanto a
   tela tiver altura (em celular deitado ele rolaria junto, para não cobrir
   metade da tela). */
.topo { background: var(--bar); border-bottom: 1px solid var(--border); }
@media (min-height: 32em) {
  .topo { position: sticky; top: 0; z-index: 20; }
  /* Âncoras (#como-funciona, #lista...) não param embaixo do cabeçalho */
  html { scroll-padding-top: 7.5rem; }
}
/* Flex com quebra (e não grade): com texto ampliado, se marca e botão não
   cabem lado a lado, o botão desce de linha em vez de vazar a tela. */
.topo-interno {
  max-width: 70rem;
  margin: 0 auto;
  padding: 0.375rem 1rem 0.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 1rem;
}
.marca {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  color: var(--foreground);
  font-weight: 800;
  font-size: 1.25rem;
  text-decoration: none;
}
/* Meia-lua num path só: sem círculo de recorte, funciona sobre qualquer fundo */
.logo-lua { fill: var(--logo-lua); }
.btn-menu { white-space: nowrap; }
/* 2ª linha no celular: ocupa a largura toda */
.menu { flex-basis: 100%; display: flex; align-items: center; flex-wrap: wrap; gap: 0 1.5rem; }
.menu a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--foreground);
  font-weight: 600;
}
@media (min-width: 40em) {
  /* Uma linha: marca à esquerda, links e botão à direita */
  .topo-interno { padding: 0.5rem 1.25rem; column-gap: 1.5rem; }
  .menu { flex-basis: auto; order: 1; margin-left: auto; column-gap: 1.25rem; }
  .btn-menu { order: 2; }
}
@media (min-width: 40em) and (min-height: 32em) {
  html { scroll-padding-top: 5rem; }
}

/* Rodapé */
.rodape { background: var(--bar); border-top: 1px solid var(--border); font-size: 1.125rem; }
.rodape-interno { max-width: 70rem; margin: 0 auto; padding: 2rem 1.25rem; }
.rodape-links { display: flex; flex-wrap: wrap; gap: 0 1.5rem; margin-bottom: 1rem; }
.rodape-links a { display: inline-flex; align-items: center; min-height: 44px; }
.aviso-legal { color: var(--foreground); max-width: 52rem; }
.copyright { color: var(--muted); margin: 0; }

/* ---------- Página inicial ---------- */

/* Com texto ampliado a 200% numa tela estreita, palavra longa quebra em vez de vazar */
.abertura, .bloco, .lista { overflow-wrap: break-word; }
.rodape-links a { overflow-wrap: anywhere; }

/* Texto só para leitor de tela */
.so-leitor {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Formulários (abertura e lista de espera) */
.obrig { font-weight: 400; }
.rotulo { display: block; font-weight: 700; margin-bottom: 0.5rem; }
.campo {
  display: block;
  width: 100%;
  min-height: 3.25rem;
  padding: 0.625rem 1rem;
  border: 2px solid var(--muted);
  border-radius: 12px;
  min-width: 0;
  background: var(--surface);
  color: var(--foreground);
  font: inherit;
}
.aceite, .opcao {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-height: 44px;
  cursor: pointer;
}
.aceite span, .opcao span { min-width: 0; }
.aceite { margin-top: 1.25rem; line-height: 1.5; }
.aceite input, .opcao input {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  margin: 0.125rem 0 0;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Abertura */
.abertura {
  background: var(--hero-bg);
  color: var(--hero-fg);
  color-scheme: light;
}
.abertura :focus-visible { outline-color: var(--hero-fg); }
.abertura a { color: var(--hero-fg); }
.abertura-interno {
  max-width: 70rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
}
.abertura h1 {
  font-size: clamp(2.25rem, 1.25rem + 4.5vw, 4.25rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  max-width: 13ch;
  margin: 0 0 1.25rem;
  text-wrap: balance;
  overflow-wrap: break-word;
}
/* Plus Jakarta 800 não tem kerning entre letra e "." / ",": aproxima a pontuação */
.abertura h1 .pont { margin-left: -0.09em; }
.abertura-sub { font-size: 1.25rem; max-width: 34ch; margin-bottom: 2rem; }
.form-curto { max-width: 34rem; }
.campo-linha { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.campo-linha .campo { flex: 1 1 14rem; width: auto; }
.abertura .campo {
  border-color: var(--hero-fg);
  background: transparent;
  background: color-mix(in srgb, var(--hero-fg) 10%, transparent);
  color: var(--hero-fg);
}
.abertura .campo:-webkit-autofill,
.abertura .campo:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--hero-ink);
  caret-color: var(--hero-ink);
  box-shadow: 0 0 0 100px var(--hero-fg) inset;
}
.btn-claro {
  flex: 1 1 auto;
  min-height: 3.25rem;
  padding-inline: 1.5rem;
  border-radius: 12px;
  background: var(--hero-fg);
  color: var(--hero-bg);
}
.abertura .aceite input { accent-color: var(--hero-fg); }

/* O balão: a mensagem que a família recebe */
.balao-wrap { order: -1; margin: 0; justify-self: start; max-width: 24rem; }
.balao {
  margin: 0;
  padding: 1rem 1.25rem 0.625rem;
  border-radius: 1.25rem 1.25rem 1.25rem 0.375rem;
  background: var(--hero-fg);
  color: var(--hero-ink);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: 0 8px 24px rgba(14, 20, 23, 0.16);
  transform-origin: 0 100%;
}
.balao-hora {
  display: block;
  margin-top: 0.375rem;
  text-align: right;
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--hero-ink-muted);
}
.balao-legenda { margin-top: 0.75rem; }

@media (prefers-reduced-motion: no-preference) {
  .balao { animation: balao-chega 700ms cubic-bezier(0.2, 0.8, 0.2, 1) 400ms both; }
}
@keyframes balao-chega {
  from { opacity: 0; transform: translateY(1rem) scale(0.97); }
  to { opacity: 1; transform: none; }
}

@media (min-width: 60em) {
  .abertura-interno {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    align-items: center;
    gap: 4rem;
    padding-block: 5rem 6rem;
  }
  .abertura-texto { grid-column: 1; grid-row: 1; }
  .balao-wrap { order: 0; grid-column: 2; grid-row: 1; justify-self: center; }
  .balao { font-size: 1.5rem; padding: 1.25rem 1.5rem 0.75rem; }
}

/* Blocos de conteúdo: título à esquerda, texto à direita no desktop */
.bloco {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem 4rem;
  align-items: start;
  padding: 3rem max(1.25rem, calc((100% - 66rem) / 2));
}
.bloco > h2 {
  font-size: clamp(1.75rem, 1.25rem + 2vw, 2.5rem);
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
  overflow-wrap: break-word;
}
.bloco-corpo { max-width: 40rem; }
.bloco-corpo > :last-child { margin-bottom: 0; }
.bloco-faixa { background: var(--bar); }
.bloco-faixa p { font-size: 1.25rem; }
@media (min-width: 60em) {
  .bloco { grid-template-columns: minmax(0, 20rem) minmax(0, 40rem); padding-block: 6rem; }
}

/* Como funciona: a linha do tempo do balão */
.linha-do-tempo { list-style: none; margin: 0; padding: 0; }
.linha-do-tempo li { position: relative; padding: 0 0 2.25rem 2.25rem; }
.linha-do-tempo li:last-child { padding-bottom: 0; }
.linha-do-tempo li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 50%;
  background: var(--primary);
}
.linha-do-tempo li::after {
  content: "";
  position: absolute;
  left: 0.375rem;
  top: 1.75rem;
  bottom: 0.5rem;
  width: 2px;
  background: var(--border);
}
.linha-do-tempo li:last-child::after { content: none; }
.linha-do-tempo .marco-final::before { background: var(--accent); }
.marco { display: block; color: var(--primary); }
.linha-do-tempo h3 { font-size: 1.375rem; margin: 0.125rem 0 0.375rem; }
.linha-do-tempo p { margin: 0; }
@media (min-width: 40em) {
  .linha-do-tempo li { padding-left: 7.5rem; }
  .linha-do-tempo li::before { left: 5.25rem; top: 0.55rem; }
  .linha-do-tempo li::after { left: 5.625rem; }
  .marco { position: absolute; left: 0; top: 0.2rem; }
}

/* O que mais o app faz: lista, não cards */
.recursos { list-style: none; margin: 0; padding: 0; display: grid; column-gap: 2.5rem; }
.recursos li { padding: 1.25rem 0; border-top: 1px solid var(--border); }
.recursos strong { display: block; }
@media (min-width: 48em) {
  .recursos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* O que o Vigora não faz */
.limites { list-style: none; margin: 0 0 2rem; padding: 0; }
.limites li + li { margin-top: 1.25rem; }
.limites strong { display: block; }
/* O aviso desta seção está oculto (atributo hidden no HTML): o mesmo texto
   aparece no rodapé de todas as páginas. Para voltar, basta tirar o hidden. */
.limites:has(+ .disclaimer[hidden]) { margin-bottom: 0; }
.disclaimer {
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

/* Lista de espera */
.lista { background: var(--hero-bg); color: var(--hero-fg); }
.lista-interno {
  max-width: 66rem;
  margin: 0 auto;
  padding: 4rem 1.25rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem 4rem;
  align-items: start;
}
.lista h2 { font-size: clamp(1.75rem, 1.25rem + 2vw, 2.5rem); letter-spacing: -0.02em; text-wrap: balance; }
.lista-texto p { font-size: 1.25rem; max-width: 30ch; }
.lista-painel {
  padding: 1.5rem;
  border-radius: 18px;
  background: var(--surface);
  color: var(--foreground);
}
.lista-painel .aviso-erro { margin: 0 0 1.5rem; }
.motivos { border: 0; margin: 1.75rem 0 0; padding: 0; min-width: 0; }
.motivos legend { padding: 0; margin-bottom: 0.5rem; font-weight: 700; }
.opcional { display: block; font-weight: 400; color: var(--muted); }
.nota-motivos { margin: 0 0 0.5rem; }
.opcao { padding: 0.5rem 0; }
.btn-largo { width: 100%; min-height: 3.25rem; margin-top: 1.5rem; border-radius: 12px; }
@media (min-width: 60em) {
  .lista-interno { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); padding-block: 6rem; }
  .lista-painel { padding: 2rem; }
}

/* Perguntas frequentes */
.perguntas details { border-bottom: 1px solid var(--border); }
.perguntas details:first-child { border-top: 1px solid var(--border); }
.perguntas summary {
  position: relative;
  display: block;
  min-height: 44px;
  padding: 1.125rem 2.5rem 1.125rem 0;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.perguntas summary::-webkit-details-marker { display: none; }
.perguntas summary::after {
  content: "+";
  content: "+" / "";
  position: absolute;
  right: 0.5rem;
  top: 0.875rem;
  font-size: 1.5rem;
  line-height: 1.2;
  color: var(--primary);
}
.perguntas details[open] summary::after { content: "\2212"; content: "\2212" / ""; }
.perguntas details p { margin: 0; padding-bottom: 1.25rem; }
