/* A-Team Master OPS — identidade: preto, verde A-Team (#43907A), branco */
:root {
  --preto: #0b0d0c;
  --painel: #141816;
  --painel2: #1c211f;
  --linha: #2a322f;
  --verde: #43907a;
  --verde-forte: #4fa88e;
  --verde-fundo: rgba(67, 144, 122, .16);
  --texto: #f2f5f4;
  --mudo: #9aa5a0;
  --perigo: #e5484d;
  --alerta: #e8a33d;
  --raio: 14px;
  --fonte: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fonte-tit: "Exo 2", system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--preto); color: var(--texto); font: 15px/1.45 var(--fonte); }
body { min-height: 100vh; min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

/* ---------- topo ---------- */
.topo {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(11, 13, 12, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--linha);
}
.topo .logo { height: 30px; width: auto; }
.topo .nome-app { font: 700 13px/1.1 var(--fonte-tit); letter-spacing: .14em; text-transform: uppercase; color: var(--mudo); }
.topo .nome-app b { display: block; color: var(--texto); font-size: 15px; letter-spacing: .1em; }
.topo .esp { flex: 1; }
.topo .quem { font-size: 12px; color: var(--mudo); text-align: right; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- blocos ---------- */
.pagina { max-width: 720px; margin: 0 auto; padding: 16px; padding-bottom: 120px; }
.cartao { background: var(--painel); border: 1px solid var(--linha); border-radius: var(--raio); padding: 16px; margin-bottom: 14px; }
h1, h2, h3 { font-family: var(--fonte-tit); margin: 0 0 10px; line-height: 1.15; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
.mudo { color: var(--mudo); }
.pequeno { font-size: 12.5px; }
.etapa { font: 700 11px var(--fonte-tit); letter-spacing: .16em; text-transform: uppercase; color: var(--verde-forte); margin-bottom: 4px; }

/* ---------- formulário ---------- */
label.campo { display: block; margin-bottom: 12px; }
label.campo > span { display: block; font-size: 12.5px; color: var(--mudo); margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=search], select, textarea {
  width: 100%; background: var(--painel2); border: 1px solid var(--linha); border-radius: 10px;
  padding: 12px 13px; outline: none; font-size: 16px;
}
input:focus, select:focus, textarea:focus { border-color: var(--verde); box-shadow: 0 0 0 3px var(--verde-fundo); }
input.vin { font: 700 19px/1.2 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .06em; text-transform: uppercase; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--mudo) 50%), linear-gradient(135deg, var(--mudo) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.ok-msg { color: var(--verde-forte); font-size: 13px; }
.erro-msg { color: var(--perigo); font-size: 13px; }

/* ---------- botões ---------- */
.bt { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--linha);
  background: var(--painel2); border-radius: 12px; padding: 12px 16px; font-weight: 600; cursor: pointer; min-height: 46px; text-decoration: none; }
a.bt { color: var(--texto); }
a.bt.prim { color: #fff; }
.bt:active { transform: scale(.98); }
.bt[disabled] { opacity: .45; pointer-events: none; }
.bt.prim { background: var(--verde); border-color: var(--verde); color: #fff; }
.bt.prim:hover { background: var(--verde-forte); }
.bt.claro { background: #fff; color: var(--preto); border-color: #fff; }
.bt.perigo { color: var(--perigo); border-color: rgba(229, 72, 77, .4); }
.bt.cheio { width: 100%; }
.bt.grande { min-height: 58px; font-size: 17px; border-radius: 14px; }
.bt.mini { min-height: 34px; padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.bt svg { width: 20px; height: 20px; }
.linha-bt { display: flex; gap: 10px; }
.linha-bt > * { flex: 1; }

/* chips de escolha */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--linha); background: var(--painel2); border-radius: 999px; padding: 10px 15px; cursor: pointer; font-weight: 600; font-size: 14.5px; user-select: none; }
.chip.on { background: var(--verde); border-color: var(--verde); color: #fff; }
.chip.on::before { content: "✓ "; }

/* rodapé fixo de ação */
.barra-acao { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; padding: 12px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--preto) 70%, rgba(11, 13, 12, 0)); }
.barra-acao > div { max-width: 720px; margin: 0 auto; display: flex; gap: 10px; }
.barra-acao > div > * { flex: 1; }

/* ---------- status ---------- */
.st { display: inline-flex; align-items: center; gap: 6px; font: 700 11px var(--fonte-tit); letter-spacing: .1em; text-transform: uppercase;
  border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st.EM_SERVICO { color: var(--alerta); background: rgba(232, 163, 61, .14); }
.st.FINALIZADO { color: var(--verde-forte); background: var(--verde-fundo); }

/* ---------- fotos ---------- */
.grade-fotos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.slot { position: relative; aspect-ratio: 4 / 3; border: 1.5px dashed var(--linha); border-radius: 12px; background: var(--painel2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: pointer; overflow: hidden; text-align: center; padding: 6px; }
.slot .silhueta { width: 74%; height: auto; fill: none; stroke: var(--mudo); stroke-width: 3; opacity: .6; }
.slot b { font-size: 13.5px; }
.slot.feito { border-style: solid; border-color: var(--verde); padding: 0; }
.slot.feito img { width: 100%; height: 100%; object-fit: cover; }
.slot .selo { position: absolute; left: 6px; bottom: 6px; background: rgba(0, 0, 0, .7); border-radius: 7px; padding: 2px 7px; font-size: 11.5px; font-weight: 600; }
.slot .selo.enviando { color: var(--alerta); } .slot .selo.ok { color: var(--verde-forte); } .slot .selo.falhou { color: var(--perigo); }
.foto-larga { width: 100%; border-radius: 12px; background: var(--painel2); }

/* ---------- desenho do carro ---------- */
.carro { width: 100%; height: auto; display: block; }
.c-corpo { fill: #e9eeec; stroke: #9aa5a0; stroke-width: 1.4; }
.c-vidro { fill: #2b3531; }
.c-pilar { fill: #cfd6d3; stroke: #9aa5a0; stroke-width: 1; }
.c-linha { fill: none; stroke: #9aa5a0; stroke-width: 1.2; }
.c-fina { fill: none; stroke: #c3ccc8; stroke-width: .8; }
.c-luz { fill: #fff; stroke: #8a9590; }
.c-lant { fill: #c0392b; }
.c-grade { fill: #2b3531; }
.c-pneu { fill: #1d2220; }
.c-aro { fill: #aab3af; stroke: #6b7570; }
.rg { cursor: pointer; outline: none; }
.rg-hit { fill: transparent; }
.rg-halo { fill: rgba(79, 91, 87, .28); transition: fill .15s; }
.rg-pt { fill: #4f5b57; transition: fill .15s; }
.rg.on .rg-pt { fill: var(--verde); }
.rg.on .rg-halo { fill: rgba(67, 144, 122, .5); }
.mapa { display: grid; gap: 10px; }
.mapa .vista { background: var(--painel2); border: 1px solid var(--linha); border-radius: 12px; padding: 8px 8px 4px; }
.mapa .vista > span { display: block; font: 700 10.5px var(--fonte-tit); letter-spacing: .14em; text-transform: uppercase; color: var(--mudo); }
.mapa .duas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- câmera ---------- */
.cam { position: fixed; inset: 0; z-index: 100; background: #000; display: flex; flex-direction: column; }
.cam video, .cam .cam-prev img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.cam .cam-guia { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 70px 4% 110px; pointer-events: none; }
.cam .cam-guia .silhueta { width: 100%; height: 100%; fill: none; stroke: #fff; stroke-width: 2.6; stroke-dasharray: 9 6;
  filter: drop-shadow(0 0 3px rgba(67, 144, 122, .95)) drop-shadow(0 0 1px #000); opacity: .9; }
.cam .cam-guia .mira { width: min(70vw, 70vh); aspect-ratio: 1; border: 3px solid rgba(255, 255, 255, .85); border-radius: 18px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .25); }
.cam .cam-guia .mira-etiqueta { width: min(78vw, 52vh); aspect-ratio: 3 / 4; }
.cam .cam-guia .faixa { width: 88%; height: 26%; max-height: 160px; border: 3px solid var(--verde-forte); border-radius: 14px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .45); position: relative; overflow: hidden; }
.cam .cam-guia .faixa::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: var(--perigo); box-shadow: 0 0 8px var(--perigo); animation: varre 1.6s ease-in-out infinite alternate; }
@keyframes varre { from { transform: translateY(-40px); } to { transform: translateY(40px); } }
.cam .cam-topo { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: flex-start; gap: 10px; padding: 12px; padding-top: max(12px, env(safe-area-inset-top));
  background: linear-gradient(rgba(0, 0, 0, .75), transparent); }
.cam .cam-topo .tt { flex: 1; text-align: center; }
.cam .cam-topo .tt b { display: block; font: 700 17px var(--fonte-tit); }
.cam .cam-topo .tt span { font-size: 13px; color: #d5dcd9; }
.cam .redondo { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .16); color: #fff; font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.cam .redondo.on { background: var(--alerta); color: #000; }
.cam .cam-base { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; gap: 30px; padding: 18px; padding-bottom: max(18px, env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0, 0, 0, .8)); }
.cam .disparo { width: 76px; height: 76px; border-radius: 50%; border: 5px solid #fff; background: var(--verde); cursor: pointer; }
.cam .disparo:active { transform: scale(.93); }
.cam .cam-prev { position: absolute; inset: 0; background: #000; }
.cam .cam-prev .acoes { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 12px; padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0, 0, 0, .85)); }
.cam .cam-prev .acoes > * { flex: 1; }
.cam .aviso-giro { position: absolute; left: 50%; top: 92px; transform: translateX(-50%); background: rgba(0, 0, 0, .7); border: 1px solid var(--linha); padding: 7px 12px; border-radius: 999px; font-size: 13px; white-space: nowrap; }
.cam .manual { color: #fff; background: rgba(255, 255, 255, .14); border: 0; border-radius: 999px; padding: 10px 16px; font-weight: 600; cursor: pointer; }
@media (orientation: landscape) { .cam .aviso-giro { display: none; } }

/* ---------- avisos ---------- */
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 200; background: #fff; color: var(--preto); padding: 11px 16px; border-radius: 12px;
  font-weight: 600; box-shadow: 0 8px 30px rgba(0, 0, 0, .5); max-width: calc(100vw - 32px); }
.toast.erro { background: var(--perigo); color: #fff; }
.carregando { display: inline-block; width: 18px; height: 18px; border: 2.5px solid rgba(255, 255, 255, .3); border-top-color: #fff; border-radius: 50%; animation: gira .8s linear infinite; vertical-align: -4px; }
@keyframes gira { to { transform: rotate(360deg); } }
.vazio { text-align: center; padding: 34px 16px; color: var(--mudo); }

/* ---------- login ---------- */
.tela-login { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.tela-login .marca { width: 210px; margin-bottom: 8px; }
.tela-login .sub { font: 700 12px var(--fonte-tit); letter-spacing: .3em; color: var(--verde-forte); margin-bottom: 26px; text-transform: uppercase; }
.tela-login .cartao { width: 100%; max-width: 380px; }
.abas { display: flex; background: var(--painel2); border-radius: 11px; padding: 4px; margin-bottom: 16px; }
.abas button { flex: 1; border: 0; background: none; padding: 9px; border-radius: 8px; font-weight: 600; cursor: pointer; color: var(--mudo); }
.abas button.on { background: var(--verde); color: #fff; }

/* foto ampliada (app e central) */
.zoom { position: fixed; inset: 0; background: rgba(0, 0, 0, .94); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; padding-bottom: max(20px, env(safe-area-inset-bottom)); cursor: zoom-out; }
.zoom img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
