/* Precifica VMA — estilos
   Paleta (identidade atual da VMA):
     verde-floresta #042917 · off-white #F5F0E6 · dourado suave #C5A46D · grafite #1C1C1C · verde-claro #D5DDD5
   O dourado é usado só em detalhes (linhas, rótulos sobre o verde): sobre fundo claro ele não tem contraste
   suficiente para texto. Branco aparece apenas como apoio, nos campos e nos cartões. */

@font-face {
  font-family: "Playfair Display";
  src: url("../fonts/PlayfairDisplay-VariableFont_wght.ttf") format("truetype");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("../fonts/Montserrat-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --verde: #042917;
  --offwhite: #F5F0E6;
  --dourado: #C5A46D;
  --grafite: #1C1C1C;
  --verde-claro: #D5DDD5;
  --branco: #FFFFFF;

  --texto-suave: #4A524D;     /* explicações: contraste alto sobre off-white e branco */
  --borda-campo: #5F6F66;     /* contorno de campos: mais de 3:1 sobre o fundo */
  --erro: #8A1C1C;
  --erro-fundo: #F8E9E6;

  --fonte-titulo: "Playfair Display", Georgia, "Times New Roman", serif;
  --fonte-texto: "Montserrat", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;

  --raio: 12px;
  --largura: 44rem;
}

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

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

body {
  margin: 0;
  background: var(--offwhite);
  color: var(--grafite);
  font-family: var(--fonte-texto);
  font-size: 1.0625rem;
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: var(--fonte-titulo);
  color: var(--verde);
  line-height: 1.2;
  font-weight: 700;
  margin: 0 0 0.75rem;
}
h1 { font-size: clamp(1.75rem, 5.5vw, 2.5rem); }
h2 { font-size: clamp(1.3rem, 4vw, 1.6rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1rem; }
a { color: var(--verde); text-underline-offset: 3px; }

:focus-visible {
  outline: 3px solid var(--verde);
  outline-offset: 3px;
  border-radius: 4px;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.pular-conteudo {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--verde);
  color: var(--offwhite);
  padding: 0.75rem 1rem;
  border-radius: 0 0 var(--raio) var(--raio);
  z-index: 10;
}
.pular-conteudo:focus { top: 0; }

.aviso-arquivo {
  background: var(--erro-fundo);
  color: var(--erro);
  border-bottom: 3px solid var(--erro);
  padding: 1rem;
  text-align: center;
}
.aviso-arquivo[hidden] { display: none; }

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

.topo {
  background: var(--verde);
  border-bottom: 3px solid var(--dourado);
}
.topo-interno {
  max-width: var(--largura);
  margin: 0 auto;
  padding: 1rem 1.25rem;
}
.marca {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
.marca-nome {
  font-family: var(--fonte-titulo);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--offwhite);
  letter-spacing: 0.01em;
}
.marca-vma {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--dourado);
}

/* ---------- Conteúdo ---------- */

.conteudo {
  max-width: var(--largura);
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
}
.conteudo:focus { outline: none; }
.conteudo h1:focus { outline: none; }

.sobretitulo {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--texto-suave);
}

.lead { font-size: 1.15rem; color: var(--grafite); }
.suave { color: var(--texto-suave); font-size: 0.95rem; }

.cartao {
  background: var(--branco);
  border: 1px solid var(--verde-claro);
  border-radius: var(--raio);
  padding: 1.5rem 1.25rem;
  margin: 0 0 1.5rem;
}

/* ---------- Início ---------- */

.lista-simples {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
}
.lista-simples li { margin-bottom: 0.5rem; }

.caixa {
  border-radius: var(--raio);
  padding: 1rem 1.1rem;
  margin: 0 0 1.25rem;
  border-left: 6px solid var(--verde);
  background: var(--verde-claro);
}
.caixa p:last-child { margin-bottom: 0; }
.caixa-aviso { border-left-color: var(--dourado); }
.caixa-erro {
  background: var(--erro-fundo);
  border-left-color: var(--erro);
  color: var(--grafite);
}
.caixa-titulo { font-weight: 700; margin-bottom: 0.4rem; color: var(--verde); }
.caixa-erro .caixa-titulo { color: var(--erro); }

/* ---------- Indicador de passos ---------- */

.passos {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: flex;
  gap: 0.5rem;
}
.passos li { flex: 1 1 0; min-width: 0; }
.passo-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  min-height: 2.75rem; /* área de toque confortável também no celular */
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--texto-suave);
  text-align: left;
}
.passo-barra {
  display: block;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--verde-claro);
}
.passo-nome { font-size: 0.8rem; font-weight: 600; line-height: 1.3; }
.passos li.feito .passo-barra { background: var(--verde); }
.passos li.atual .passo-barra { background: var(--verde); box-shadow: 0 0 0 2px var(--offwhite), 0 0 0 4px var(--dourado); }
.passos li.atual .passo-nome { color: var(--verde); }
button.passo-item { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
button.passo-item:hover .passo-nome { color: var(--verde); }

/* No celular os quatro passos aparecem só com o número; o nome completo continua disponível
   para leitores de tela e aparece no título de cada tela. */
@media (max-width: 560px) {
  .passo-titulo {
    position: absolute; width: 1px; height: 1px; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .passo-numero { font-size: 0.95rem; }
}

/* ---------- Formulário ---------- */

.campo { margin: 0 0 1.5rem; }

.campo > label,
.campo > .rotulo,
fieldset > legend {
  display: block;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--grafite);
  margin-bottom: 0.25rem;
  padding: 0;
}
.opcional { font-weight: 500; color: var(--texto-suave); font-size: 0.9rem; }

.ajuda {
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
  color: var(--texto-suave);
  line-height: 1.5;
}

.entrada {
  display: flex;
  align-items: stretch;
  background: var(--branco);
  border: 2px solid var(--borda-campo);
  border-radius: 10px;
}
.entrada:focus-within { border-color: var(--verde); box-shadow: 0 0 0 3px var(--dourado); }
.entrada input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 3.5rem;
  padding: 0.5rem 0.9rem;
  border: 0;
  background: transparent;
  color: var(--grafite);
  font: inherit;
  font-size: 1.2rem;
  font-weight: 500;
  outline: none;
  border-radius: 10px;
}
.entrada input::placeholder { color: #6B726D; font-weight: 400; }
.prefixo, .sufixo {
  display: flex;
  align-items: center;
  padding: 0 0.9rem;
  font-weight: 600;
  color: var(--texto-suave);
  background: var(--verde-claro);
}
.prefixo { border-radius: 8px 0 0 8px; }
.sufixo { border-radius: 0 8px 8px 0; }

.entrada.invalido { border-color: var(--erro); background: var(--erro-fundo); }
.entrada.invalido:focus-within { box-shadow: 0 0 0 3px var(--erro); }

.erro-campo {
  margin: 0.4rem 0 0;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--erro);
}
.erro-campo:empty { display: none; }

.resumo-vivo {
  margin: 0.6rem 0 0;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  background: var(--verde-claro);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--verde);
}
.resumo-vivo:empty { display: none; }

fieldset { border: 0; margin: 0 0 1.5rem; padding: 0; min-width: 0; }

.opcoes { display: grid; gap: 0.75rem; margin-top: 0.5rem; }
.opcao {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 1rem;
  background: var(--branco);
  border: 2px solid var(--borda-campo);
  border-radius: var(--raio);
  cursor: pointer;
}
.opcao:has(input:checked) { border-color: var(--verde); background: var(--verde-claro); }
.opcao:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--dourado); }
.opcao input { width: 1.35rem; height: 1.35rem; margin: 0.2rem 0 0; accent-color: var(--verde); flex: none; }
.opcao-titulo { display: block; font-weight: 700; color: var(--grafite); }
.opcao-texto { display: block; font-size: 0.92rem; color: var(--texto-suave); margin-top: 0.15rem; }

.resumo-erros { margin-bottom: 1.25rem; }
.resumo-erros:empty { display: none; }

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

.acoes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}
.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.6rem 1.5rem;
  border-radius: 10px;
  border: 2px solid var(--verde);
  font: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}
.botao-primario { background: var(--verde); color: var(--offwhite); }
.botao-primario:hover { background: #0B3F27; }
.botao-secundario { background: transparent; color: var(--verde); }
.botao-secundario:hover { background: var(--verde-claro); }
.botao-largo { width: 100%; }

@media (max-width: 560px) {
  .acoes .botao { width: 100%; }
  .acoes { flex-direction: column; }
}

/* ---------- Resultados ---------- */

.destaque-preco {
  background: var(--verde);
  color: var(--offwhite);
  border-radius: var(--raio);
  border-bottom: 5px solid var(--dourado);
  padding: 1.5rem 1.25rem;
  margin: 0 0 1.5rem;
}
.destaque-preco .rotulo-preco {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dourado);
}
.destaque-preco .nome-produto { margin: 0.25rem 0 0; font-weight: 600; }
.destaque-preco .preco {
  margin: 0.25rem 0 0.5rem;
  font-family: var(--fonte-titulo);
  font-weight: 700;
  font-size: clamp(2.5rem, 12vw, 3.75rem);
  line-height: 1.1;
  color: var(--offwhite);
}
.destaque-preco .nota { margin: 0; font-size: 0.95rem; color: var(--offwhite); }

.grupo { margin: 0 0 1.75rem; }
.indicadores { margin: 0; display: grid; gap: 0.75rem; }
.indicador {
  background: var(--branco);
  border: 1px solid var(--verde-claro);
  border-radius: var(--raio);
  padding: 1rem 1.1rem;
}
.indicador dt { font-weight: 600; color: var(--grafite); }
.indicador dd { margin: 0; }
.indicador .valor {
  display: block;
  margin: 0.1rem 0 0.25rem;
  font-family: var(--fonte-titulo);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--verde);
}
.indicador .explica { display: block; font-size: 0.92rem; color: var(--texto-suave); line-height: 1.5; }

@media (min-width: 720px) {
  .indicadores { grid-template-columns: 1fr 1fr; }
}

.metodo-usado {
  background: var(--verde-claro);
  border-radius: var(--raio);
  padding: 1rem 1.1rem;
  margin: 0 0 1.5rem;
}
.metodo-usado p { margin: 0 0 0.4rem; }
.metodo-usado p:last-child { margin-bottom: 0; }

/* Os algarismos padrão do Playfair Display são "antigos" (o zero parece um "o" pequeno).
   Em valores e percentuais usamos algarismos alinhados, mais fáceis de ler. */
.indicador .valor,
.destaque-preco .preco,
.imp-preco .imp-valor {
  font-variant-numeric: lining-nums;
  font-feature-settings: "lnum" 1;
}

/* ---------- Diálogo ---------- */

.dialogo {
  max-width: 28rem;
  width: calc(100% - 2.5rem);
  border: 0;
  border-radius: var(--raio);
  padding: 1.5rem 1.25rem;
  background: var(--offwhite);
  color: var(--grafite);
  border-top: 5px solid var(--dourado);
}
.dialogo::backdrop { background: rgba(4, 41, 23, 0.65); }
.dialogo .acoes { margin-top: 1.25rem; }

/* ---------- Rodapé ---------- */

.rodape {
  max-width: var(--largura);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
  border-top: 1px solid var(--verde-claro);
  font-size: 0.85rem;
  color: var(--texto-suave);
}
.rodape p { margin: 0 0 0.4rem; }

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

/* ---------- Versão de impressão ---------- */

.impressao { display: none; }

@media print {
  @page { size: A4; margin: 15mm; }

  html, body { background: #fff !important; color: #000 !important; font-size: 10pt; line-height: 1.4; }

  .pular-conteudo, .aviso-arquivo, .topo, .conteudo, .rodape, .dialogo { display: none !important; }

  .impressao { display: block !important; }

  .impressao:empty::before {
    content: "Para imprimir, conclua o cálculo e abra a tela de resultados.";
    font-size: 12pt;
  }

  .impressao h1, .impressao h2, .impressao h3 { color: #000; break-after: avoid; }

  .imp-cabecalho {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 2px solid #000;
    padding-bottom: 5pt;
    margin-bottom: 10pt;
  }
  .imp-marca { font-family: var(--fonte-titulo); font-size: 20pt; font-weight: 700; margin: 0; }
  .imp-marca span { font-family: var(--fonte-texto); font-size: 9pt; letter-spacing: 0.2em; margin-left: 6pt; }
  .imp-data { margin: 0; font-size: 9pt; }

  .imp-titulo { font-size: 17pt; margin: 0 0 2pt; }
  .imp-produto { font-size: 11.5pt; font-weight: 600; margin: 0 0 9pt; }

  .imp-preco {
    border: 2px solid #000;
    padding: 8pt 12pt;
    margin: 0 0 8pt;
    break-inside: avoid;
  }
  .imp-preco .imp-rotulo { margin: 0; font-size: 9pt; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; }
  .imp-preco .imp-valor { margin: 2pt 0 0; font-family: var(--fonte-titulo); font-size: 30pt; font-weight: 700; line-height: 1.1; }

  .impressao h2 { font-size: 12pt; margin: 10pt 0 3pt; border-bottom: 1px solid #000; padding-bottom: 2pt; }

  .imp-tabela { width: 100%; border-collapse: collapse; margin: 0 0 6pt; break-inside: avoid; }
  .imp-tabela th, .imp-tabela td { text-align: left; padding: 2.5pt 4pt; border-bottom: 0.5pt solid #777; vertical-align: top; }
  .imp-tabela th { font-weight: 500; width: 62%; }
  .imp-tabela td { font-weight: 700; text-align: right; white-space: nowrap; }

  .imp-nota { font-size: 9pt; margin: 4pt 0; }
  .imp-aviso { border: 1px solid #000; padding: 6pt 9pt; margin-top: 10pt; font-size: 9pt; break-inside: avoid; }
}

/* ---------- Versão 0.2: menu da conta, listas de registros e página de apresentação ---------- */

.topo-interno { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.25rem; }
.menu { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; }
.menu:empty { display: none; }
.menu-item, .menu-link {
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  min-height: 2.75rem;
  padding: 0.4rem 0.75rem;
  background: transparent;
  color: var(--offwhite);
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.menu-item:hover, .menu-link:hover { border-bottom-color: var(--dourado); }
.menu-item[aria-current="page"] { border-bottom-color: var(--dourado); color: var(--dourado); }
.menu-email { color: var(--verde-claro); font-size: 0.85rem; overflow-wrap: anywhere; }
.menu-item:focus-visible, .menu-link:focus-visible { outline: 3px solid var(--dourado); outline-offset: 2px; }

.botao-link {
  display: inline;
  min-height: 2.75rem;
  padding: 0.25rem 0.25rem;
  border: 0;
  background: transparent;
  color: var(--verde);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}
.botao-pequeno { min-height: 2.75rem; padding: 0.35rem 1rem; font-size: 0.95rem; }

.lista-registros { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: 0.75rem; }
.registro {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 1rem 1.25rem;
  background: var(--branco);
  border: 1px solid var(--verde-claro);
  border-radius: var(--raio);
}
.registro-texto { display: grid; gap: 0.15rem; min-width: 0; flex: 1 1 12rem; }
.registro-nome { font-weight: 700; overflow-wrap: anywhere; }
.registro-valor { font-family: var(--fonte-titulo); font-size: 1.25rem; font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1; }
.registro-data { color: var(--texto-suave); font-size: 0.85rem; }
.registro-acoes { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.total-despesas {
  font-size: 1.15rem;
  padding: 1rem 1.25rem;
  background: var(--verde-claro);
  border-radius: var(--raio);
  font-variant-numeric: lining-nums;
}
.total-despesas strong { font-family: var(--fonte-titulo); font-size: 1.5rem; }
.form-despesa { margin: 1.5rem 0; padding: 1.25rem; background: var(--branco); border: 1px solid var(--verde-claro); border-radius: var(--raio); }
.form-despesa h2 { margin-top: 0; }

/* Página de apresentação */
.aviso-provisorio { background: var(--dourado); color: var(--grafite); text-align: center; padding: 0.6rem 1rem; font-size: 0.9rem; font-weight: 600; }
.hero { padding: 1rem 0 0.5rem; }
.hero h1 { font-size: clamp(2rem, 6vw, 3rem); margin-bottom: 0.75rem; }
.etapas-landing { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: 0.75rem; counter-reset: etapa; }
.etapas-landing li { counter-increment: etapa; padding: 1rem 1.25rem 1rem 3.5rem; position: relative; background: var(--branco); border: 1px solid var(--verde-claro); border-radius: var(--raio); }
.etapas-landing li::before { content: counter(etapa); position: absolute; left: 1.1rem; top: 0.9rem; font-family: var(--fonte-titulo); font-weight: 700; font-size: 1.4rem; color: var(--verde); font-variant-numeric: lining-nums; }
.etapas-landing strong { display: block; }
.compra { border: 2px solid var(--verde); }
.botao[disabled], .botao[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.faq details { padding: 0.9rem 0; border-bottom: 1px solid var(--verde-claro); }
.faq summary { cursor: pointer; font-weight: 700; min-height: 2.75rem; display: flex; align-items: center; }
.faq details p { margin: 0.5rem 0 0; }

@media (max-width: 560px) {
  .registro-acoes { width: 100%; }
  .registro-acoes .botao { flex: 1 1 auto; width: auto; }
  .topo-interno { padding: 0.75rem 1rem; }
}
@media print {
  .menu, .aviso-provisorio { display: none !important; }
}

/* ---------- Páginas de termos e privacidade (rascunhos) ---------- */
.texto-legal h2 { margin-top: 1.75rem; }
.texto-legal p, .texto-legal li { max-width: 65ch; }
.tabela-rolagem { overflow-x: auto; max-width: 100%; margin: 1rem 0; }
.tabela-legal { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: 0.92rem; background: var(--branco); }
.tabela-legal th, .tabela-legal td { text-align: left; vertical-align: top; padding: 0.6rem 0.7rem; border: 1px solid var(--verde-claro); }
.tabela-legal th { background: var(--verde-claro); color: var(--verde); }
