/* VentIA — minimalista, legível no plantão (claro de dia, escuro à noite, conforme o celular). */
:root {
  --fundo: #f6f8f8;
  --cartao: #ffffff;
  --texto: #142022;
  --suave: #56676a;
  --linha: #dfe6e7;
  --marca: #0b6e6e;
  --marca-forte: #08595a;
  --marca-fundo: #e3f2f1;
  --aviso: #8a5a00;
  --aviso-fundo: #fff4dc;
  --perigo: #b42318;
  --perigo-fundo: #fdecea;
  --ok: #1d7a46;
  --ok-fundo: #e6f4ec;
  --raio: 14px;
  --sombra: 0 1px 2px rgba(16, 32, 34, .06), 0 2px 10px rgba(16, 32, 34, .05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fundo: #0d1416;
    --cartao: #152023;
    --texto: #e6eeef;
    --suave: #9aaeb1;
    --linha: #26363a;
    --marca: #3fbfb4;
    --marca-forte: #6ad3c9;
    --marca-fundo: #12312f;
    --aviso: #f3c46b;
    --aviso-fundo: #3a2c0d;
    --perigo: #ff8a80;
    --perigo-fundo: #3d1714;
    --ok: #6fd39b;
    --ok-fundo: #12301f;
    --sombra: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fundo); color: var(--texto);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
a { color: var(--marca); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--marca); outline-offset: 2px; border-radius: 6px; }

/* topo e navegação */
.topo {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1rem;
  padding: .6rem 1rem; padding-top: calc(.6rem + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--fundo) 88%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--linha);
}
.marca { display: flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--texto); font-size: 1.2rem; letter-spacing: -.01em; }
.marca b { color: var(--marca); }
.abas { display: none; gap: .25rem; margin-left: auto; }
.abas a, .conta { color: var(--suave); text-decoration: none; padding: .45rem .7rem; border-radius: 999px; font-size: .95rem; }
.abas a.ativa, .conta.ativa { color: var(--marca-forte); background: var(--marca-fundo); }
.conta { margin-left: auto; display: flex; padding: .4rem; }
.barra {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--cartao); border-top: 1px solid var(--linha); padding-bottom: env(safe-area-inset-bottom);
}
.barra a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .5rem 0 .45rem; color: var(--suave); text-decoration: none; font-size: .72rem; }
.barra svg { width: 24px; height: 24px; }
.barra a.ativa { color: var(--marca); font-weight: 600; }
@media (min-width: 820px) {
  .abas { display: flex; }
  .conta { margin-left: .25rem; }
  .barra { display: none; }
  body { padding-bottom: 2rem; }
}

main { max-width: 760px; margin: 0 auto; padding: 1rem 16px 2rem; outline: none; }
main:focus, main:focus-visible { outline: none; }
.carregando { color: var(--suave); text-align: center; padding: 3rem 0; }

/* blocos */
.cartao { background: var(--cartao); border: 1px solid var(--linha); border-radius: var(--raio); padding: 1rem; margin-bottom: 1rem; box-shadow: var(--sombra); }
.cartao > :last-child { margin-bottom: 0; }
.suave { color: var(--suave); }
.pequeno { font-size: .875rem; }
.titulo-tela { margin: .25rem 0 1rem; }
.titulo-tela p { color: var(--suave); margin: 0; }

.aviso-ia {
  display: flex; gap: .6rem; align-items: flex-start; border-radius: var(--raio); padding: .75rem .9rem; margin-bottom: 1rem;
  background: var(--aviso-fundo); color: var(--texto); border: 1px solid color-mix(in srgb, var(--aviso) 35%, transparent); font-size: .92rem;
}
.aviso-ia strong { color: var(--aviso); }
.aviso-ia svg { flex: none; width: 22px; height: 22px; color: var(--aviso); margin-top: 1px; }
.alerta-urgente { background: var(--perigo-fundo); border: 2px solid var(--perigo); border-radius: var(--raio); padding: .85rem 1rem; margin-bottom: 1rem; }
.alerta-urgente strong { color: var(--perigo); display: block; margin-bottom: .2rem; }

/* formulários */
label { display: block; font-weight: 600; font-size: .92rem; margin: .9rem 0 .3rem; }
label .suave { font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=search], textarea, select {
  width: 100%; font: inherit; color: var(--texto); background: var(--cartao); border: 1px solid var(--linha);
  border-radius: 10px; padding: .7rem .8rem; min-height: 46px;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--marca); box-shadow: 0 0 0 3px var(--marca-fundo); }
.marcar { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; font-size: .9rem; margin-top: 1rem; }
.marcar input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--marca); }

.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font: inherit; font-weight: 600;
  border: 0; border-radius: 12px; padding: .8rem 1.1rem; min-height: 48px; cursor: pointer; text-decoration: none;
  background: var(--marca); color: #fff;
}
@media (prefers-color-scheme: dark) { .botao { color: #062523; } }
.botao:hover { background: var(--marca-forte); }
.botao:disabled { opacity: .55; cursor: not-allowed; }
.botao.cheio { width: 100%; }
.botao.claro { background: var(--marca-fundo); color: var(--marca-forte); }
.botao.contorno { background: transparent; color: var(--texto); border: 1px solid var(--linha); }
.botao.perigo { background: transparent; color: var(--perigo); border: 1px solid color-mix(in srgb, var(--perigo) 40%, transparent); }
.botoes { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.erro-form { color: var(--perigo); font-size: .92rem; margin-top: .75rem; }
.ok-form { color: var(--ok); font-size: .92rem; margin-top: .75rem; }

/* entrar */
.entrada { max-width: 420px; margin: 2rem auto 0; }
.entrada .marca { justify-content: center; font-size: 1.8rem; margin-bottom: .25rem; }
.entrada .marca img { width: 40px; height: 40px; }
.entrada .lema { text-align: center; color: var(--suave); margin-bottom: 1.25rem; }
.alternar { display: grid; grid-template-columns: 1fr 1fr; background: var(--linha); border-radius: 12px; padding: 3px; margin-bottom: .5rem; }
.alternar button { font: inherit; border: 0; background: transparent; color: var(--suave); padding: .55rem; border-radius: 10px; cursor: pointer; }
.alternar button[aria-pressed=true] { background: var(--cartao); color: var(--texto); font-weight: 600; box-shadow: var(--sombra); }

/* nova análise */
.foto-zona { border: 2px dashed var(--linha); border-radius: var(--raio); padding: 1.25rem 1rem; text-align: center; background: var(--cartao); }
.foto-zona .botoes { justify-content: center; }
.foto-zona input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.previa { position: relative; border-radius: var(--raio); overflow: hidden; background: #000; }
.previa img { display: block; width: 100%; max-height: 60vh; object-fit: contain; }
.previa button { position: absolute; top: .5rem; right: .5rem; }
.dicas-rapidas { margin: 0; padding-left: 1.2rem; }
.dicas-rapidas li { margin-bottom: .3rem; }
details.cartao summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.cartao summary::-webkit-details-marker { display: none; }
details.cartao summary::after { content: "+"; color: var(--suave); font-size: 1.3rem; line-height: 1; }
details.cartao[open] summary::after { content: "–"; }
details.cartao[open] summary { margin-bottom: .6rem; }

/* análise em andamento */
.analisando { text-align: center; padding: 2rem 1rem; }
.onda { width: 180px; height: 48px; margin: 0 auto 1rem; display: block; color: var(--marca); }
.onda path { stroke-dasharray: 260; stroke-dashoffset: 260; animation: desenhar 2.2s ease-in-out infinite; }
@keyframes desenhar { to { stroke-dashoffset: -260; } }
@media (prefers-reduced-motion: reduce) { .onda path { animation: none; stroke-dashoffset: 0; } }

/* resultado */
.foto-caso { display: block; border-radius: var(--raio); overflow: hidden; margin-bottom: 1rem; background: #000; }
.foto-caso img { display: block; width: 100%; max-height: 55vh; object-fit: contain; }
.etiqueta { display: inline-block; font-size: .75rem; font-weight: 600; padding: .12rem .5rem; border-radius: 999px; background: var(--linha); color: var(--suave); white-space: nowrap; }
.etiqueta.urgente, .etiqueta.presente { background: var(--perigo-fundo); color: var(--perigo); }
.etiqueta.atencao, .etiqueta.possivel { background: var(--aviso-fundo); color: var(--aviso); }
.etiqueta.informativo { background: var(--marca-fundo); color: var(--marca-forte); }
.etiqueta.ausente { background: var(--ok-fundo); color: var(--ok); }
.etiqueta.agora { background: var(--perigo-fundo); color: var(--perigo); }
.etiqueta.em_breve { background: var(--aviso-fundo); color: var(--aviso); }
.lista-limpa { list-style: none; margin: 0; padding: 0; }
.item { border-top: 1px solid var(--linha); padding: .75rem 0; }
.item:first-child { border-top: 0; padding-top: 0; }
.item:last-child { padding-bottom: 0; }
.item-topo { display: flex; justify-content: space-between; gap: .75rem; align-items: baseline; margin-bottom: .25rem; }
.item-topo strong { font-weight: 600; }
.achado { border-left: 4px solid var(--linha); padding-left: .75rem; }
.achado.urgente { border-left-color: var(--perigo); }
.achado.atencao { border-left-color: var(--aviso); }
.achado.informativo { border-left-color: var(--marca); }
.evid { font-size: .9rem; color: var(--suave); margin: .2rem 0 0; }
table.parametros { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.parametros td, table.parametros th { text-align: left; padding: .45rem .3rem; border-top: 1px solid var(--linha); vertical-align: top; }
table.parametros th { font-weight: 600; color: var(--suave); font-size: .8rem; border-top: 0; }
table.parametros td.valor { font-variant-numeric: tabular-nums; font-weight: 600; }
table.parametros .origem { margin-top: .2rem; font-weight: 400; }
.checagem li { display: flex; gap: .5rem; align-items: flex-start; margin-bottom: .45rem; }
.checagem li::before { content: ""; flex: none; width: 16px; height: 16px; margin-top: 4px; border: 2px solid var(--marca); border-radius: 4px; }
.refs a { text-decoration: none; }
.refs li { margin-bottom: .5rem; }
.rodape-caso { font-size: .82rem; color: var(--suave); }
.grade-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem 1rem; }
.grade-2 dt { color: var(--suave); font-size: .82rem; }
.grade-2 dd { margin: 0 0 .25rem; font-weight: 600; }

/* histórico */
.busca { margin-bottom: 1rem; }
.caso-linha { display: block; text-decoration: none; color: inherit; }
.caso-linha:hover { border-color: var(--marca); }
.caso-linha .data { font-size: .82rem; color: var(--suave); }
.caso-linha .resumo { color: var(--suave); font-size: .92rem; margin: .3rem 0 .5rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.marcas { display: flex; gap: .35rem; flex-wrap: wrap; }
.vazio { text-align: center; color: var(--suave); padding: 2.5rem 1rem; }

/* estudos */
.filtros { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .5rem; margin-bottom: .75rem; scrollbar-width: none; }
@media (min-width: 620px) { .filtros { flex-wrap: wrap; overflow: visible; } }
.filtros button { font: inherit; font-size: .88rem; border: 1px solid var(--linha); background: var(--cartao); color: var(--texto); border-radius: 999px; padding: .4rem .8rem; white-space: nowrap; cursor: pointer; }
.filtros button[aria-pressed=true] { background: var(--marca); border-color: var(--marca); color: #fff; }
@media (prefers-color-scheme: dark) { .filtros button[aria-pressed=true] { color: #062523; } }
.estudo h3 { margin-bottom: .2rem; }
.estudo .meta { font-size: .85rem; color: var(--suave); margin-bottom: .6rem; }
.estudo .pratica { background: var(--marca-fundo); border-radius: 10px; padding: .6rem .75rem; font-size: .93rem; }
.estudo .pratica strong { color: var(--marca-forte); }

/* guia */
.passos { counter-reset: passo; list-style: none; padding: 0; margin: 0; }
.passos li { counter-increment: passo; position: relative; padding-left: 2.6rem; margin-bottom: 1rem; }
.passos li::before { content: counter(passo); position: absolute; left: 0; top: 0; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--marca-fundo); color: var(--marca-forte); font-weight: 700; display: grid; place-items: center; font-size: .9rem; }
.passos li strong { display: block; }
.sim-nao { display: grid; gap: 1rem; }
@media (min-width: 620px) { .sim-nao { grid-template-columns: 1fr 1fr; } }
.sim-nao ul { margin: 0; padding-left: 1.1rem; }
.sim h3 { color: var(--ok); }
.nao h3 { color: var(--perigo); }
