:root {
  color-scheme: light dark;
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #1b2330;
  --muted: #5d6878;
  --line: #dde2ea;
  --accent: #1f6feb;
  --accent-text: #ffffff;
  --ok: #1a7f37;
  --ok-bg: #e6f4ea;
  --info: #1f6feb;
  --info-bg: #e8f0fe;
  --alerta: #b35900;
  --alerta-bg: #fff1e0;
  --neutro: #5d6878;
  --neutro-bg: #eef0f4;
  --erro: #c62828;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141b;
    --card: #171e28;
    --text: #e6ebf2;
    --muted: #98a3b3;
    --line: #2a3442;
    --accent: #4c8dff;
    --ok: #4cc06b;
    --ok-bg: #15301f;
    --info: #6ea2ff;
    --info-bg: #172742;
    --alerta: #f0a04b;
    --alerta-bg: #3a2812;
    --neutro: #a3adbb;
    --neutro-bg: #222b37;
    --erro: #ff7b72;
  }
}

* {
  box-sizing: border-box;
}
/* .passos / .visita set their own display: hidden must still win */
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
.wrap {
  max-width: 620px;
  margin: 0 auto;
  padding: 28px 16px 40px;
}
.top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.logo {
  flex: none;
}
.empresa {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
h1 {
  margin: 0;
  font-size: 23px;
  line-height: 1.2;
}

.busca,
.resultado {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.busca label {
  font-weight: 650;
}
.ajuda {
  margin: 2px 0 12px;
  color: var(--muted);
  font-size: 14px;
}
.linha {
  display: flex;
  gap: 10px;
}
input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 20px;
  font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
}
input::placeholder {
  letter-spacing: normal;
  font-family: system-ui, sans-serif;
  font-size: 16px;
  color: var(--muted);
}
input:focus,
button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent);
  outline-offset: 1px;
  border-color: var(--accent);
}
button {
  font: inherit;
  font-weight: 650;
  border: 0;
  border-radius: 10px;
  padding: 10px 18px;
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
}
button:disabled {
  opacity: 0.6;
  cursor: progress;
}
button.link {
  background: none;
  color: var(--accent);
  padding: 0;
  font-weight: 600;
  text-decoration: underline;
}
.erro {
  margin: 12px 0 0;
  color: var(--erro);
  font-weight: 600;
}

.resultado {
  margin-top: 16px;
  --tom: var(--info);
  --tom-bg: var(--info-bg);
}
.resultado[data-tom='ok'] {
  --tom: var(--ok);
  --tom-bg: var(--ok-bg);
}
.resultado[data-tom='alerta'] {
  --tom: var(--alerta);
  --tom-bg: var(--alerta-bg);
}
.resultado[data-tom='neutro'] {
  --tom: var(--neutro);
  --tom-bg: var(--neutro-bg);
}
.status {
  background: var(--tom-bg);
  border-left: 5px solid var(--tom);
  border-radius: 10px;
  padding: 14px 16px;
}
.ola {
  margin: 0 0 2px;
  color: var(--muted);
  font-weight: 600;
}
.status h2 {
  margin: 0 0 4px;
  font-size: 21px;
  color: var(--tom);
}
.status p {
  margin: 0;
}

.passos {
  list-style: none;
  margin: 22px 0 4px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  counter-reset: passo;
}
.passos li {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
/* the line between two steps */
.passos li + li::before {
  content: '';
  position: absolute;
  top: 11px;
  right: 50%;
  width: 100%;
  height: 3px;
  background: var(--line);
  z-index: 0;
}
.passos li.feito + li::before {
  background: var(--tom);
}
.bolinha {
  position: relative;
  z-index: 1;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  border: 3px solid var(--line);
  background: var(--card);
}
.feito .bolinha {
  background: var(--tom);
  border-color: var(--tom);
}
.feito .bolinha::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid var(--card);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}
.atual .bolinha {
  border-color: var(--tom);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--tom) 22%, transparent);
}
.atual {
  color: var(--text);
  font-weight: 700;
}
.feito {
  color: var(--text);
}

.visita {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.visita-rotulo {
  width: 100%;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.visita strong {
  font-size: 19px;
}

.dados {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 16px;
  margin: 18px 0 0;
}
.dados dt {
  color: var(--muted);
}
.dados dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.rodape {
  margin: 18px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.contato {
  margin-top: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  white-space: pre-line;
}

@media (max-width: 480px) {
  .wrap {
    padding-top: 18px;
  }
  h1 {
    font-size: 20px;
  }
  .linha {
    flex-direction: column;
  }
  .passos li {
    font-size: 11.5px;
  }
  .dados {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .dados dd {
    margin-bottom: 8px;
  }
}
