/* Trânsito Fortaleza - estilos do front-end (tudo escopado em .tfz) */

.tfz {
  --tfz-texto: #1f2937;
  --tfz-suave: #5b6472;
  --tfz-fundo: #ffffff;
  --tfz-cartao: #ffffff;
  --tfz-borda: #dde1e7;
  --tfz-faixa: #f3f5f8;
  --tfz-fluindo: #1b7f3b;
  --tfz-lento: #9a5b00;
  --tfz-congestionado: #c0272d;
  --tfz-interditada: #3d3d3d;
  --tfz-sem_dados: #5b6472;
  color: var(--tfz-texto);
  line-height: 1.45;
  font-size: 1rem;
  max-width: 1280px;
  margin: 0 auto;
}

.tfz *, .tfz *::before, .tfz *::after { box-sizing: border-box; }
.tfz [hidden] { display: none !important; }

/* ---------- cabeçalho ---------- */
.tfz__linha { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; justify-content: space-between; }
.tfz__titulo { margin: 0; font-size: 1.5rem; line-height: 1.2; }
.tfz__sub { margin: 6px 0 12px; color: var(--tfz-suave); font-size: .92rem; }

.tfz__chip, .tfz__badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  font-size: .85rem;
  white-space: nowrap;
  background: var(--nv, var(--tfz-sem_dados));
}
.tfz__chip { font-size: .95rem; padding: 6px 14px; }
.tfz__chip--fluindo, .tfz__badge--fluindo, .tfz__cartao--fluindo { --nv: var(--tfz-fluindo); }
.tfz__chip--lento, .tfz__badge--lento, .tfz__cartao--lento { --nv: var(--tfz-lento); }
.tfz__chip--congestionado, .tfz__badge--congestionado, .tfz__cartao--congestionado { --nv: var(--tfz-congestionado); }
.tfz__chip--interditada, .tfz__badge--interditada, .tfz__cartao--interditada { --nv: var(--tfz-interditada); }
.tfz__chip--sem_dados, .tfz__badge--sem_dados, .tfz__cartao--sem_dados { --nv: var(--tfz-sem_dados); }

.tfz__contadores { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tfz__cont {
  background: var(--tfz-faixa);
  border-left: 5px solid var(--nv, var(--tfz-sem_dados));
  padding: 6px 12px;
  border-radius: 6px;
  font-size: .95rem;
}
.tfz__cont strong { font-size: 1.15rem; }
.tfz__cont--fluindo { --nv: var(--tfz-fluindo); }
.tfz__cont--lento { --nv: var(--tfz-lento); }
.tfz__cont--congestionado { --nv: var(--tfz-congestionado); }
.tfz__cont--interditada { --nv: var(--tfz-interditada); }

/* ---------- avisos ---------- */
.tfz__aviso {
  background: #fff7e0;
  border: 1px solid #f0c75a;
  color: #5a4300;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 14px;
  font-size: .93rem;
}

.tfz__redacao { display: grid; gap: 10px; margin-bottom: 14px; }
.tfz__redacao:empty { display: none; }
.tfz__red {
  border: 1px solid var(--tfz-borda);
  border-left: 6px solid #2563eb;
  background: var(--tfz-cartao);
  padding: 10px 14px;
  border-radius: 6px;
}
.tfz__red--atencao { border-left-color: #d97706; }
.tfz__red--grave { border-left-color: #c0272d; }
.tfz__red-tag { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--tfz-suave); }
.tfz__red-tit { margin: 2px 0 0; font-weight: 700; }
.tfz__red-txt { margin: 4px 0 0; }

/* ---------- grade principal ---------- */
.tfz__grade { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
.tfz__mapa { width: 100%; min-height: 300px; border: 1px solid var(--tfz-borda); border-radius: 8px; background: var(--tfz-faixa); overflow: hidden; }

@media (min-width: 980px) {
  .tfz__grade--mapa { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
  .tfz__grade--mapa .tfz__col-mapa { position: sticky; top: 16px; }
}

.tfz__filtros { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 10px; }
.tfz__sel { padding: 6px 10px; border: 1px solid var(--tfz-borda); border-radius: 6px; background: var(--tfz-cartao); color: inherit; font: inherit; }
.tfz__chk { font-size: .93rem; cursor: pointer; }

.tfz__lista { display: grid; gap: 10px; }

/* ---------- cartões das vias ---------- */
.tfz__cartao {
  background: var(--tfz-cartao);
  border: 1px solid var(--tfz-borda);
  border-left: 6px solid var(--nv, var(--tfz-sem_dados));
  border-radius: 8px;
  padding: 12px 14px;
}
.tfz__cartao-topo { display: flex; gap: 8px 12px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.tfz__cartao-nome { margin: 0; font-size: 1.05rem; line-height: 1.25; }
.tfz__cartao-sub { margin: 2px 0 0; color: var(--tfz-suave); font-size: .9rem; }
.tfz__nota { margin: 8px 0 0; color: var(--tfz-suave); font-size: .92rem; }
.tfz__nota--suave { font-size: .82rem; }

.tfz__metricas { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px 14px; margin: 10px 0 0; }
.tfz__metrica dt { font-size: .78rem; color: var(--tfz-suave); text-transform: uppercase; letter-spacing: .02em; }
.tfz__metrica dd { margin: 0; font-weight: 700; font-size: 1.02rem; }

.tfz__barra { height: 8px; border-radius: 999px; background: var(--tfz-faixa); margin-top: 10px; overflow: hidden; }
.tfz__barra span { display: block; height: 100%; background: var(--nv, var(--tfz-sem_dados)); border-radius: 999px; }

.tfz__orient { margin-top: 10px; padding: 8px 10px; background: var(--tfz-faixa); border-radius: 6px; font-size: .93rem; }
.tfz__alts { margin-top: 10px; font-size: .93rem; }
.tfz__alts ul { margin: 4px 0 0; padding-left: 18px; }
.tfz__alt--melhor { font-weight: 700; }

.tfz__ver-mapa {
  margin-top: 10px;
  padding: 6px 12px;
  border: 1px solid var(--tfz-borda);
  border-radius: 6px;
  background: var(--tfz-cartao);
  color: inherit;
  font: inherit;
  font-size: .88rem;
  cursor: pointer;
}
.tfz__ver-mapa:hover, .tfz__ver-mapa:focus-visible { background: var(--tfz-faixa); }

/* ---------- ocorrências ---------- */
.tfz__sec-oc { margin-top: 24px; }
.tfz__h3 { margin: 0 0 10px; font-size: 1.15rem; }
.tfz__ocorr { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.tfz__oc {
  border: 1px solid var(--tfz-borda);
  border-left: 6px solid #6b7280;
  background: var(--tfz-cartao);
  border-radius: 8px;
  padding: 10px 12px;
}
.tfz__oc--moderada { border-left-color: #d97706; }
.tfz__oc--grave, .tfz__oc--indefinida { border-left-color: #c0272d; }
.tfz__oc-topo { display: flex; gap: 6px; flex-wrap: wrap; }
.tfz__tag { background: #5b21b6; color: #fff; font-size: .78rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.tfz__tag--suave { background: var(--tfz-faixa); color: var(--tfz-texto); }
.tfz__oc-desc { margin: 6px 0 0; }
.tfz__oc-local, .tfz__oc-meta { margin: 4px 0 0; color: var(--tfz-suave); font-size: .88rem; }

.tfz__vazio, .tfz__carregando { color: var(--tfz-suave); padding: 12px 0; margin: 0; }
.tfz__rodape { margin-top: 22px; color: var(--tfz-suave); font-size: .8rem; }
.tfz__info { font-size: .9rem; color: #1f2937; }

/* ---------- modo painel (telão / estúdio) ---------- */
.tfz--painel {
  --tfz-texto: #eef2f8;
  --tfz-suave: #aab4c3;
  --tfz-fundo: #0b1220;
  --tfz-cartao: #141c2e;
  --tfz-borda: #26324a;
  --tfz-faixa: #1b2540;
  --tfz-fluindo: #34c864;
  --tfz-lento: #ffb020;
  --tfz-congestionado: #ff5a5f;
  --tfz-interditada: #9aa4b2;
  background: var(--tfz-fundo);
  padding: 24px;
  max-width: none;
  font-size: 1.15rem;
  min-height: 100vh;
}
.tfz--painel .tfz__titulo { font-size: 2rem; }
.tfz--painel .tfz__chip, .tfz--painel .tfz__badge { color: #0b1220; }
.tfz--painel .tfz__chip { font-size: 1.2rem; padding: 8px 18px; }
.tfz--painel .tfz__cont strong { font-size: 1.6rem; }
.tfz--painel .tfz__cartao-nome { font-size: 1.3rem; }
.tfz--painel .tfz__metrica dd { font-size: 1.25rem; }
.tfz--painel .tfz__mapa { height: 72vh; }
.tfz--painel .tfz__lista { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.tfz--painel .tfz__aviso { background: #3a2f10; border-color: #8a6a1a; color: #ffe9a8; }
.tfz--painel .tfz__ver-mapa { display: none; }

@media (prefers-reduced-motion: reduce) {
  .tfz * { scroll-behavior: auto !important; }
}
