:root {
  --marca: #e60012;
  --marca-escura: #b8000e;
  --marca-clara: #ffe9ea;
  --fundo: #f5f6f8;
  --card: #ffffff;
  --texto: #1d2129;
  --texto-2: #5f6673;
  --borda: #e3e6eb;
  --ok: #12a150;
  --ok-clara: #e5f6ec;
  --alerta: #d97706;
  --alerta-clara: #fef3e2;
  --sombra: 0 6px 24px rgba(20, 24, 31, .08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fundo: #121418;
    --card: #1b1e24;
    --texto: #eceef2;
    --texto-2: #a3a9b5;
    --borda: #2c3038;
    --marca-clara: #3a1418;
    --ok-clara: #0f2e1d;
    --alerta-clara: #36260d;
    --sombra: 0 6px 24px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--fundo);
  color: var(--texto);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Topo */
.topo { background: var(--marca); color: #fff; position: sticky; top: 0; z-index: 10; }
.topo__in { max-width: 1120px; margin: 0 auto; padding: 0 16px; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.marca { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; text-decoration: none; letter-spacing: -.01em; white-space: nowrap; }
.marca__icone { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: rgba(255,255,255,.18); }
.menu { display: flex; gap: 4px; }
.menu a { text-decoration: none; font-weight: 600; font-size: 14px; padding: 8px 12px; border-radius: 8px; opacity: .9; }
.menu a:hover { background: rgba(255,255,255,.14); opacity: 1; }
.menu a.ativo { background: rgba(255,255,255,.2); opacity: 1; }

/* Hero com busca */
.hero { background: linear-gradient(180deg, var(--marca) 0%, var(--marca-escura) 100%); color: #fff; padding: 48px 16px 88px; }
.hero__in { max-width: 860px; margin: 0 auto; text-align: center; }
.hero h1 { margin: 0 0 8px; font-size: clamp(26px, 4.5vw, 40px); font-weight: 800; letter-spacing: -.02em; }
.hero p { margin: 0 0 28px; opacity: .9; }

.busca { display: flex; gap: 8px; background: #fff; padding: 8px; border-radius: 999px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.campo { flex: 1; display: flex; }
.campo--doc { flex: 0 0 230px; border-left: 1px solid #e3e6eb; }
.campo input { width: 100%; border: 0; outline: 0; background: transparent; font: inherit; font-size: 15px; color: #1d2129; padding: 12px 18px; }
.campo input::placeholder { color: #8a909c; }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer; background: var(--marca); color: #fff; font: inherit; font-weight: 700; font-size: 15px; padding: 0 26px; border-radius: 999px; min-height: 46px; }
.btn:hover { background: var(--marca-escura); }
.btn:disabled { opacity: .6; cursor: wait; }

/* Conteúdo */
.conteudo { max-width: 860px; margin: -56px auto 0; padding: 0 16px 48px; position: relative; }
.card { background: var(--card); border: 1px solid var(--borda); border-radius: 16px; box-shadow: var(--sombra); padding: 24px; margin-bottom: 16px; }
.card__titulo { margin: 0 0 20px; font-size: 17px; }

.estado { background: var(--card); border: 1px solid var(--borda); border-radius: 16px; box-shadow: var(--sombra); padding: 28px; text-align: center; color: var(--texto-2); margin-bottom: 16px; }
.estado--erro { border-color: var(--marca); color: var(--texto); }

/* Resumo */
.resumo__topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.rotulo { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--texto-2); font-weight: 600; }
.codigo { margin: 2px 0 4px; font-size: 24px; letter-spacing: .02em; word-break: break-all; }
.sub { font-size: 14px; color: var(--texto-2); }
.selo { font-size: 13px; font-weight: 700; padding: 6px 14px; border-radius: 999px; background: var(--marca-clara); color: var(--marca); white-space: nowrap; }
.selo--entregue { background: var(--ok-clara); color: var(--ok); }
.selo--ocorrencia { background: var(--alerta-clara); color: var(--alerta); }

/* Etapas */
.etapas { list-style: none; margin: 28px 0 8px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.etapas li { position: relative; text-align: center; font-size: 13px; font-weight: 600; color: var(--texto-2); }
.etapas li::before { content: ""; position: absolute; top: 11px; left: -50%; width: 100%; height: 4px; background: var(--borda); }
.etapas li:first-child::before { display: none; }
.etapas i { position: relative; z-index: 1; display: block; width: 26px; height: 26px; margin: 0 auto 8px; border-radius: 50%; background: var(--card); border: 4px solid var(--borda); }
.etapas li.feito, .etapas li.atual { color: var(--texto); }
.etapas li.feito::before, .etapas li.atual::before { background: var(--marca); }
.etapas li.feito i { background: var(--marca); border-color: var(--marca); }
.etapas li.atual i { border-color: var(--marca); box-shadow: 0 0 0 5px var(--marca-clara); }
.etapas.entregue li::before, .etapas.entregue li.feito i { background: var(--ok); border-color: var(--ok); }
.etapas.entregue li.atual i { background: var(--ok); border-color: var(--ok); box-shadow: 0 0 0 5px var(--ok-clara); }
.etapas.ocorrencia li.atual i { border-color: var(--alerta); box-shadow: 0 0 0 5px var(--alerta-clara); }

/* Dados */
.dados { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 24px; margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--borda); }
.dados dt { font-size: 12px; color: var(--texto-2); margin-bottom: 4px; }
.dados dd { margin: 0; font-weight: 600; font-size: 14px; }

/* Linha do tempo */
.linha { list-style: none; margin: 0; padding: 0; }
.linha li { position: relative; display: grid; grid-template-columns: 96px 1fr; gap: 16px; padding-bottom: 22px; }
.linha li:last-child { padding-bottom: 0; }
.linha__data { text-align: right; font-size: 13px; color: var(--texto-2); line-height: 1.4; }
.linha__data b { display: block; color: var(--texto); font-size: 14px; }
.linha__corpo { position: relative; padding-left: 24px; }
.linha__corpo::before { content: ""; position: absolute; left: 5px; top: 18px; bottom: -22px; width: 2px; background: var(--borda); }
.linha li:last-child .linha__corpo::before { display: none; }
.linha__corpo::after { content: ""; position: absolute; left: 0; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--borda); }
.linha li:first-child .linha__corpo::after { background: var(--marca); box-shadow: 0 0 0 4px var(--marca-clara); }
.linha.entregue li:first-child .linha__corpo::after { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-clara); }
.linha.ocorrencia li:first-child .linha__corpo::after { background: var(--alerta); box-shadow: 0 0 0 4px var(--alerta-clara); }
.linha__status { font-weight: 700; font-size: 15px; }
.linha__desc { font-size: 14px; color: var(--texto-2); margin-top: 2px; }
.linha__local { font-size: 13px; color: var(--texto-2); margin-top: 4px; }

/* Ajuda */
.ajuda { margin-top: 32px; }
.ajuda h3 { font-size: 17px; margin: 0 0 12px; }
.ajuda details { background: var(--card); border: 1px solid var(--borda); border-radius: 12px; padding: 14px 18px; margin-bottom: 8px; }
.ajuda summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.ajuda p { margin: 10px 0 0; font-size: 14px; color: var(--texto-2); line-height: 1.5; }

/* Rodapé */
.rodape { background: #1d2129; color: #c9ced8; font-size: 14px; }
.rodape__in { max-width: 1120px; margin: 0 auto; padding: 24px 16px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Celular */
@media (max-width: 680px) {
  .menu a:not(.ativo) { display: none; }
  .hero { padding: 32px 16px 80px; }
  .busca { flex-direction: column; border-radius: 16px; }
  .campo--doc { flex: 1; border-left: 0; border-top: 1px solid #e3e6eb; }
  .btn { justify-content: center; border-radius: 12px; }
  .dados { grid-template-columns: 1fr 1fr; }
  .etapas li { font-size: 11px; }
  .linha li { grid-template-columns: 1fr; gap: 4px; }
  .linha__data { text-align: left; padding-left: 24px; }
  .linha__data b { display: inline; margin-right: 6px; }
  .linha__corpo::before { top: 4px; }
}
