:root {
  color-scheme: light;
  --fundo: #f4f7f3;
  --papel: #ffffff;
  --texto: #183028;
  --texto-suave: #587067;
  --verde: #176b4d;
  --verde-escuro: #0e4e38;
  --verde-claro: #e5f3ec;
  --linha: #768d83;   /* A2: 3,55:1 contra o papel, 3,29:1 contra o fundo.
                         O #cedbd5 anterior media 1,43:1 — fio invisivel. */
  --erro: #a62d2d;
  --erro-fundo: #fff0ef;
  --sombra: 0 16px 45px rgba(26, 64, 50, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--fundo); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--texto);
  background:
    radial-gradient(circle at 90% 4%, rgba(79, 157, 121, 0.13), transparent 22rem),
    var(--fundo);
  font-size: 16px;
  line-height: 1.55;
}

button, input, select { font: inherit; }
button, label, select { -webkit-tap-highlight-color: transparent; }

.pagina { width: min(100% - 32px, 980px); margin: 0 auto; padding-bottom: 72px; }

.cabecalho {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.marca {
  display: inline-flex;
  align-items: center;
  min-height: 44px;   /* A3: o alvo tinha ~22px */
  color: var(--verde-escuro);
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
}
.selo {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 99px;
  background: var(--verde-claro);
  color: var(--verde-escuro);
  font-size: 15px;
  font-weight: 700;
}

.apresentacao { max-width: 720px; padding: 48px 0 28px; }
.chamada { margin: 0 0 8px; color: var(--verde); font-size: 15px; font-weight: 800; letter-spacing: .09em; }
h1, h2, p { overflow-wrap: break-word; }
h1 { margin: 0; font-size: clamp(36px, 8vw, 64px); line-height: 1.04; letter-spacing: -.045em; }
h2 { margin: 0; font-size: clamp(25px, 4vw, 34px); line-height: 1.15; letter-spacing: -.025em; }
.resumo { max-width: 620px; margin: 18px 0 0; color: var(--texto-suave); font-size: 18px; }

.cartao {
  min-height: 260px;
  padding: 18px;
  border: 1px solid rgba(23, 107, 77, .13);
  border-radius: 22px;
  background: var(--papel);
  box-shadow: var(--sombra);
}

.zona-envio {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 20px;
  border: 2px dashed #8eafa2;
  border-radius: 16px;
  background: #fbfdfb;
  color: var(--texto-suave);
  cursor: pointer;
  text-align: center;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.zona-envio:hover, .zona-envio.arrastando {
  border-color: var(--verde);
  background: var(--verde-claro);
  transform: translateY(-1px);
}

/* A1: indicador de foco visivel para TODO elemento focavel — zona de envio,
   botoes, select e a area rolavel da tabela. O :focus-visible aparece para quem
   navega por teclado e nao polui o clique de mouse. Contorno #0e4e38:
   9,70:1 sobre o papel, 8,48:1 sobre o verde-claro.                         */
:focus-visible {
  outline: 3px solid var(--verde-escuro);
  outline-offset: 2px;
}
.zona-envio:focus-visible {
  border-color: var(--verde);
  background: var(--verde-claro);
}
.zona-envio strong { color: var(--texto); font-size: 21px; }
.icone-pdf {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
  border-radius: 13px;
  background: var(--verde);
  color: white;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .06em;
}
.botao-falso, .botao-primario, .botao-secundario {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  font-weight: 800;
}
.botao-falso { margin-top: 12px; padding: 10px 18px; background: var(--verde); color: white; }

.privacidade {
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--verde-claro);
}
.privacidade > span { flex: 0 0 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--verde); color: white; font-weight: 900; }
.privacidade p, .estado p { margin: 0; }

.estado {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  padding: 14px;
  border-radius: 12px;
}
.estado[hidden], [hidden] { display: none !important; }
.estado-processando { background: #eef5ff; }
.estado-erro { color: var(--erro); background: var(--erro-fundo); }
.estado-erro > span { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 32px; border: 2px solid currentColor; border-radius: 50%; font-weight: 900; }
.carregando { width: 32px; height: 32px; flex: 0 0 32px; border: 3px solid #bdd0e6; border-top-color: var(--verde); border-radius: 50%; animation: girar .8s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

.resultado { min-height: 440px; margin-top: 22px; }
.resultado-topo { min-height: 76px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.campo { margin: 22px 0 14px; }
.campo label { display: block; margin-bottom: 7px; font-weight: 800; }
select { width: 100%; min-height: 48px; padding: 8px 42px 8px 12px; border: 1px solid var(--linha); border-radius: 10px; background: white; color: var(--texto); font-size: 16px; }
.resumo-tabela { min-height: 24px; margin: 18px 0 9px; color: var(--texto-suave); font-weight: 700; }
.tabela-limite { min-height: 180px; max-height: 430px; overflow: auto; border: 1px solid var(--linha); border-radius: 11px; }
table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 15px; }
th, td { min-width: 120px; height: 46px; padding: 10px 12px; border-right: 1px solid var(--linha); border-bottom: 1px solid var(--linha); text-align: left; white-space: nowrap; }
th { position: sticky; top: 0; z-index: 1; background: #eef5f1; color: var(--verde-escuro); }
tr:last-child td { border-bottom: 0; }
th:last-child, td:last-child { border-right: 0; }
.acoes { display: flex; margin-top: 18px; }
.botao-primario, .botao-secundario { border: 0; cursor: pointer; }
.botao-primario { width: 100%; padding: 11px 18px; background: var(--verde); color: white; }
.botao-primario:hover { background: var(--verde-escuro); }
.botao-secundario { padding: 9px 14px; border: 1px solid var(--linha); background: white; color: var(--verde-escuro); }
/* Sem JS a zona de envio nao faz nada; esconde-la deixa o <noscript> falar. */
html:not(.tem-js) .exige-js {
  display: none;
}

.sem-js {
  margin-top: 20px;
  padding: 18px 20px;
  border-radius: 12px;
  background: var(--verde-claro);
  color: var(--texto);
}
.sem-js p { margin: 0 0 8px; }
.sem-js p:last-child { margin-bottom: 0; }

.aviso-ignorados {
  margin: 0 0 12px;
  padding: 11px 14px;
  border-radius: 10px;
  background: #fff6e6;
  color: #6b4400;
  font-size: 15px;
  font-weight: 700;
}
.nota-csv { min-height: 24px; margin: 10px 0 0; color: var(--texto-suave); font-size: 15px; text-align: center; }

.explicacao { padding: 68px 0 0; }
.explicacao ol { display: grid; gap: 14px; margin: 24px 0 0; padding: 0; list-style: none; }
.explicacao li { min-height: 92px; display: flex; gap: 14px; align-items: flex-start; padding: 18px; border: 1px solid var(--linha); border-radius: 14px; background: rgba(255,255,255,.62); }
.explicacao li > span { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 50%; background: var(--verde-claro); color: var(--verde-escuro); font-weight: 900; }
.explicacao p { margin: 3px 0 0; color: var(--texto-suave); }

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

.testes { max-width: 880px; margin: 0 auto; padding: 40px 16px 70px; }
.testes h1 { font-size: clamp(32px, 7vw, 48px); }
.testes-lista { display: grid; gap: 12px; margin-top: 28px; }
.teste-item { min-height: 70px; display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--linha); border-radius: 12px; background: white; }
.teste-item span { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 30px; border-radius: 50%; font-weight: 900; }
.teste-item[data-status="passou"] span { background: var(--verde-claro); color: var(--verde); }
.teste-item[data-status="falhou"] { border-color: #e6aaa5; }
.teste-item[data-status="falhou"] span { background: var(--erro-fundo); color: var(--erro); }
.teste-item p { margin: 0; }

@media (min-width: 720px) {
  .pagina { width: min(100% - 64px, 980px); }
  .cartao { padding: 24px; }
  .explicacao ol { grid-template-columns: repeat(3, 1fr); }
  .explicacao li { min-height: 154px; display: block; }
  .explicacao li > span { margin-bottom: 14px; }
  .acoes { justify-content: flex-end; }
  .botao-primario { width: auto; min-width: 240px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}
