:root {
  --ink: #1b2233;
  --muted: #667085;
  --blue: #1f3fae;
  --blue-dark: #162f87;
  --navy: #121d3a;
  --lime: #9cbc12;
  --paper: #ffffff;
  --canvas: #eef1f6;
  --line: #dde2ea;
  --erro: #b42318;
  --ok: #1d7a3e;
  --sombra: 0 1px 2px rgb(16 24 40 / 6%), 0 2px 8px rgb(16 24 40 / 6%);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

[hidden] { display: none !important; }
a { color: var(--blue); }
small { font-weight: 400; color: var(--muted); }

/* ---------- Topo ---------- */
.topo {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: linear-gradient(90deg, var(--navy), #1a2a55);
  border-bottom: 3px solid var(--lime);
  color: #fff;
}
.marca {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 18px;
  letter-spacing: .5px;
  text-decoration: none;
  cursor: pointer;
}
.marca img { border-radius: 8px; }
.placa-topo { padding: 2px 8px; border-radius: 6px; background: rgb(255 255 255 / 14%); font-weight: 700; letter-spacing: 1px; font-size: 14px; }
.sair { margin-left: auto; padding: 6px 12px; border: 1px solid rgb(255 255 255 / 40%); border-radius: 8px; background: none; color: #fff; font: inherit; font-size: 14px; cursor: pointer; }

/* ---------- Avisos ---------- */
.fila, .mensagem { margin: 0; padding: 10px 16px; font-weight: 600; font-size: 15px; }
.fila { background: #fff6e0; color: #8a5a00; }
.mensagem { background: #fdf1f1; color: var(--erro); }
.mensagem.ok { background: #eaf6ee; color: var(--ok); }

/* ---------- Conteúdo ---------- */
main { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 16px 16px 24px; }
h1 { font-size: 22px; margin: 4px 0 12px; }
.cartao { margin: 0 0 12px; padding: 16px; border-radius: 16px; background: var(--paper); box-shadow: var(--sombra); }
.cartao h1 { margin-top: 0; }
.cartao p { margin: 0 0 12px; }
.conectado { margin: 0 0 12px; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.conectado strong { color: var(--ink); }
.boas-vindas { text-align: center; padding: 28px 20px; }
.boas-vindas img { border-radius: 16px; }
.dica { font-size: 13px; color: var(--muted); }

/* ---------- Botões ---------- */
button { font: inherit; cursor: pointer; }
.principal, .secundario {
  display: block;
  width: 100%;
  min-height: 50px;
  margin: 10px 0 0;
  border-radius: 12px;
  font-weight: 600;
}
.principal { border: 0; background: var(--blue); color: #fff; }
.principal:active { background: var(--blue-dark); }
.secundario { border: 1px solid var(--line); background: var(--paper); color: var(--blue); }
button:disabled { opacity: .5; }
.pequeno { min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--blue); font-size: 14px; font-weight: 600; }

/* ---------- Campos ---------- */
label, .rotulo { display: block; margin: 0 0 8px; font-weight: 600; }
.rotulo small { font-size: 13px; }
input, textarea {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
  color: var(--ink);
  font: inherit;
}
input:focus, textarea:focus { outline: 2px solid rgb(31 63 174 / 25%); border-color: var(--blue); }
#codigo { font-size: 26px; letter-spacing: 6px; text-align: center; text-transform: uppercase; font-weight: 700; }
#km { font-size: 22px; font-weight: 700; letter-spacing: 1px; }

/* ---------- Veículo e ações ---------- */
.veiculo { text-align: center; }
/* Placa no padrão Mercosul: faixa azul em cima */
.placa {
  display: inline-block;
  min-width: 190px;
  padding: 18px 16px 6px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: linear-gradient(#1f3fae 0 14px, #fff 14px);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 3px;
}
.modelo { display: block; margin-top: 8px; color: var(--muted); font-weight: 600; }
.situacao { display: inline-block; margin-top: 10px; padding: 4px 12px; border-radius: 999px; background: #e9edfb; color: var(--blue); font-size: 14px; font-weight: 700; }
.mensagem-gestor { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: #fdf1f1; color: var(--erro); font-weight: 600; overflow-wrap: anywhere; }
.acoes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.acao {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 112px;
  padding: 14px;
  border: 0;
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--sombra);
  color: var(--ink);
  text-align: left;
}
.acao svg {
  width: 40px;
  height: 40px;
  margin-bottom: 6px;
  padding: 8px;
  border-radius: 12px;
  background: #e9edfb;
  fill: none;
  stroke: var(--blue);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.acao strong { font-size: 17px; }
.acao small { font-size: 13px; }
.acao:active { transform: scale(.98); }
.acao.perigo svg { background: #fdecec; stroke: var(--erro); }
.acao.perigo strong { color: var(--erro); }

/* ---------- Checklist ---------- */
.cabecalho-checklist { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.cabecalho-checklist .rotulo { margin: 0; }
#contador { display: block; }
.pequeno { white-space: nowrap; }
.item { padding: 12px 10px; margin: 0 -10px; border-top: 1px solid var(--line); border-radius: 10px; }
.item.faltando { background: #fff5f5; box-shadow: inset 3px 0 0 var(--erro); }
.item-nome { font-weight: 600; }
.estados { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.estados.dois { grid-template-columns: repeat(2, 1fr); }
.estados button { min-height: 42px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--muted); font-weight: 600; font-size: 15px; }
.estados button.bom[aria-pressed="true"] { background: #eaf6ee; color: var(--ok); border-color: var(--ok); }
.estados button.regular[aria-pressed="true"] { background: #fff6e0; color: #8a5a00; border-color: #8a5a00; }
.estados button.ruim[aria-pressed="true"] { background: #fdf1f1; color: var(--erro); border-color: var(--erro); }
.ruim-detalhe { margin-top: 10px; }
.ruim-detalhe input { margin-bottom: 8px; }

/* ---------- Fotos ---------- */
.fotos { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.miniatura { position: relative; }
.miniatura img { display: block; width: 76px; height: 76px; object-fit: cover; border-radius: 10px; }
.miniatura button { position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; padding: 0; border: 2px solid #fff; border-radius: 50%; background: var(--erro); color: #fff; font-size: 14px; line-height: 1; }
.tirar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  margin: 0;
  border: 2px dashed #b6c2e6;
  border-radius: 10px;
  background: #f6f8ff;
  color: var(--blue);
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  cursor: pointer;
}

/* ---------- Envio ---------- */
.barra-enviar {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 10px;
  margin: 0 -16px;
  padding: 10px 16px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: rgb(238 241 246 / 94%);
  border-top: 1px solid var(--line);
}
.barra-enviar button { margin: 0; }

.pendente { margin: 0 0 10px; padding: 12px; border-radius: 12px; background: var(--paper); box-shadow: var(--sombra); font-size: 14px; }
.pendente .erro { margin-top: 4px; color: var(--erro); }
.pendente button { min-height: 38px; margin-top: 8px; }

/* ---------- Rodapé ---------- */
.rodape { padding: 16px 16px max(16px, env(safe-area-inset-bottom)); text-align: center; font-size: 13px; color: var(--muted); }
.rodape p { margin: 2px 0; }
.rodape strong { color: var(--ink); }
.rodape a { color: var(--muted); }

/* ---------- Página de texto (política de privacidade) ---------- */
.texto h2 { font-size: 17px; margin: 22px 0 6px; }
.texto li { margin: 6px 0; }
