/* Firme: visual do app. Cores do protótipo: índigo da caneta, laranja da proteína,
   azul da água, verde da fibra. Fonte do próprio aparelho (nada carregado de fora). */
:root {
  color-scheme: light dark;
  --bg: light-dark(#ffffff, #121018);
  --tinta: light-dark(#17131f, #f1edf7);
  --mudo: light-dark(#625b6e, #a8a1b7);
  --s1: light-dark(#f4f2f7, #1d1a26);
  --s2: light-dark(#e6e2ee, #2e2a3a);
  --linha: light-dark(#e4e0ea, #2e2a3a);
  --pro: #e84e12;
  --pro-texto: light-dark(#c2410c, #ff8a5c);
  --caneta: light-dark(#3a2fd6, #8f86ff);
  --agua: #1e88e5;
  --fibra: #2e9b57;
  --campo: #231d5e;
  --raio: 18px;
  --abas: 72px;
}
* { box-sizing: border-box; min-width: 0; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--tinta);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%; overflow-x: clip;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--caneta); }
h1 { font-size: 26px; line-height: 1.15; letter-spacing: -.02em; margin: 6px 0 8px; }
h3 { font-size: 16px; margin: 0 0 8px; }
p { margin: 0 0 12px; }
ul { margin: 0; padding-left: 20px; }
li { margin-bottom: 6px; }

.app { max-width: 560px; margin: 0 auto; min-height: 100svh; }
.carregando { text-align: center; padding: 40vh 20px 0; color: var(--mudo); }
.tela { padding: 8px 16px calc(var(--abas) + 28px + env(safe-area-inset-bottom)); }
.oculto { display: none !important; }
.sub { color: var(--mudo); font-size: 14px; }
p.sub { margin: 0 0 12px; }
.sem-margem { margin: 0 !important; }
.centro { text-align: center; }

/* ---------------------------------------------------------------- topo, faixa, abas */
.topo {
  position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px 16px; background: var(--bg); border-bottom: 1px solid var(--linha);
}
.marca-topo { background: none; border: 0; font-weight: 800; font-size: 20px; letter-spacing: -.02em; padding: 8px 0; cursor: pointer; min-height: 44px; }
.icone { background: var(--s1); border: 0; border-radius: 50%; width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; }
.icone svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.faixa { background: light-dark(#fff1e8, #3a1f14); border-bottom: 1px solid color-mix(in srgb, var(--pro) 45%, transparent); padding: 10px 16px; font-size: 14px; }
.faixa a { font-weight: 700; margin-left: 4px; }

.abas-baixo {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: grid; grid-template-columns: repeat(5, 1fr); max-width: 560px; margin: 0 auto;
  background: var(--bg); border-top: 1px solid var(--linha); padding: 4px 4px calc(6px + env(safe-area-inset-bottom));
}
.abas-baixo button {
  background: none; border: 0; color: var(--mudo); font-size: 12px; font-weight: 600; min-height: 56px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; cursor: pointer; padding: 4px 0;
}
.abas-baixo button.on { color: var(--tinta); }
.abas-baixo svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.abas-baixo .redondo { width: 44px; height: 44px; border-radius: 50%; background: var(--pro); color: #fff; display: grid; place-items: center; margin-top: -14px; }
.abas-baixo .redondo svg { width: 24px; height: 24px; stroke-width: 2.5; }

/* ---------------------------------------------------------------- blocos */
.card { display: block; width: 100%; background: var(--s1); border: 0; border-radius: var(--raio); padding: 16px; margin: 0 0 12px; text-align: left; color: inherit; }
button.card { cursor: pointer; font: inherit; }
.card.alerta { background: color-mix(in srgb, var(--pro) 10%, var(--bg)); border: 1px solid color-mix(in srgb, var(--pro) 40%, transparent); }
.card.escuro { background: var(--tinta); color: var(--bg); }
.card.escuro .sub { color: color-mix(in srgb, var(--bg) 75%, transparent); }
.card.dose { background: var(--caneta); color: #fff; }
.card.dose .sub { color: rgba(255, 255, 255, .88); display: block; margin-top: 4px; }
.card.dose .tag { background: rgba(255, 255, 255, .2); }
.card.dose.atrasada { background: light-dark(#7a2e0e, #5a240c); }
.cartao-link { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.linha { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.duas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.duas > .card { margin: 0 0 12px; }
.botoes { display: flex; gap: 6px; flex: none; }
.tag { display: inline-block; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 20px; background: var(--s2); white-space: nowrap; }
.grande { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }

.item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--linha); font-size: 15px; }
.item:last-child { border-bottom: 0; }
.item-texto { flex: 1; overflow-wrap: anywhere; }
.item-valor { font-weight: 700; white-space: nowrap; }
.previa { display: block; width: 100%; max-height: 260px; object-fit: cover; border-radius: 12px; margin: 4px 0 10px; background: var(--s2); }
.item-foto { border-bottom: 1px solid var(--linha); padding: 4px 0 12px; margin-bottom: 4px; }
.item-foto .check { margin-bottom: 0; }

/* ---------------------------------------------------------------- botões e campos */
.btn {
  display: block; width: 100%; border: 0; border-radius: 14px; padding: 12px 16px; min-height: 48px;
  font-weight: 700; cursor: pointer; text-align: center; text-decoration: none; margin-top: 10px;
}
.btn.curto { width: auto; margin-top: 0; flex: none; }
.b1 { background: var(--tinta); color: var(--bg); }
.b2 { background: var(--s2); color: var(--tinta); }
.bp { background: var(--pro); color: #fff; }
.btn:disabled, .mais:disabled, .link:disabled { opacity: .45; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--caneta); font-weight: 700; cursor: pointer; padding: 8px 4px; min-height: 40px; font-size: 14px; }
.voltar { padding-left: 0; }
.mais { border: 0; background: var(--s2); border-radius: 10px; min-width: 44px; min-height: 40px; font-weight: 800; font-size: 18px; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { border: 1px solid var(--linha); border-radius: 20px; padding: 8px 12px; font-size: 14px; background: var(--bg); cursor: pointer; min-height: 40px; text-align: left; }
.chip.on { background: var(--tinta); color: var(--bg); border-color: var(--tinta); }
.chip.on .sub { color: inherit; }
.abas { display: flex; gap: 6px; margin-bottom: 8px; }

.form label { display: block; font-weight: 600; font-size: 14px; margin: 10px 0 4px; }
.form label.check { font-weight: 400; }
.inp { width: 100%; font-size: 16px; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--linha); background: var(--bg); min-height: 48px; }
.inp.codigo { font-size: 24px; letter-spacing: .3em; text-align: center; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; margin: 8px 0; cursor: pointer; }
.check input { width: 22px; height: 22px; flex: none; margin-top: 1px; accent-color: var(--caneta); }
.faixa-tag { margin: 0; }
input.faixa { width: 100%; accent-color: var(--pro); height: 40px; margin: 0 0 8px; display: block; }
.msg { color: light-dark(#b42318, #ff8a80); font-weight: 600; font-size: 14px; margin: 10px 0 0; }
:focus-visible { outline: 3px solid var(--caneta); outline-offset: 2px; }

/* ---------------------------------------------------------------- hoje */
.anel { position: relative; width: 190px; height: 190px; margin: 0 auto 6px; }
.anel svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.anel circle { fill: none; stroke-width: 12; }
.anel-fundo { stroke: var(--s2); }
.anel-pro { stroke: var(--pro); stroke-linecap: round; }
.anel-texto { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.medidor { height: 10px; border-radius: 6px; background: var(--s2); overflow: hidden; margin: 10px 0 4px; }
.medidor b { display: block; height: 100%; width: 0; border-radius: 6px; }
.medidor .agua { background: var(--agua); }
.medidor .fibra { background: var(--fibra); }

/* ---------------------------------------------------------------- caneta */
.corpo-caixa { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; align-items: center; }
.corpo { width: 150px; height: auto; display: block; }
.silhueta { fill: var(--s2); }
.lado { font-size: 11px; fill: var(--mudo); }
.ponto { cursor: pointer; outline: none; }
.ponto .alvo { fill: transparent; }
.ponto .miolo { fill: var(--mudo); stroke: var(--s1); stroke-width: 3; }
.ponto.recente .miolo { fill: var(--pro); }
.ponto.sel .alvo { fill: none; stroke: var(--caneta); stroke-width: 3; }
.ponto.sel .miolo { fill: var(--caneta); }
.ponto:focus-visible .alvo { stroke: var(--tinta); stroke-width: 3; fill: none; }
.local-nome { font-size: 21px; font-weight: 800; line-height: 1.2; margin: 8px 0 4px; }

/* ---------------------------------------------------------------- sintomas */
.barras { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 150px; }
.barra { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; text-align: center; }
.barra b { display: block; width: 100%; height: 0; background: var(--s2); border-radius: 6px 6px 0 0; min-height: 2px; }
.barra b.alta { background: var(--pro); }
.barra-valor { font-size: 12px; font-weight: 700; }

/* ---------------------------------------------------------------- progresso */
.grafico { width: 100%; height: auto; display: block; margin-top: 10px; }
.grafico text { font-size: 11px; fill: var(--mudo); }
.grade { stroke: var(--linha); }
.linha-peso { fill: none; stroke: var(--caneta); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.ponto-peso { fill: var(--caneta); }

/* ---------------------------------------------------------------- entrar */
.entrar { padding: max(10vh, 40px) 20px 40px; }
.marca { font-size: 40px; font-weight: 800; letter-spacing: -.03em; margin: 0 0 8px; color: var(--caneta); }
.turnstile { margin-top: 12px; min-height: 0; }

/* ---------------------------------------------------------------- aviso flutuante */
.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--abas) + 16px + env(safe-area-inset-bottom)); z-index: 10;
  max-width: 528px; margin: 0 auto; background: var(--tinta); color: var(--bg); border-radius: 14px; padding: 12px 16px;
  font-size: 15px; font-weight: 600; opacity: 0; transform: translateY(10px); transition: .25s; pointer-events: none;
}
.toast.on { opacity: 1; transform: none; }

@media (max-width: 360px) {
  .duas { grid-template-columns: 1fr; }
  .corpo-caixa { grid-template-columns: 120px minmax(0, 1fr); }
  .corpo { width: 120px; }
}
@media (min-width: 700px) {
  .app { border-left: 1px solid var(--linha); border-right: 1px solid var(--linha); }
}
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* Etapa 6: dados da pessoa, exclusão e textos legais */
.perigo { background: light-dark(#b42318, #f04438); color: #fff; }
.links-legais { display: flex; flex-wrap: wrap; gap: 4px 20px; justify-content: center; margin: 12px 0 0; font-size: 14px; }
.links-legais a { padding: 8px 0; }
.card.alerta ul { margin-top: 4px; }
.legal { max-width: 720px; margin: 0 auto; padding: 24px 20px 64px; line-height: 1.6; }
.legal h1 { font-size: 26px; margin: 8px 0 4px; }
.legal h2 { font-size: 18px; margin: 28px 0 8px; }
.legal p, .legal li { font-size: 16px; }
.legal .rascunho { background: light-dark(#fff1e8, #3a1f14); border: 1px solid color-mix(in srgb, var(--pro) 45%, transparent); border-radius: 12px; padding: 12px 14px; }
.aviso-ok { background: var(--s1); border-radius: 12px; padding: 12px 14px; font-weight: 600; margin: 0 0 12px; }
