/* App do motorista: botões grandes, alto contraste (uso no sol), pouco texto. */
:root {
  --marca: #1f3a5f;
  --fundo: #f4f5f7;
  --cartao: #ffffff;
  --texto: #14171c;
  --texto-fraco: #5b6472;
  --borda: #d5d9e0;
  --carga: #1d5fbf;
  --abastecimento: #c2610c;
  --manutencao: #a4262c;
  --ok: #1e7b34;
  --aviso: #b25e00;
  --erro: #b3261e;
  --raio: 18px;
  --sombra: 0 2px 6px rgba(20, 23, 28, 0.12);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--texto);
  background: var(--fundo);
  -webkit-tap-highlight-color: transparent;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--fundo); }
body { overscroll-behavior: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
button:disabled { opacity: 0.4; cursor: default; }
[hidden] { display: none !important; }

.app {
  max-width: 520px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ic { width: 28px; height: 28px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic-g { width: 56px; height: 56px; }
.ic-xg { width: 120px; height: 120px; stroke-width: 2.5; }

/* ---------- Topo ---------- */
.topo { display: flex; align-items: center; gap: 12px; min-height: 56px; }
.topo h1 { flex: 1; margin: 0; font-size: 24px; line-height: 1.2; }
.voltar {
  width: 56px; height: 56px; border-radius: 50%; background: var(--cartao); box-shadow: var(--sombra);
  display: grid; place-items: center;
}
.passos { display: flex; gap: 6px; }
.passos span { width: 10px; height: 10px; border-radius: 50%; background: var(--borda); }
.passos span.feito { background: var(--marca); }

.motorista { flex: 1; font-size: 18px; font-weight: 600; }
.status {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; min-height: 44px;
  border-radius: 999px; font-size: 15px; font-weight: 600; color: #fff;
}
.status .ic { width: 20px; height: 20px; }
.status-ok { background: var(--ok); }
.status-aviso { background: var(--aviso); }
.status-erro { background: var(--erro); }

/* ---------- Início ---------- */
.equipamento {
  display: flex; align-items: center; gap: 16px; width: 100%; padding: 16px 20px; text-align: left;
  background: var(--cartao); border-radius: var(--raio); box-shadow: var(--sombra); border: 3px solid var(--marca);
}
.equipamento .prefixo { font-size: 34px; font-weight: 800; letter-spacing: 0.5px; }
.equipamento .detalhe { font-size: 16px; color: var(--texto-fraco); }
.equipamento .trocar { margin-left: auto; font-size: 15px; font-weight: 600; color: var(--marca); }

.acoes { display: flex; flex-direction: column; gap: 16px; flex: 1; }
.acao {
  flex: 1; min-height: 120px; display: flex; align-items: center; gap: 20px; padding: 20px 24px;
  border-radius: var(--raio); color: #fff; font-size: 28px; font-weight: 800; box-shadow: var(--sombra);
}
.acao .ic { width: 64px; height: 64px; }
.acao-carga { background: var(--carga); }
.acao-abastecimento { background: var(--abastecimento); }
.acao-manutencao { background: var(--manutencao); }

.rodape { text-align: center; }
.link-discreto { padding: 12px; min-height: 44px; font-size: 14px; color: var(--texto-fraco); text-decoration: underline; }

.aviso {
  display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 12px;
  background: #fdecea; color: var(--erro); font-size: 17px; font-weight: 600;
}

/* ---------- Lista de equipamentos ---------- */
.grade { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cartao-escolha {
  min-height: 110px; padding: 14px; border-radius: var(--raio); background: var(--cartao); box-shadow: var(--sombra);
  border: 3px solid transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  text-align: center;
}
.cartao-escolha.ativo { border-color: var(--marca); }
.cartao-escolha .prefixo { font-size: 26px; font-weight: 800; }
.cartao-escolha .detalhe { font-size: 14px; color: var(--texto-fraco); }
.cartao-escolha .ic { width: 48px; height: 48px; }
.cartao-escolha .rotulo { font-size: 19px; font-weight: 700; }

/* ---------- Foto ---------- */
.botao-camera {
  flex: 1; min-height: 260px; border-radius: var(--raio); background: var(--cartao); box-shadow: var(--sombra);
  border: 4px dashed var(--marca); color: var(--marca); display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; font-size: 26px; font-weight: 800;
}
.foto {
  width: 100%; max-height: 52vh; object-fit: contain; border-radius: var(--raio); background: #000; display: block;
}
.foto-mini { max-height: 26vh; }
.foto-cheia { position: fixed; inset: 0; z-index: 10; max-height: none; height: 100%; border-radius: 0; }

.botoes { display: flex; gap: 12px; }
.botao {
  flex: none; width: 100%; min-height: 72px; display: flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: var(--raio); font-size: 22px; font-weight: 800; box-shadow: var(--sombra);
}
.botoes .botao { flex: 1; width: auto; }
.botao-principal { background: var(--ok); color: #fff; }
.botao-secundario { background: var(--cartao); color: var(--texto); border: 2px solid var(--borda); }
.botao-perigo { background: var(--erro); color: #fff; }

/* ---------- Número ---------- */
.visor {
  display: flex; align-items: baseline; justify-content: center; gap: 10px; padding: 12px; min-height: 88px;
  background: var(--cartao); border-radius: var(--raio); box-shadow: var(--sombra); border: 3px solid var(--marca);
}
.visor .valor { font-size: 52px; font-weight: 800; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.visor .unidade { font-size: 22px; color: var(--texto-fraco); font-weight: 700; }
.visor .vazio { color: var(--borda); }
.dica { margin: 0; text-align: center; font-size: 18px; color: var(--texto-fraco); }

.teclado { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tecla {
  min-height: 66px; border-radius: 14px; background: var(--cartao); box-shadow: var(--sombra);
  font-size: 32px; font-weight: 700; display: grid; place-items: center;
}
.tecla:active { background: #e3e8f0; }

/* ---------- Conferência ---------- */
.resumo { background: var(--cartao); border-radius: var(--raio); box-shadow: var(--sombra); padding: 16px; display: grid; gap: 14px; }
.resumo .linha { display: flex; align-items: center; gap: 12px; font-size: 20px; }
.resumo .grande { font-size: 36px; font-weight: 800; }
.resumo .fotos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.resumo .fotos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.etiqueta { font-size: 15px; color: var(--texto-fraco); }

/* ---------- Sucesso e confirmação de km ---------- */
.tela-cheia {
  position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px; padding: 24px; text-align: center;
}
.sucesso { background: var(--ok); color: #fff; font-size: 34px; font-weight: 800; }
.sucesso small { font-size: 20px; font-weight: 600; opacity: 0.9; }
.confirmar-km { background: var(--fundo); }
.confirmar-km .valor { font-size: 56px; font-weight: 800; }
.confirmar-km .anterior { font-size: 20px; color: var(--texto-fraco); }
.confirmar-km .botoes { width: 100%; max-width: 480px; flex-direction: column; }
.titulo-alerta { display: flex; align-items: center; gap: 10px; color: var(--aviso); font-size: 28px; font-weight: 800; }

/* ---------- Ativação ---------- */
.ativacao { justify-content: center; }
.marca { text-align: center; color: var(--marca); }
.marca h1 { margin: 8px 0 0; font-size: 30px; }
.campo-codigo {
  width: 100%; padding: 14px; font-size: 44px; font-weight: 800; text-align: center; letter-spacing: 12px;
  border-radius: var(--raio); border: 3px solid var(--marca); background: var(--cartao); color: var(--texto);
}
.texto { font-size: 18px; line-height: 1.45; margin: 0; }
.instalar { background: var(--cartao); border-radius: var(--raio); padding: 16px; font-size: 17px; line-height: 1.5; box-shadow: var(--sombra); }
.instalar ol { margin: 8px 0 0; padding-left: 22px; }
.mensagem-erro { color: var(--erro); font-size: 18px; font-weight: 600; text-align: center; margin: 0; }

/* ---------- Combustível (abastecimento) ---------- */
.combustivel { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opcao {
  min-height: 64px; border-radius: 14px; background: var(--cartao); box-shadow: var(--sombra);
  border: 3px solid var(--borda); font-size: 24px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.opcao.ativo { background: var(--abastecimento); border-color: var(--abastecimento); color: #fff; }
.resumo .linha strong { font-size: 24px; }
