/* Garantia Deep · preto e branco, minimalista. Cor só pra estado da garantia.
   Superfícies separadas por borda fina, sem sombra difusa. */
:root {
  --bg: #ffffff; --sup: #f5f5f5; --sup2: #ebebeb; --linha: #e2e2e2; --linha2: #cfcfcf;
  --txt: #0a0a0a; --mut: #5f5f5f; --pri: #0a0a0a; --pri-txt: #ffffff;
  --ok: #17804e; --ok-bg: #e7f4ed; --aviso: #9a6200; --aviso-bg: #fbf1de; --ruim: #c22f45; --ruim-bg: #fbe9ec; --info: #2458c6; --info-bg: #e8eefb;
  --zap: #e9f6ee; --zap-l: #cde6d6;
  --f: 'Mulish', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --m: 'DM Mono', ui-monospace, Consolas, monospace;
  --r: 14px; --r2: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0a0a0a; --sup: #141414; --sup2: #1d1d1d; --linha: #272727; --linha2: #383838;
    --txt: #f4f4f4; --mut: #a2a2a2; --pri: #ffffff; --pri-txt: #0a0a0a;
    --ok: #5cc28c; --ok-bg: #11251a; --aviso: #e3ad57; --aviso-bg: #2a2010; --ruim: #ec7a8a; --ruim-bg: #2d1418; --info: #86a8f0; --info-bg: #141d33;
    --zap: #11241a; --zap-l: #1f3a2b;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0a0a; --sup: #141414; --sup2: #1d1d1d; --linha: #272727; --linha2: #383838;
  --txt: #f4f4f4; --mut: #a2a2a2; --pri: #ffffff; --pri-txt: #0a0a0a;
  --ok: #5cc28c; --ok-bg: #11251a; --aviso: #e3ad57; --aviso-bg: #2a2010; --ruim: #ec7a8a; --ruim-bg: #2d1418; --info: #86a8f0; --info-bg: #141d33;
  --zap: #11241a; --zap-l: #1f3a2b;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--txt); font-family: var(--f); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--pri); outline-offset: 2px; }
[hidden] { display: none !important; }
img { max-width: 100%; }

/* ---------- casca do app (celular) ---------- */
.app { min-height: 100dvh; display: flex; flex-direction: column; max-width: 520px; margin: 0 auto;
  padding: env(safe-area-inset-top, 0px) max(18px, env(safe-area-inset-right, 0px)) 0 max(18px, env(safe-area-inset-left, 0px)); }
.topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0 6px; min-height: 58px; }
.logo { font-weight: 800; font-size: 24px; letter-spacing: -.045em; line-height: 1; text-decoration: none; }
.logo small { font-family: var(--m); font-weight: 400; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--mut); margin-left: 8px; vertical-align: 3px; }
.conteudo { flex: 1; display: flex; flex-direction: column; gap: 18px; padding: 8px 0 28px; }
.com-abas .conteudo { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
.abas { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--bg); border-top: 1px solid var(--linha);
  padding: 6px max(10px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px)); }
.abas nav { max-width: 520px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); }
.abas a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 4px; text-decoration: none; color: var(--mut); font-size: 12px; font-weight: 600; border-radius: 10px; }
.abas a svg { width: 22px; height: 22px; }
.abas a[aria-current="page"] { color: var(--txt); }
.abas a.meio span.bola { width: 44px; height: 44px; border-radius: 50%; background: var(--pri); color: var(--pri-txt); display: grid; place-items: center; margin-top: -2px; }

/* ---------- tipografia ---------- */
h1 { font-size: 27px; font-weight: 800; line-height: 1.12; letter-spacing: -.025em; margin: 0; text-wrap: balance; }
h2 { font-size: 18px; font-weight: 800; margin: 0; letter-spacing: -.01em; }
.sub { color: var(--mut); margin: 0; }
.lab { font-family: var(--m); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--mut); }
.mono { font-family: var(--m); letter-spacing: .01em; }
.num { font-variant-numeric: tabular-nums; }
.pequeno { font-size: 13px; color: var(--mut); margin: 0; }

/* ---------- botões e campos ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 10px 18px; border-radius: 12px;
  border: 1px solid var(--pri); background: var(--pri); color: var(--pri-txt); font-weight: 800; font-size: 16px; text-decoration: none; width: 100%; }
.btn.sec { background: transparent; color: var(--txt); border-color: var(--linha2); font-weight: 700; }
.btn.peq { min-height: 38px; padding: 6px 14px; font-size: 14px; width: auto; border-radius: 10px; }
.btn.perigo { background: transparent; color: var(--ruim); border-color: color-mix(in srgb, var(--ruim) 45%, var(--linha)); }
.btn:disabled { opacity: .45; cursor: default; }
.btn .gira { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: gira .7s linear infinite; }
.btn svg { width: 20px; height: 20px; flex: none; }
.instalar svg { width: 26px; height: 26px; flex: none; }
@keyframes gira { to { transform: rotate(360deg); } }
.link { background: none; border: 0; padding: 8px 2px; color: var(--txt); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--linha2); }
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo label { font-size: 13px; font-weight: 700; color: var(--mut); }
.campo input, .campo select, .campo textarea { width: 100%; background: var(--bg); border: 1px solid var(--linha2); border-radius: 12px; padding: 13px 14px; font-size: 16px; }
.campo textarea { resize: vertical; min-height: 96px; }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: none; border-color: var(--txt); }
.campo .ajuda { font-size: 13px; color: var(--mut); }
.campo.erro input, .campo.erro select, .campo.erro textarea { border-color: var(--ruim); }
.duas { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 10px; }
input.placa { font-family: var(--m); font-size: 28px !important; letter-spacing: .16em; text-transform: uppercase; text-align: center; }
input.codigo { font-family: var(--m); font-size: 30px !important; letter-spacing: .5em; text-align: center; padding-left: .5em !important; }
.msg-erro { color: var(--ruim); font-size: 14px; font-weight: 600; margin: 0; }
.chk { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--mut); cursor: pointer; }
.chk input { width: 22px; height: 22px; flex: none; accent-color: var(--pri); margin: 0; }
.acoes { display: flex; flex-direction: column; gap: 10px; }

/* ---------- blocos ---------- */
.cx { border: 1px solid var(--linha); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.cx.cheia { background: var(--sup); border-color: var(--sup); }
.cx.ok { border-color: color-mix(in srgb, var(--ok) 50%, var(--linha)); }
.cx.ruim { border-color: color-mix(in srgb, var(--ruim) 50%, var(--linha)); background: var(--ruim-bg); }
.dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 16px; margin: 0; font-size: 14px; }
.dl dt { color: var(--mut); }
.dl dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kpi { border: 1px solid var(--linha); border-radius: var(--r2); padding: 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi b { font-size: 30px; font-weight: 300; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 12px; color: var(--mut); line-height: 1.25; }
.lista { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--linha); text-decoration: none; color: inherit; background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; }
.item:first-child { border-top: 0; }
.item > div { min-width: 0; flex: 1; }
.item b { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item small { display: block; color: var(--mut); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .seta { color: var(--mut); flex: none; }
.secao { display: flex; flex-direction: column; gap: 8px; }
.secao-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }

/* ---------- pílulas de estado ---------- */
.pil { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pil::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pil.ativa, .pil.concluido { color: var(--ok); background: var(--ok-bg); }
.pil.aberto { color: var(--ruim); background: var(--ruim-bg); }
.pil.analise { color: var(--aviso); background: var(--aviso-bg); }
.pil.aprovado { color: var(--info); background: var(--info-bg); }
.pil.recusado, .pil.vencida { color: var(--mut); background: var(--sup2); }

/* ---------- escolha de perfil ---------- */
.escolha { display: grid; gap: 12px; }
.perfil { display: grid; grid-template-columns: 48px minmax(0, 1fr) 20px; align-items: center; gap: 14px; text-align: left; padding: 18px 16px; border: 1px solid var(--linha2); border-radius: var(--r); background: var(--bg); color: var(--txt); text-decoration: none; }
.perfil:hover { border-color: var(--txt); }
.perfil .ic { width: 48px; height: 48px; border-radius: 12px; background: var(--sup); display: grid; place-items: center; }
.perfil .ic svg { width: 26px; height: 26px; }
.perfil b { font-size: 17px; display: block; }
.perfil small { color: var(--mut); font-size: 13.5px; display: block; line-height: 1.35; }
.demo { border: 1px dashed var(--linha2); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.demo .botoes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.aviso-demo { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--sup); border-radius: var(--r2); padding: 12px 14px; font-size: 14px; }
.aviso-demo b { font-family: var(--m); font-size: 20px; letter-spacing: .2em; }

/* ---------- registrar ---------- */
.passos { display: flex; align-items: center; gap: 10px; }
.passos .barra { display: flex; gap: 5px; flex: 1; }
.passos .barra i { height: 3px; flex: 1; border-radius: 2px; background: var(--linha); }
.passos .barra i.f { background: var(--pri); }
.voltar { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--linha2); background: none; display: grid; place-items: center; flex: none; }
.voltar svg { width: 18px; height: 18px; }
.visor { position: relative; aspect-ratio: 1; max-width: 100%; border-radius: var(--r); overflow: hidden; background: #000; color: #fff; }
.visor video { width: 100%; height: 100%; object-fit: cover; display: block; }
.visor .mira { position: absolute; inset: 18%; border-radius: 18px;
  background: linear-gradient(#fff,#fff) left top/28px 3px no-repeat, linear-gradient(#fff,#fff) left top/3px 28px no-repeat,
    linear-gradient(#fff,#fff) right top/28px 3px no-repeat, linear-gradient(#fff,#fff) right top/3px 28px no-repeat,
    linear-gradient(#fff,#fff) left bottom/28px 3px no-repeat, linear-gradient(#fff,#fff) left bottom/3px 28px no-repeat,
    linear-gradient(#fff,#fff) right bottom/28px 3px no-repeat, linear-gradient(#fff,#fff) right bottom/3px 28px no-repeat; }
.visor .mira::after { content: ""; position: absolute; left: 6%; right: 6%; height: 2px; background: #fff; opacity: .8; top: 8%; animation: varre 2s ease-in-out infinite alternate; }
@keyframes varre { to { top: 92%; } }
.visor .estado { position: absolute; left: 12px; right: 12px; bottom: 12px; text-align: center; font-size: 13px; color: #ddd; }
.visor.parado { display: grid; place-items: center; text-align: center; padding: 24px; background: var(--sup); color: var(--mut); }
@media (prefers-reduced-motion: reduce) { .visor .mira::after { animation: none; top: 50%; } .btn .gira { animation-duration: 2s; } }
.produto { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 14px; align-items: center; }
.produto .foto { width: 56px; height: 56px; border-radius: 12px; background: var(--sup); display: grid; place-items: center; }
.produto .foto svg { width: 30px; height: 30px; }
.produto b { font-size: 17px; display: block; }
.selo-ok { width: 72px; height: 72px; border-radius: 50%; border: 2px solid var(--ok); color: var(--ok); display: grid; place-items: center; animation: surge .45s cubic-bezier(.2, .9, .3, 1.3); }
.selo-ok svg { width: 34px; height: 34px; }
@keyframes surge { from { transform: scale(.6); opacity: 0; } }
.zap { background: var(--zap); border: 1px solid var(--zap-l); border-radius: 4px 16px 16px 16px; padding: 12px 14px; font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.zap .de { font-size: 12px; font-weight: 800; color: var(--ok); }
.zap .lk { color: var(--info); text-decoration: underline; overflow-wrap: anywhere; font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--linha2); background: var(--bg); color: var(--txt); border-radius: 999px; padding: 9px 15px; font-size: 14px; font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--pri); color: var(--pri-txt); border-color: var(--pri); }
.fotos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fotos .f { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--sup); }
.fotos .f img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fotos .f button { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 16px; line-height: 1; }
.fotos label.add { aspect-ratio: 1; border: 1px dashed var(--linha2); border-radius: 12px; display: grid; place-items: center; text-align: center; color: var(--mut); font-size: 13px; cursor: pointer; padding: 8px; }

/* ---------- garantia / certificado ---------- */
.cert { border: 1px solid var(--linha2); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.cert .cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px 12px; flex-wrap: wrap-reverse; }
.cert .cab > div { flex: 1 1 200px; }
.tempo { height: 6px; border-radius: 3px; background: var(--sup2); overflow: hidden; }
.tempo i { display: block; height: 100%; background: var(--pri); border-radius: 3px; }
.cartao { display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--linha); border-radius: var(--r); padding: 16px; text-decoration: none; color: inherit; }
.cartao:hover { border-color: var(--linha2); }
.cartao .l1 { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.cartao b { font-size: 16px; }
.cartao small { color: var(--mut); font-size: 13px; }
.passo-status { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.passo-status div { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--mut); font-weight: 600; }
.passo-status i { height: 4px; border-radius: 2px; background: var(--linha); }
.passo-status .f { color: var(--txt); }
.passo-status .f i { background: var(--pri); }
.passo-status .x i { background: var(--ruim); }
.linha-tempo { display: flex; flex-direction: column; gap: 0; }
.ev { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 12px; padding-bottom: 14px; position: relative; }
.ev::before { content: ""; position: absolute; left: 6px; top: 14px; bottom: 0; width: 1px; background: var(--linha); }
.ev:last-child::before { display: none; }
.ev .pt { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--txt); background: var(--bg); margin-top: 3px; }
.ev.deep .pt { background: var(--txt); }
.ev small { color: var(--mut); font-size: 12px; display: block; }
.ev p { margin: 2px 0 0; font-size: 14px; }
.ev .bolha { background: var(--sup); border-radius: 4px 12px 12px 12px; padding: 10px 12px; margin-top: 6px; font-size: 14px; }
.vazio { text-align: center; padding: 28px 12px; color: var(--mut); display: flex; flex-direction: column; gap: 10px; align-items: center; }
.vazio svg { width: 40px; height: 40px; color: var(--linha2); }

/* ---------- avisos ---------- */
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; background: var(--pri); color: var(--pri-txt);
  border-radius: 12px; padding: 12px 16px; font-size: 14px; font-weight: 600; max-width: min(92vw, 440px); animation: sobe .25s ease-out; }
@keyframes sobe { from { transform: translate(-50%, 10px); opacity: 0; } }
.carregando { display: grid; place-items: center; padding: 60px 0; color: var(--mut); }
.carregando::before { content: ""; width: 26px; height: 26px; border: 2px solid var(--linha2); border-right-color: var(--txt); border-radius: 50%; animation: gira .8s linear infinite; }
.instalar { display: flex; align-items: center; gap: 12px; border: 1px solid var(--linha); border-radius: var(--r); padding: 12px 14px; }
.instalar > div { flex: 1; min-width: 0; font-size: 14px; }
.instalar b { display: block; }
