/* Tema VHE: mesmas cores e fontes do site vheengenharia.com.br (site-core.css) */
:root {
  --vhered: #e31e24;
  --vhered-texto: #bd1420;
  --ink: #0e1116;
  --ink2: #1a1f26;
  --steel: #1e3a5f;
  --bone: #fafafa;
  --line: #e5e7eb;
  --fundo: var(--bone);
  --cartao: #ffffff;
  --texto: var(--ink);
  --texto-suave: rgba(14, 17, 22, .65);
  --ok: #047857;
  --ok-fundo: #d1fae5;
  --nc: #b91c1c;
  --nc-fundo: #fee2e2;
  --na: #475569;
  --na-fundo: #e2e8f0;
  --nv: #92400e;
  --nv-fundo: #fef3c7;
}
@media (prefers-color-scheme: dark) {
  :root {
    --vhered-texto: #ff858b;
    --fundo: var(--ink);
    --cartao: var(--ink2);
    --texto: #ffffff;
    --texto-suave: rgba(255, 255, 255, .7);
    --line: rgba(255, 255, 255, .12);
    --ok: #6ee7b7; --ok-fundo: rgba(16, 185, 129, .18);
    --nc: #fca5a5; --nc-fundo: rgba(239, 68, 68, .18);
    --na: #cbd5e1; --na-fundo: rgba(148, 163, 184, .18);
    --nv: #fcd34d; --nv-fundo: rgba(251, 191, 36, .18);
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: var(--fundo);
  color: var(--texto);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: Sora, system-ui, sans-serif; line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* Topo claro como o site, para o logo oficial (vermelho e azul) aparecer com as cores certas */
.topo { background: #fff; color: var(--ink); border-bottom: 3px solid var(--vhered); }
.topo-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.marca { display: flex; align-items: center; }
.marca img { height: 46px; width: auto; display: block; }
.topo-tag { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .16em; color: var(--steel); }
@media (max-width: 420px) { .marca img { height: 38px; } .topo-tag { font-size: .7rem; letter-spacing: .1em; } }

main { padding: 32px 0 120px; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: .75rem; font-weight: 700; color: var(--vhered-texto); margin: 0 0 .5rem; }
.lead { color: var(--texto-suave); max-width: 42rem; margin: 0 0 1.5rem; }

.cartao {
  background: var(--cartao);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 20px;
  box-shadow: 0 10px 40px -10px rgba(14, 17, 22, .12);
}

#form-dados { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { #form-dados { grid-template-columns: 1fr 1fr; } }
.campo { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; }
.campo-full { grid-column: 1 / -1; }
.campo small { font-weight: 400; color: var(--texto-suave); }
input, select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: var(--fundo);
}
textarea { min-height: 64px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 3px solid var(--steel);
  outline-offset: 2px;
}

.acoes { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.acoes-fixas {
  position: sticky; bottom: 0; padding: 12px 0;
  background: linear-gradient(to top, var(--fundo) 70%, transparent);
  justify-content: flex-end;
}
.btn {
  min-height: 44px; padding: 10px 20px; border-radius: 999px;
  font-weight: 700; cursor: pointer; border: 2px solid transparent;
}
.btn-primario { background: var(--vhered); color: #fff; }
.btn-primario:hover { filter: brightness(1.08); }
.btn-secundario { background: transparent; border-color: var(--line); }
.btn-secundario:hover { border-color: var(--vhered); }
.link { background: none; border: 0; text-decoration: underline; cursor: pointer; color: var(--texto-suave); padding: 0; }

.bloco-ia { display: grid; gap: 16px; padding: 16px; border: 2px dashed var(--steel); border-radius: 1rem; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; font-size: .9rem; }
.check input { width: 20px; min-height: 20px; height: 20px; flex: none; }
.modo-ia { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
.modo-ia legend { font-weight: 600; font-size: .9rem; margin-bottom: 8px; padding: 0; }
.status-ia { margin: 0; padding: 12px 14px; border-radius: .75rem; background: rgba(30, 58, 95, .1); font-weight: 600; }
.status-ia.erro { background: var(--nc-fundo); color: var(--nc); }
.armadilha { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.aviso-privacidade { margin: 0; font-size: .8rem; color: var(--texto-suave); }
.aviso-privacidade a { color: inherit; }
.painel-ia { margin-bottom: 16px; border-left: 4px solid var(--steel); }
.painel-ia h2 { font-size: 1rem; margin-top: 12px; }
.painel-ia ul { margin: 6px 0 0; padding-left: 20px; }
.selo-ia { display: inline-block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: #fff; background: var(--steel); padding: 3px 10px; border-radius: 999px; }
.trecho { margin-top: 8px; font-size: .85rem; }
.trecho summary { cursor: pointer; color: var(--steel); font-weight: 600; }
@media (prefers-color-scheme: dark) { .trecho summary { color: #9cc3f0; } }
.trecho blockquote { margin: 6px 0 0; padding: 8px 12px; border-left: 3px solid var(--line); color: var(--texto-suave); font-style: italic; }
.rel-ia { margin: 12px 0; padding: 12px 14px; border: 1px solid #c7d2e0; border-radius: .75rem; background: #f1f5f9; font-size: .88rem; }
.rel-ia ul { margin: 6px 0 0; padding-left: 20px; }

.bloco-codigo { margin-bottom: 16px; padding: 14px 20px; }
.linha-codigo { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.linha-codigo input { flex: 1 1 180px; text-transform: uppercase; letter-spacing: .08em; }
.bloco-codigo .status-ia { margin-top: 10px; }
.bloco-folha { margin-bottom: 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; border-left: 4px solid var(--vhered); }
.bloco-folha h2 { font-size: 1rem; margin: 0 0 4px; }
.bloco-folha p { margin: 0; font-size: .9rem; color: var(--texto-suave); max-width: 46rem; }

.legenda { margin-bottom: 16px; }
.legenda p { margin: 0; }
.aviso { margin-top: 6px !important; color: var(--texto-suave); font-size: .9rem; }

.progresso { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.barra { height: 100%; width: 0; background: var(--vhered); transition: width .2s; }
.progresso-texto { font-size: .85rem; color: var(--texto-suave); margin: 6px 0 20px; }

.secao { margin-bottom: 24px; }
.secao h2 { padding-bottom: 8px; border-bottom: 2px solid var(--vhered); margin-bottom: 12px; }
.item { margin-bottom: 12px; }
.item-topo { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; justify-content: space-between; }
.item-ref {
  font-size: .75rem; font-weight: 700; color: var(--steel);
  background: rgba(30, 58, 95, .1); padding: 2px 8px; border-radius: 999px;
}
@media (prefers-color-scheme: dark) { .item-ref { color: #9cc3f0; background: rgba(156, 195, 240, .12); } }
.item-verificar { color: var(--texto-suave); margin: 6px 0 10px; font-size: .95rem; }

.opcoes { display: flex; gap: 8px; flex-wrap: wrap; }
.opcao { position: relative; }
.opcao input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opcao span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 56px; min-height: 44px; padding: 0 14px;
  border: 2px solid var(--line); border-radius: .75rem;
  font-weight: 700; cursor: pointer; user-select: none;
}
.opcao input:focus-visible + span { outline: 3px solid var(--steel); outline-offset: 2px; }
.opcao input[value="C"]:checked + span { background: var(--ok-fundo); color: var(--ok); border-color: var(--ok); }
.opcao input[value="NC"]:checked + span { background: var(--nc-fundo); color: var(--nc); border-color: var(--nc); }
.opcao input[value="NA"]:checked + span { background: var(--na-fundo); color: var(--na); border-color: var(--na); }
.opcao input[value="NV"]:checked + span { background: var(--nv-fundo); color: var(--nv); border-color: var(--nv); }
.item textarea { margin-top: 10px; }
.item.falta-motivo textarea { border-color: var(--nc); }
.erro-motivo { color: var(--nc); font-size: .85rem; margin: 4px 0 0; }

/* Relatório */
.relatorio { background: #fff; color: var(--ink); border-radius: 1rem; padding: 28px; margin-top: 16px; border: 1px solid #e5e7eb; }
.rel-cabecalho { display: flex; justify-content: space-between; gap: 16px; border-bottom: 3px solid var(--vhered); padding-bottom: 12px; margin-bottom: 16px; }
/* Marca do cliente em destaque; VHE só na assinatura do rodapé */
.rel-empresa { font-family: Sora, Arial, sans-serif; font-size: 1.7rem; font-weight: 800; margin: 0 0 2px; color: var(--ink); line-height: 1.15; }
.rel-cabecalho h1 { font-size: 1.1rem; margin: 0 0 4px; color: #374151; }
.rel-data { text-align: right; white-space: nowrap; }
.rel-assinatura { margin-top: 18px; padding-top: 8px; border-top: 1px solid #e5e7eb; font-size: .72rem; color: #9ca3af; text-align: center; }

/* Folha de campo */
.folha-cabecalho { align-items: flex-start; }
.folha-cabecalho > div:first-child { flex: 1; }
.folha-dados { margin: 8px 0 0; }
.folha-qr { width: 190px; text-align: center; flex: none; }
.folha-qr svg { width: 150px; height: 150px; display: block; margin: 0 auto 4px; }
.folha-qr p { margin: 0; font-size: 1rem; letter-spacing: .06em; }
.folha-qr small { display: block; font-size: .68rem; color: #4b5563; line-height: 1.3; }
.folha-tabela td { height: 34px; }
.folha-tabela .col-obs { width: 22%; }
.caixa { display: inline-block; width: 16px; height: 16px; border: 1.5px solid #374151; border-radius: 2px; }
.folha-assinatura { margin-top: 22px; font-size: .9rem; }
.rel-dados { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: .9rem; }
.rel-dados th { text-align: left; width: 34%; color: #4b5563; font-weight: 600; }
.rel-dados th, .rel-dados td { padding: 6px 8px; border-bottom: 1px solid #e5e7eb; vertical-align: top; }
.rel-resumo { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 12px 0 20px; }
@media (min-width: 640px) { .rel-resumo { grid-template-columns: repeat(5, 1fr); } }
.rel-num { border-radius: .75rem; padding: 10px; text-align: center; border: 1px solid #e5e7eb; }
.rel-num b { display: block; font-family: Sora, sans-serif; font-size: 1.5rem; }
.rel-num.c b { color: #047857; } .rel-num.nc b { color: #b91c1c; }
.rel-num.na b { color: #475569; } .rel-num.nv b { color: #92400e; }
/* Padrão dos relatórios VHE: faixa vermelha com detalhe azul e tabela de cabeçalho vermelho */
.relatorio h1 { font-family: Inter, Arial, sans-serif; font-size: 1.5rem; margin-bottom: 12px; }
.rel-secao {
  font-family: Inter, Arial, sans-serif; font-size: 1.05rem; font-weight: 800; text-transform: uppercase;
  color: #fff; background: #d50f18; padding: 4px 10px; margin: 22px 0 10px;
  box-shadow: -10px 0 0 -6px #29a3e0; margin-left: 8px;
}
.rel-legenda { margin: 0 0 12px; font-size: .9rem; }
.rel-sub { font-family: Inter, Arial, sans-serif; font-size: 1rem; font-weight: 700; margin: 16px 0 6px; }
.rel-tabela-wrap { overflow-x: auto; }
.rel-tabela { width: 100%; border-collapse: collapse; font-size: .8rem; min-width: 640px; }
.rel-tabela th { background: #d50f18; color: #fff; text-align: center; padding: 6px 4px; border: 1px solid #fff; font-weight: 700; }
.rel-tabela td { border: 1px solid #d1d5db; padding: 6px; vertical-align: top; }
.rel-tabela .col-n { width: 42px; text-align: center; white-space: nowrap; }
.rel-tabela .col-item { width: 22%; }
.rel-tabela .col-st { width: 34px; text-align: center; font-weight: 800; }
.rel-ref { display: block; font-size: .72rem; color: #1e3a5f; margin-top: 2px; }
.rel-tabela td.marcado { background: #f3f4f6; }
.st-C { color: #047857; } .st-NC { color: #b91c1c; } .st-NA { color: #475569; } .st-NV { color: #92400e; }
.rel-aviso { margin-top: 20px; padding: 14px; border-left: 4px solid var(--vhered); background: #fef2f2; font-size: .9rem; }
.rel-fontes { font-size: .75rem; color: #6b7280; margin-top: 16px; }

.rodape { border-top: 1px solid var(--line); padding: 20px 0; font-size: .85rem; color: var(--texto-suave); }
.rodape p { margin: 0 0 8px; }

@media print {
  body { background: #fff; }
  /* Folha de campo: imprime só ela; no relatório normal ela nunca aparece */
  body.imprimir-folha > *:not(#folha) { display: none !important; }
  body:not(.imprimir-folha) #folha { display: none !important; }
  .folha { padding: 0; border: 0; }
  .topo, .nao-imprime, .rodape { display: none !important; }
  main { padding: 0; }
  .wrap { max-width: none; padding: 0; }
  .relatorio { border: 0; padding: 0; margin: 0; border-radius: 0; }
  .rel-tabela tr { break-inside: avoid; }
  .rel-tabela { min-width: 0; }
  .rel-secao, .rel-tabela th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rel-tabela td.marcado { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Barra de privacidade da Central (GA4) fora da impressão */
@media print { #vhe-privacy, #vhe-privacy-open { display: none !important; } }
