:root {
  --azul-principal: #0f2d62;
  --azul-secundario: #1f4ca2;
  --azul-suave: #edf3ff;
  --cinza-fundo: #f5f7fb;
  --texto: #26323f;
  --verde: #1e9e61;
  --amarelo: #f7b731;
  --vermelho: #d64545;
  --laranja: #ef7e2e;
  --borda: #d7deea;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--cinza-fundo);
  color: var(--texto);
}

.container {
  width: min(1000px, calc(100% - 2rem));
  margin: 0 auto;
}

.topbar {
  background: linear-gradient(135deg, var(--azul-principal), var(--azul-secundario));
  color: #fff;
  padding: 2rem 0;
}

.brand {
  margin: 0;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  opacity: .9;
}

h1 {
  margin: .45rem 0 .35rem;
  font-size: clamp(1.4rem, 2.2vw, 2rem);
}

.subtitle {
  margin: 0;
  max-width: 50ch;
  opacity: .95;
}

.main-card {
  margin-top: -1.2rem;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 14px 35px rgba(15, 45, 98, 0.12);
  padding: 1.4rem;
}

.search-panel label {
  display: block;
  font-weight: 600;
  margin-bottom: .55rem;
}

.rastreio-form {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
}

input, button {
  border-radius: 10px;
  font-size: 1rem;
}

input {
  flex: 1;
  min-width: 230px;
  border: 1px solid var(--borda);
  padding: .85rem .95rem;
}

button {
  border: 0;
  background: var(--laranja);
  color: #fff;
  padding: .85rem 1.3rem;
  cursor: pointer;
  font-weight: 600;
}

button:hover { filter: brightness(0.95); }

.hint { margin: .55rem 0 0; color: #66758c; font-size: .92rem; }

.hidden { display: none; }

.loading,
.erro {
  margin-top: 1rem;
  border-radius: 10px;
  padding: .9rem;
}

.loading {
  background: var(--azul-suave);
  color: var(--azul-principal);
}

.erro {
  background: #fff0f0;
  color: #9f2727;
}

.resumo {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .8rem;
}

.info-card {
  border: 1px solid var(--borda);
  border-radius: 12px;
  padding: .85rem;
  background: #fff;
}

.info-card .label {
  color: #6a7c95;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.info-card .value {
  font-size: 1.05rem;
  font-weight: 700;
  margin-top: .2rem;
}

.alerta {
  border-left: 4px solid var(--amarelo);
  background: #fff8e8;
}

.sucesso {
  border-left: 4px solid var(--verde);
  background: #edfbf4;
}

.timeline-wrap { margin-top: 1.4rem; }

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 14px;
  width: 2px;
  background: #dce5f5;
}

.timeline-item {
  position: relative;
  margin-left: 2.4rem;
  margin-bottom: .95rem;
  border: 1px solid var(--borda);
  border-radius: 12px;
  padding: .85rem;
  background: #fff;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -2.2rem;
  top: 1.1rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--azul-secundario);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #dce5f5;
}

.timeline-item.entregue::before { background: var(--verde); }
.timeline-item.atencao::before { background: var(--amarelo); }
.timeline-item.falha::before { background: var(--vermelho); }

.timeline-item h3 {
  margin: .2rem 0 .4rem;
  font-size: 1.04rem;
  color: #143468;
}

.timeline-item p { margin: .35rem 0; }

.meta {
  color: #66758c;
  font-size: .88rem;
}

.destinos {
  margin-top: .5rem;
  display: grid;
  gap: .2rem;
  color: #33465f;
}

.destinos .label { font-weight: 700; }

.status-box {
  margin-top: .6rem;
  border-radius: 10px;
  background: var(--azul-suave);
  border: 1px solid #d2def7;
  padding: .7rem;
}

.status-box strong {
  display: block;
  margin-bottom: .2rem;
}

.cta-whatsapp {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  border-radius: 14px;
  background: var(--azul-principal);
  color: #fff;
  text-align: center;
  padding: 1.7rem 1rem;
}

.cta-whatsapp a {
  display: inline-block;
  margin-top: .75rem;
  text-decoration: none;
  background: var(--laranja);
  color: #fff;
  padding: .72rem 1.1rem;
  border-radius: 10px;
}

footer {
  text-align: center;
  color: #607189;
  padding: 0 0 1.4rem;
}
