/* Tema claro estilo "relatório de consulta". Para trocar a cor da marca, mude só --marca-h. */
:root {
  --marca-h: 262;
  --marca: hsl(var(--marca-h) 83% 58%);
  --marca-escura: hsl(var(--marca-h) 75% 46%);
  --marca-clara: hsl(var(--marca-h) 100% 97%);
  --texto: hsl(222 25% 15%);
  --suave: hsl(220 14% 46%);
  --borda: hsl(220 14% 91%);
  --fundo: #fff;
  --fundo-alt: hsl(var(--marca-h) 60% 97.5%);
  --perigo: hsl(0 78% 56%);
  --perigo-claro: hsl(0 90% 97%);
  --alerta: hsl(36 92% 48%);
  --alerta-claro: hsl(40 100% 96%);
  --ok: hsl(142 70% 36%);
  --ok-claro: hsl(142 70% 96%);
  --raio: 14px;
  --sombra-sm: 0 2px 8px -2px hsl(222 25% 20% / .08);
  --sombra-md: 0 10px 28px -8px hsl(222 25% 20% / .14);
  --sombra-marca: 0 10px 28px -8px hsl(var(--marca-h) 83% 58% / .45);
  --grad-marca: linear-gradient(135deg, hsl(var(--marca-h) 83% 60%), hsl(calc(var(--marca-h) + 18) 80% 50%));
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--texto); background: var(--fundo);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}

/* topo */
.topo {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: hsl(0 0% 100% / .85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--borda);
}
.ic { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.15em; }
.logo { display: flex; align-items: center; gap: 9px; }
.logo img { filter: drop-shadow(0 4px 10px hsl(var(--marca-h) 83% 58% / .35)); }
.logo-texto { display: flex; flex-direction: column; line-height: 1.05; }
.logo-texto b { font-size: 1.02rem; font-weight: 800; letter-spacing: -.3px; }
.logo-texto small { font-size: .7rem; font-weight: 600; color: var(--suave); letter-spacing: .01em; }
.selo-topo { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 700; color: var(--ok); background: var(--ok-claro); padding: 5px 10px; border-radius: 99px; white-space: nowrap; }

/* fundo com gradiente no topo, como página de consulta */
.palco { background: linear-gradient(180deg, hsl(var(--marca-h) 100% 96.5%) 0%, #fff 340px); min-height: calc(100vh - 55px); }
main { max-width: 560px; margin: 0 auto; padding: 24px 16px 64px; }

/* etapas */
.etapas { display: flex; gap: 6px; margin: 0 0 22px; }
.etapas span { flex: 1; height: 5px; border-radius: 99px; background: var(--borda); transition: background .3s; }
.etapas span.feita { background: var(--marca); }

.tela { display: none; }
.tela.ativa { display: block; animation: entra .35s ease; }
@keyframes entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; color: var(--marca-escura); background: var(--marca-clara); border: 1px solid hsl(var(--marca-h) 80% 90%); padding: 5px 12px; border-radius: 99px; margin-bottom: 12px; }
h1 { font-size: 1.75rem; line-height: 1.15; letter-spacing: -.6px; font-weight: 800; margin: 0 0 10px; }
h1 em { font-style: normal; background: var(--grad-marca); -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { font-size: 1.3rem; line-height: 1.3; letter-spacing: -.3px; font-weight: 800; margin: 6px 0 18px; }
.sub { color: var(--suave); margin: 0 0 20px; }
.erro { color: var(--perigo); font-weight: 600; }

/* caixa de envio = "campo de consulta" */
.caixa-arquivo {
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
  background: #fff; border: 2px dashed hsl(var(--marca-h) 70% 82%); border-radius: var(--raio);
  padding: 30px 18px; cursor: pointer; box-shadow: var(--sombra-md); transition: border-color .2s, transform .2s;
}
.caixa-arquivo:hover { border-color: var(--marca); transform: translateY(-1px); }
.caixa-arquivo .icone { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 14px; background: var(--marca-clara); color: var(--marca); font-size: 1.6rem; }
.caixa-arquivo b { font-size: 1.02rem; }
.caixa-arquivo small { color: var(--suave); }
.caixa-arquivo input { display: none; }

.confianca { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0; }
.confianca div { background: #fff; border: 1px solid var(--borda); border-radius: 12px; padding: 10px 6px; text-align: center; font-size: .74rem; font-weight: 600; color: var(--suave); box-shadow: var(--sombra-sm); }
.confianca .ic { display: block; margin: 0 auto 5px; font-size: 1.25rem; color: var(--marca); }

.ajuda { margin-top: 8px; background: #fff; border: 1px solid var(--borda); border-radius: 12px; padding: 12px 14px; box-shadow: var(--sombra-sm); }
.ajuda summary { cursor: pointer; font-weight: 700; }
.ajuda p { font-size: .92rem; color: var(--suave); margin: 10px 0 0; }

/* botões */
.botoes { display: flex; flex-direction: column; gap: 10px; }
.botao {
  display: block; width: 100%; padding: 16px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--grad-marca); color: #fff; font: inherit; font-weight: 800; font-size: 1.02rem; text-align: center; text-decoration: none;
  box-shadow: var(--sombra-marca); transition: transform .15s, box-shadow .15s;
}
.botao:hover { transform: translateY(-1px); }
.botao.opcao {
  background: #fff; color: var(--texto); font-weight: 600; text-align: left; box-shadow: var(--sombra-sm);
  border: 1.5px solid var(--borda); display: flex; align-items: center; gap: 12px;
}
.botao.opcao::before { content: ""; width: 18px; height: 18px; flex: none; border-radius: 50%; border: 2px solid hsl(220 14% 80%); }
.botao.opcao:hover { border-color: var(--marca); background: var(--marca-clara); }
.botao.opcao:hover::before { border-color: var(--marca); box-shadow: inset 0 0 0 4px #fff; background: var(--marca); }
.link { background: none; border: 0; color: var(--suave); margin-top: 16px; cursor: pointer; font: inherit; font-size: .95rem; }

/* questionário */
.contador { color: var(--marca-escura); font-weight: 700; font-size: .82rem; margin: 0 0 4px; text-transform: uppercase; letter-spacing: .06em; }
.progresso { height: 6px; background: var(--borda); border-radius: 99px; overflow: hidden; margin-bottom: 18px; }
.barra { height: 100%; width: 0; background: var(--grad-marca); transition: width .3s; }
.cartao-pergunta { background: #fff; border: 1px solid var(--borda); border-radius: var(--raio); padding: 20px; box-shadow: var(--sombra-md); }

/* analisando */
#tela-analisando { text-align: center; padding-top: 20px; }
.radar { width: 110px; height: 110px; margin: 10px auto 22px; border-radius: 50%; position: relative; overflow: hidden; background: #fff; box-shadow: var(--sombra-md); border: 1px solid var(--borda); }
.radar img { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 1; }
.radar::after { content: ""; position: absolute; inset: 0; background: conic-gradient(from 0deg, hsl(var(--marca-h) 83% 58% / .35), transparent 35%); animation: gira 1.4s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
.checklist { list-style: none; padding: 0; margin: 18px auto 0; max-width: 340px; text-align: left; }
.checklist li { padding: 8px 0; color: var(--suave); display: flex; gap: 10px; align-items: center; font-size: .95rem; }
.checklist li::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--borda); flex: none; }
.checklist li.feito { color: var(--texto); font-weight: 600; }
.checklist li.feito::before { content: "✓"; display: grid; place-items: center; font-size: .7rem; color: #fff; background: var(--ok); border-color: var(--ok); }

/* relatório */
.cabecalho-rel { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.cabecalho-rel small { color: var(--suave); }
.cartao { background: #fff; border: 1px solid var(--borda); border-radius: var(--raio); padding: 18px; margin-bottom: 14px; box-shadow: var(--sombra-sm); }
.chip .ic { font-size: .95rem; }
.rotulo .ic { font-size: 1.05rem; color: var(--marca); }
.rotulo.centro { justify-content: center; }
.grafico { position: relative; height: 220px; }
.rotulo { display: flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--suave); margin: 0 0 12px; }
.indice { text-align: center; padding: 24px 18px; background: linear-gradient(180deg, #fff, var(--fundo-alt)); box-shadow: var(--sombra-md); }
.indice .numero { font-family: Oswald, Inter, sans-serif; font-size: 4.6rem; font-weight: 700; line-height: 1; color: var(--texto); }
.indice .numero small { font-size: 1.4rem; color: var(--suave); font-weight: 500; }
.status { display: inline-block; margin: 10px 0 16px; padding: 6px 14px; border-radius: 99px; font-weight: 800; font-size: .88rem; }
.status.ok { color: var(--ok); background: var(--ok-claro); }
.status.alerta { color: var(--alerta); background: var(--alerta-claro); }
.status.perigo { color: var(--perigo); background: var(--perigo-claro); }
.medidor { position: relative; height: 10px; border-radius: 99px; background: linear-gradient(90deg, var(--ok), var(--alerta), var(--perigo)); }
#medidor-ponteiro { position: absolute; top: -6px; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%; background: #fff; border: 4px solid var(--texto); transition: left 1.5s cubic-bezier(.2,.8,.2,1); left: 0; box-shadow: var(--sombra-sm); }
.medidor-legenda { display: flex; justify-content: space-between; font-size: .72rem; color: var(--suave); margin-top: 8px; }

.virada { font-family: Oswald, Inter, sans-serif; font-size: 1.7rem; font-weight: 600; margin: 0 0 12px; color: var(--perigo); }

.sinais { list-style: none; padding: 0; margin: 0; }
.sinais li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--borda); font-size: .95rem; }
.sinais li:last-child { border-bottom: 0; }
.sinais .tag { flex: none; font-size: .68rem; font-weight: 800; padding: 3px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
.sinais .tag.perigo { color: var(--perigo); background: var(--perigo-claro); }
.sinais .tag.ok { color: var(--ok); background: var(--ok-claro); }
.borrado { filter: blur(4px); cursor: pointer; user-select: none; }

.bloqueavel { position: relative; }
.bloqueado { cursor: pointer; min-height: 110px; }
.bloqueado > * { filter: blur(7px); user-select: none; pointer-events: none; }
.bloqueado::after {
  content: "Liberar no plano Completo"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  white-space: nowrap; font-weight: 800; font-size: .9rem; color: #fff; padding: 10px 16px 10px 38px; border-radius: 99px; box-shadow: var(--sombra-marca);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='11' width='16' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E") 14px center / 16px no-repeat, var(--grad-marca);
}

.texto-ia p { margin: 0 0 12px; }
.aviso { font-size: .78rem; color: var(--suave); margin-top: 20px; text-align: center; }

/* formulários */
.formulario { display: flex; flex-direction: column; gap: 10px; }
.campo {
  width: 100%; padding: 14px 14px; border: 1.5px solid var(--borda); border-radius: 12px; background: #fff;
  font: inherit; font-size: 16px; color: var(--texto); box-shadow: var(--sombra-sm); outline: none; transition: border-color .15s;
}
.campo:focus { border-color: var(--marca); box-shadow: 0 0 0 4px hsl(var(--marca-h) 83% 58% / .12); }
textarea.campo { resize: vertical; min-height: 84px; }
.campo.codigo { text-align: center; font-size: 1.6rem; font-weight: 800; letter-spacing: .4em; }
.linha3 { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; }
.linha3 label { font-size: .78rem; font-weight: 700; color: var(--suave); display: flex; flex-direction: column; gap: 4px; }
.linha3 .campo { padding: 11px 8px; font-size: 15px; }
.info-creditos { font-size: .9rem; color: var(--suave); text-align: center; margin: 12px 0 0; }
.botao.secundario-claro { background: var(--marca-clara); color: var(--marca-escura); box-shadow: none; }
.rodape-app[hidden] { display: none; }
.rodape-app { text-align: center; font-size: .8rem; color: var(--suave); margin-top: 26px; }
.rodape-app .link { margin: 0; font-size: .8rem; text-decoration: underline; }
#tela-carregando { padding-top: 80px; }

/* trechos antes x agora */
.trecho { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--borda); }
.trecho:last-child { border-bottom: 0; }
.trecho > div { flex: 1; min-width: 0; }
.trecho-num { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 800; color: var(--marca-escura); background: var(--marca-clara); }
.balao { border-radius: 4px 14px 14px 14px; padding: 9px 12px; margin-bottom: 6px; font-size: .93rem; max-width: 92%; word-wrap: break-word; }
.balao small { display: block; font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.balao.antes { background: var(--ok-claro); }
.balao.antes small { color: var(--ok); }
.balao.agora { background: var(--perigo-claro); }
.balao.agora small { color: var(--perigo); }
.trecho-exp { font-size: .88rem; color: var(--suave); margin: 4px 0 0; }

/* roteiro */
.passos { counter-reset: p; list-style: none; padding: 0; margin: 0; }
.passos li { counter-increment: p; position: relative; padding: 0 0 16px 40px; }
.passos li::before { content: counter(p); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; color: #fff; background: var(--grad-marca); }
.passos li b { display: block; margin: 3px 0 4px; }
.passos li p { margin: 0; font-size: .93rem; color: hsl(222 15% 30%); }

/* checador */
.extra { border-color: hsl(var(--marca-h) 70% 88%); background: linear-gradient(180deg, #fff, var(--fundo-alt)); }
.veredito { display: flex; flex-direction: column; align-items: center; padding: 14px; border-radius: 12px; margin: 16px 0 10px; }
.veredito small { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.veredito b { font-family: Oswald, Inter, sans-serif; font-size: 1.8rem; font-weight: 600; }
.veredito.ok { background: var(--ok-claro); color: var(--ok); }
.veredito.alerta { background: var(--alerta-claro); color: var(--alerta); }
.veredito.perigo { background: var(--perigo-claro); color: var(--perigo); }
.pontos { padding-left: 18px; margin: 0 0 12px; }
.pontos li { margin-bottom: 6px; font-size: .93rem; }
.pergunta-sugerida { background: #fff; border: 1px dashed hsl(var(--marca-h) 70% 80%); border-radius: 12px; padding: 12px 14px; }
.pergunta-sugerida small { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--marca-escura); }
.pergunta-sugerida p { margin: 4px 0 0; font-weight: 600; }

/* modal */
.modal { position: fixed; inset: 0; background: hsl(222 30% 10% / .55); backdrop-filter: blur(3px); display: flex; align-items: flex-end; justify-content: center; padding: 16px; z-index: 10; }
.modal[hidden] { display: none; }
.modal-caixa { background: #fff; border-radius: 18px; padding: 24px 20px; max-width: 440px; width: 100%; text-align: center; box-shadow: var(--sombra-md); animation: sobe .3s ease; }
@keyframes sobe { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 600px) { .modal { align-items: center; } }
