:root {
    --marca: #3aa3c7;
    --marca-forte: #1b708b;
    --marca-suave: #e8f5fa;
    --fundo: #f4f7f9;
    --card: #ffffff;
    --texto: #16232b;
    --texto-2: #5b6b75;
    --texto-3: #8a99a3;
    --borda: #e3e9ed;
    --verde: #1e9e63;
    --verde-suave: #e6f6ee;
    --vermelho: #c94b3c;
    --amarelo-suave: #fff6e0;
    --raio: 16px;
    --sombra: 0 1px 2px rgba(16, 35, 45, .04), 0 8px 24px rgba(16, 35, 45, .06);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--texto);
    background: var(--fundo);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: inherit; }
h1, h2 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { flex-shrink: 0; }

/* ---------- Topo ---------- */
.topo {
    background: #fff;
    border-bottom: 1px solid var(--borda);
    padding: 14px 16px;
}
.topo__inner {
    max-width: 760px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}
.topo__logo img { display: block; height: 52px; width: auto; }

/* ---------- Conteúdo ---------- */
.conteudo {
    flex: 1;
    width: 100%;
    max-width: 760px;
    margin: 28px auto 0;
    padding: 0 16px 40px;
}
.pagina { display: flex; flex-direction: column; gap: 16px; }

.card {
    background: var(--card);
    border-radius: var(--raio);
    box-shadow: var(--sombra);
    padding: 24px;
}
.card__titulo {
    font-size: 16px; font-weight: 600;
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    margin-bottom: 18px;
}
.card__titulo span { font-size: 13px; font-weight: 400; color: var(--texto-3); }

/* ---------- Hero / busca ---------- */
.hero {
    background: var(--card);
    border-radius: var(--raio);
    box-shadow: var(--sombra);
    padding: 40px 32px 32px;
    text-align: center;
}
.hero h1 { font-size: 30px; font-weight: 700; margin: 14px 0 8px; }
.hero p { color: var(--texto-2); margin: 0 auto 24px; max-width: 460px; }
.hero__selo {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--marca-suave); color: var(--marca-forte);
    font-size: 13px; font-weight: 600;
    padding: 5px 12px; border-radius: 999px;
}

.busca {
    position: relative;
    display: flex;
    gap: 8px;
    max-width: 560px;
    margin: 0 auto;
    background: var(--marca);
    border-radius: 14px;
    padding: 6px;
    box-shadow: 0 8px 24px rgba(27, 112, 139, .22);
    transition: box-shadow .15s, background .15s;
}
.busca:focus-within { background: #2f97bb; box-shadow: 0 0 0 4px rgba(58,163,199,.22), 0 8px 24px rgba(27, 112, 139, .22); }
.busca__icone { display: flex; align-items: center; padding-left: 10px; color: rgba(255,255,255,.85); }
.busca input {
    flex: 1; min-width: 0;
    border: 0; outline: 0; background: transparent;
    font: inherit; font-size: 16px; font-weight: 500;
    letter-spacing: .02em;
    color: #fff;
}
.busca input::placeholder { color: rgba(255,255,255,.75); font-weight: 400; letter-spacing: 0; }

.btn {
    border: 0; cursor: pointer;
    background: #fff; color: var(--marca-forte);
    font: inherit; font-weight: 600;
    padding: 12px 22px;
    border-radius: 10px;
    transition: background .15s, transform .05s;
}
.btn:hover { background: var(--marca-suave); }
.btn:active { transform: scale(.98); }
.is-loading .btn { pointer-events: none; color: transparent; position: relative; }
.is-loading .btn::after {
    content: ""; position: absolute; inset: 0; margin: auto;
    width: 18px; height: 18px; border-radius: 50%;
    border: 2.5px solid var(--marca-suave); border-top-color: var(--marca);
    animation: girar .7s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

.pagina__busca { display: flex; align-items: center; gap: 8px; }
.pagina__busca .busca { flex: 1; min-width: 0; max-width: none; margin: 0; }
.voltar {
    display: grid; place-items: center;
    width: 48px; height: 48px; flex-shrink: 0;
    border-radius: 12px; color: var(--marca-forte);
    background: #fff; box-shadow: var(--sombra);
    transition: background .15s;
}
.voltar:hover { background: var(--marca-suave); }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex; align-items: center;
    font-size: 12px; font-weight: 600;
    padding: 3px 10px; border-radius: 999px;
    background: var(--marca-suave); color: var(--marca-forte);
}
.badge--correios { background: #fff4cc; color: #8a6400; }
.badge--jadlog { background: #ffe7e3; color: #b23a26; }
.badge--totalexpress { background: #e7ebff; color: #3446a8; }


/* ---------- Resumo do rastreio ---------- */
.resumo__topo { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.resumo__servico { font-size: 13px; color: var(--texto-2); }
.codigo {
    margin-left: auto;
    display: inline-flex; align-items: center; gap: 6px;
    font: 600 13px ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: .03em;
    color: var(--texto-2);
    background: var(--fundo); border: 1px solid var(--borda);
    padding: 5px 10px; border-radius: 8px; cursor: pointer;
    transition: color .15s, border-color .15s;
}
.codigo:hover { color: var(--marca-forte); border-color: var(--marca); }
.codigo.copiado { color: var(--verde); border-color: var(--verde); }

.resumo__status { display: flex; align-items: flex-start; gap: 16px; }
.resumo__icone {
    display: grid; place-items: center;
    width: 56px; height: 56px; flex-shrink: 0;
    border-radius: 16px;
    background: var(--marca-suave); color: var(--marca);
}
.resumo--entregue .resumo__icone { background: var(--verde-suave); color: var(--verde); }
.resumo__rotulo { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--texto-3); }
.resumo__status h1 { font-size: 22px; font-weight: 700; margin: 2px 0 4px; }
.resumo__quando { font-size: 14px; color: var(--texto-2); }

.previsao {
    display: flex; align-items: center; gap: 8px;
    margin-top: 18px; padding: 10px 14px;
    background: var(--amarelo-suave); border-radius: 10px;
    font-size: 14px; color: #6e5300;
}

/* Barra de progresso */
.progresso {
    --cor: var(--marca);
    position: relative;
    display: grid; grid-template-columns: repeat(4, 1fr);
    list-style: none; padding: 0; margin: 28px 0 0;
}
.resumo--entregue .progresso { --cor: var(--verde); }
.progresso::before, .progresso::after {
    content: ""; position: absolute; top: 15px; left: 12.5%; height: 3px; border-radius: 3px;
}
.progresso::before { right: 12.5%; background: var(--borda); }
.progresso::after { width: calc((var(--etapa) - 1) * 25%); background: var(--cor); transition: width .6s ease; }
.progresso li { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.progresso__ponto {
    display: grid; place-items: center;
    width: 32px; height: 32px; border-radius: 50%;
    background: #fff; border: 2px solid var(--borda); color: var(--texto-3);
}
.progresso li.feito .progresso__ponto { background: var(--cor); border-color: var(--cor); color: #fff; }
.progresso li.atual .progresso__ponto { background: var(--cor); border-color: var(--cor); color: #fff; box-shadow: 0 0 0 5px color-mix(in srgb, var(--cor) 20%, transparent); }
.progresso__nome { font-size: 12px; font-weight: 500; color: var(--texto-3); }
.progresso li.feito .progresso__nome, .progresso li.atual .progresso__nome { color: var(--texto); }
.progresso li.atual .progresso__nome { font-weight: 600; }

/* ---------- Linha do tempo ---------- */
.timeline ul { list-style: none; margin: 0 0 8px; padding: 0; }
.timeline__dia {
    font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
    color: var(--texto-3);
    padding: 6px 0 10px;
}
.timeline__dia:first-letter { text-transform: uppercase; }
.evento {
    position: relative;
    display: grid; grid-template-columns: 48px 1fr; gap: 16px;
    padding: 0 0 20px;
}
.evento__hora { font-size: 13px; font-weight: 500; color: var(--texto-2); padding-top: 1px; font-variant-numeric: tabular-nums; }
.evento__corpo { position: relative; padding-left: 22px; }
.evento__corpo::before {
    content: ""; position: absolute; left: 0; top: 6px;
    width: 10px; height: 10px; border-radius: 50%;
    background: #fff; border: 2px solid #c4d1d8;
}
.evento__corpo::after {
    content: ""; position: absolute; left: 5px; top: 20px; bottom: -22px;
    width: 2px; margin-left: -1px; background: var(--borda);
}
.timeline ul:last-child .evento:last-child .evento__corpo::after { display: none; }
.timeline > ul:first-of-type .evento:first-child .evento__corpo::before {
    background: var(--marca); border-color: var(--marca);
    box-shadow: 0 0 0 4px rgba(58,163,199,.18);
}
.evento__corpo strong { display: block; font-weight: 600; }
.timeline > ul:not(:first-of-type) .evento strong,
.timeline > ul:first-of-type .evento:not(:first-child) strong { font-weight: 500; color: #33434c; }
.evento__local { display: block; font-size: 13px; color: var(--texto-2); }
.evento__detalhe {
    margin: 8px 0 0; padding: 8px 12px;
    font-size: 13px; color: var(--texto-2);
    background: var(--fundo); border-radius: 8px;
}

/* ---------- Vazio / erro ---------- */
.vazio { text-align: center; padding: 12px 8px 4px; }
.vazio__icone {
    display: inline-grid; place-items: center;
    width: 56px; height: 56px; border-radius: 50%;
    background: #fdecea; color: var(--vermelho);
    margin-bottom: 12px;
}
.vazio h1, .vazio h2 { font-size: 19px; font-weight: 600; margin-bottom: 6px; }
.vazio p { color: var(--texto-2); margin: 0 auto; max-width: 440px; }

/* ---------- Rodapé ---------- */
.rodape { text-align: center; font-size: 13px; color: var(--texto-3); padding: 8px 16px 32px; }
.rodape p { margin: 2px 0; }

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
    .topo__logo img { height: 42px; }
    .conteudo { margin-top: 20px; }
    .hero { padding: 28px 18px 22px; }
    .hero h1 { font-size: 24px; }
    .card { padding: 20px 16px; }
    .busca__icone { display: none; }
    .busca input { padding-left: 8px; }
    .btn { padding: 12px 16px; }
    .codigo { margin-left: 0; }
    .resumo__icone { width: 48px; height: 48px; border-radius: 14px; }
    .resumo__status h1 { font-size: 19px; }
    .progresso__nome { font-size: 11px; }
    .evento { grid-template-columns: 40px 1fr; gap: 10px; }
}
