/* =====================================================================
   Chegadas — Instituto Cordial
   Metáfora: o crachá. Quem chegou tem crachá impresso (cartão branco,
   sólido). Quem não chegou tem só o contorno da etiqueta em branco.
   ===================================================================== */

:root {
  --bg:        #131820;
  --bg-alto:   #1A212C;
  --painel:    #1D2531;
  --linha:     #2A3444;
  --linha-forte:#3A4759;

  --papel:     #F6F8FA;
  --tinta:     #101620;
  --tinta-2:   #4A5768;

  --texto:     #E6EBF2;
  --texto-2:   #94A2B5;
  --texto-3:   #64728a;

  --presente:  #35D6A0;
  --presente-fundo: rgba(53, 214, 160, .12);
  --destaque:  #F2B441;
  --destaque-fundo: rgba(242, 180, 65, .13);
  --alerta:    #FF7A6B;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;

  --sombra: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.28);

  --display: 'Archivo', system-ui, sans-serif;
  --corpo:   'Archivo', system-ui, -apple-system, sans-serif;
  --dado:    'IBM Plex Mono', ui-monospace, monospace;

  --topo: env(safe-area-inset-top, 0px);
  --base: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--bg);
  color: var(--texto);
  font-family: var(--corpo);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }

:focus-visible {
  outline: 2px solid var(--destaque);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- utilitários de texto ---------- */

.rotulo {
  font-family: var(--dado);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--texto-3);
}

.dado { font-family: var(--dado); font-variant-numeric: tabular-nums; }

.oculto-visual {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* =====================================================================
   ENTRADA
   ===================================================================== */

.entrada {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px 22px calc(28px + var(--base));
}

.entrada-caixa { width: 100%; max-width: 380px; }

.marca {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 34px;
}
.marca-nome {
  font-family: var(--display);
  font-variation-settings: 'wdth' 112;
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -.01em;
}
.marca-org {
  font-family: var(--dado);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--texto-3);
}

.entrada-texto {
  color: var(--texto-2);
  font-size: 15px;
  margin-bottom: 24px;
  max-width: 32ch;
}

.campo { display: block; margin-bottom: 16px; }
.campo > .rotulo { display: block; margin-bottom: 7px; }

.entrada-campo, .form-campo {
  width: 100%;
  background: var(--bg-alto);
  border: 1px solid var(--linha);
  border-radius: var(--r-md);
  padding: 13px 14px;
  color: var(--texto);
  font-size: 16px;
}
.entrada-campo::placeholder, .form-campo::placeholder { color: var(--texto-3); }
.entrada-campo:focus, .form-campo:focus {
  border-color: var(--linha-forte);
  outline: none;
  background: #222b39;
}

.campo-codigo {
  font-family: var(--dado);
  font-size: 30px;
  letter-spacing: .3em;
  text-align: center;
  padding: 16px 14px;
}

.botao {
  width: 100%;
  background: var(--papel);
  color: var(--tinta);
  font-weight: 600;
  font-size: 15px;
  padding: 14px;
  border-radius: var(--r-md);
  transition: opacity .15s;
}
.botao:hover { opacity: .88; }
.botao[disabled] { opacity: .45; cursor: default; }

.botao-vazado {
  width: 100%;
  background: none;
  border: 1px solid var(--linha);
  color: var(--texto-2);
  font-size: 14px;
  padding: 12px;
  border-radius: var(--r-md);
  margin-top: 10px;
}
.botao-vazado:hover { border-color: var(--linha-forte); color: var(--texto); }

.aviso {
  font-size: 14px;
  padding: 11px 13px;
  border-radius: var(--r-md);
  margin-bottom: 16px;
  border: 1px solid;
}
.aviso-erro { color: var(--alerta); border-color: rgba(255,122,107,.35); background: rgba(255,122,107,.08); }
.aviso-ok   { color: var(--presente); border-color: rgba(53,214,160,.32); background: var(--presente-fundo); }

/* =====================================================================
   CABEÇALHO
   ===================================================================== */

.topo {
  position: sticky; top: 0; z-index: 20;
  background: rgba(19,24,32,.93);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--linha);
  padding: calc(var(--topo) + 12px) 18px 12px;
}

.topo-linha { display: flex; align-items: center; gap: 12px; }

.voltar {
  display: flex; align-items: center; gap: 6px;
  color: var(--texto-2);
  font-size: 14px;
  padding: 4px 0;
  margin-right: auto;
}
.voltar:hover { color: var(--texto); }

.topo-titulo {
  font-family: var(--display);
  font-variation-settings: 'wdth' 112;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -.01em;
  margin-right: auto;
}

.topo-acao {
  font-size: 13px;
  color: var(--texto-2);
  padding: 6px 10px;
  border: 1px solid var(--linha);
  border-radius: 100px;
}
.topo-acao:hover { color: var(--texto); border-color: var(--linha-forte); }

.conteudo { padding: 20px 18px calc(40px + var(--base)); }

/* =====================================================================
   BUSCA E FILTROS
   ===================================================================== */

.busca { position: relative; margin-bottom: 14px; }
.busca-campo {
  width: 100%;
  background: var(--bg-alto);
  border: 1px solid var(--linha);
  border-radius: 100px;
  padding: 11px 16px 11px 40px;
  font-size: 15px;
}
.busca-campo:focus { outline: none; border-color: var(--linha-forte); }
.busca-lupa {
  position: absolute; left: 15px; top: 50%;
  transform: translateY(-50%);
  color: var(--texto-3);
  pointer-events: none;
  font-size: 14px;
}

.chips {
  display: flex; gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
  margin-bottom: 18px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 100px;
  border: 1px solid var(--linha);
  color: var(--texto-2);
  white-space: nowrap;
}
.chip:hover { border-color: var(--linha-forte); }
.chip[aria-pressed="true"] {
  background: var(--papel);
  border-color: var(--papel);
  color: var(--tinta);
}
.chip-contagem {
  font-family: var(--dado);
  font-size: 11px;
  opacity: .6;
  margin-left: 5px;
}

/* =====================================================================
   LISTA DE EVENTOS
   ===================================================================== */

.evento-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 16px 0;
  border-bottom: 1px solid var(--linha);
}
.evento-item:first-child { padding-top: 4px; }

.evento-topo {
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 5px;
}
.evento-data {
  font-family: var(--dado);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .06em;
  color: var(--texto-3);
  text-transform: uppercase;
}
.evento-nome {
  font-family: var(--display);
  font-variation-settings: 'wdth' 112;
  font-weight: 600;
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: -.005em;
  margin-bottom: 6px;
}
.evento-local {
  font-size: 13px;
  color: var(--texto-2);
}

.selo {
  font-family: var(--dado);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 3px;
  border: 1px solid var(--linha-forte);
  color: var(--texto-2);
}
.selo-agora {
  background: var(--presente-fundo);
  border-color: rgba(53,214,160,.4);
  color: var(--presente);
}

/* =====================================================================
   PAINEL DO EVENTO — o pulso
   ===================================================================== */

.pulso { margin-bottom: 22px; }

.pulso-numeros {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}
.pulso-presentes {
  font-family: var(--dado);
  font-weight: 600;
  font-size: 46px;
  line-height: 1;
  letter-spacing: -.03em;
  color: var(--presente);
}
.pulso-total {
  font-family: var(--dado);
  font-size: 17px;
  color: var(--texto-3);
}
.pulso-taxa {
  margin-left: auto;
  font-family: var(--dado);
  font-size: 13px;
  color: var(--texto-2);
}

.barra {
  height: 5px;
  background: var(--linha);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 9px;
}
.barra-preenchida {
  height: 100%;
  background: var(--presente);
  border-radius: 100px;
  transition: width .5s ease;
}

.pulso-nota {
  font-size: 13px;
  color: var(--texto-2);
}
.pulso-nota strong { color: var(--texto); font-weight: 600; }

/* Recorte por tipo de participante */
.recortes {
  display: flex; gap: 8px;
  overflow-x: auto;
  margin: 18px -18px 0;
  padding: 0 18px 2px;
  scrollbar-width: none;
}
.recortes::-webkit-scrollbar { display: none; }

.recorte {
  flex: 0 0 auto;
  min-width: 106px;
  background: var(--painel);
  border: 1px solid var(--linha);
  border-radius: var(--r-md);
  padding: 11px 13px;
  text-align: left;
}
.recorte:hover { border-color: var(--linha-forte); }
.recorte[aria-pressed="true"] { border-color: var(--papel); }
.recorte-tipo {
  font-size: 12px;
  color: var(--texto-2);
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recorte-valor {
  font-family: var(--dado);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -.02em;
}
.recorte-valor span { font-size: 12px; font-weight: 400; color: var(--texto-3); }
.recorte-destacado { border-color: rgba(242,180,65,.4); }
.recorte-destacado .recorte-tipo { color: var(--destaque); }

/* ---------- abas ---------- */

.abas {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid var(--linha);
  margin: 24px 0 16px;
}
.aba {
  font-size: 14px;
  font-weight: 500;
  color: var(--texto-3);
  padding: 0 0 11px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.aba[aria-selected="true"] { color: var(--texto); border-bottom-color: var(--papel); }
.aba-contagem { font-family: var(--dado); font-size: 12px; opacity: .65; margin-left: 5px; }

/* =====================================================================
   O CRACHÁ — assinatura da interface
   ===================================================================== */

.crachas { display: flex; flex-direction: column; gap: 8px; }

.cracha {
  display: block;
  width: 100%;
  text-align: left;
  position: relative;
  padding: 13px 15px 13px 17px;
  border-radius: var(--r-sm);
  transition: transform .12s ease;
}
.cracha:active { transform: scale(.985); }

/* impresso — a pessoa chegou */
.cracha-impresso {
  background: var(--papel);
  color: var(--tinta);
  box-shadow: var(--sombra);
}
.cracha-impresso::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--presente);
  border-radius: var(--r-sm) 0 0 var(--r-sm);
}

/* não impresso — ainda não chegou */
.cracha-vazio {
  background: transparent;
  border: 1px dashed var(--linha-forte);
  color: var(--texto-2);
}

.cracha-nome {
  font-family: var(--display);
  font-variation-settings: 'wdth' 112;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: -.01em;
  margin-bottom: 3px;
  overflow-wrap: anywhere;
}
.cracha-vazio .cracha-nome { font-weight: 500; color: var(--texto); }

.cracha-org {
  font-size: 13px;
  line-height: 1.35;
  color: var(--tinta-2);
}
.cracha-vazio .cracha-org { color: var(--texto-3); }

.cracha-rodape {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px;
}

.cracha-tipo {
  font-family: var(--dado);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 3px 6px;
  border-radius: 3px;
  background: rgba(16,22,32,.07);
  color: var(--tinta-2);
}
.cracha-vazio .cracha-tipo { background: rgba(255,255,255,.05); color: var(--texto-3); }
.cracha-tipo-destaque {
  background: var(--destaque-fundo);
  color: #A9761B;
}
.cracha-vazio .cracha-tipo-destaque { color: var(--destaque); }

.cracha-hora {
  margin-left: auto;
  font-family: var(--dado);
  font-size: 11px;
  color: var(--tinta-2);
}
.cracha-vazio .cracha-hora { color: var(--texto-3); }

.cracha-recente::after {
  content: '';
  position: absolute;
  top: 11px; right: 11px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--presente);
  box-shadow: 0 0 0 3px rgba(53,214,160,.2);
}

/* faixa de chegadas recentes */
.faixa-recentes {
  background: var(--presente-fundo);
  border: 1px solid rgba(53,214,160,.25);
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin-bottom: 16px;
}
.faixa-recentes .rotulo { color: var(--presente); margin-bottom: 8px; display: block; }
.faixa-recentes-lista { font-size: 14px; line-height: 1.6; }
.faixa-recentes-lista span { color: var(--texto-2); }

/* =====================================================================
   FICHA DO PARTICIPANTE
   ===================================================================== */

.ficha-cracha {
  background: var(--papel);
  color: var(--tinta);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--sombra);
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}
.ficha-cracha-ausente {
  background: transparent;
  color: var(--texto);
  border: 1px dashed var(--linha-forte);
  box-shadow: none;
}

.ficha-furo {
  width: 42px; height: 5px;
  border-radius: 100px;
  background: rgba(16,22,32,.14);
  margin: 0 auto 18px;
}
.ficha-cracha-ausente .ficha-furo { background: var(--linha-forte); }

.ficha-nome {
  font-family: var(--display);
  font-variation-settings: 'wdth' 112;
  font-weight: 700;
  font-size: 25px;
  line-height: 1.14;
  letter-spacing: -.02em;
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}
.ficha-cargo { font-size: 15px; color: var(--tinta-2); line-height: 1.4; }
.ficha-cracha-ausente .ficha-cargo { color: var(--texto-2); }

.ficha-estado {
  display: flex; align-items: center; gap: 7px;
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid rgba(16,22,32,.09);
  font-size: 14px;
  font-weight: 500;
}
.ficha-cracha-ausente .ficha-estado { border-top-color: var(--linha); }
.ponto { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.ponto-presente { background: var(--presente); }
.ponto-ausente  { background: var(--texto-3); }

/* ações de contato */
.contatos { display: flex; gap: 8px; margin-bottom: 24px; }
.contato {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  background: var(--painel);
  border: 1px solid var(--linha);
  border-radius: var(--r-md);
  padding: 12px 6px;
  font-size: 12px;
  color: var(--texto-2);
  text-decoration: none;
}
.contato:hover { border-color: var(--linha-forte); color: var(--texto); }
.contato-icone { font-size: 17px; }

/* blocos de dados */
.bloco { margin-bottom: 26px; }
.bloco > .rotulo { display: block; margin-bottom: 11px; }

.linhas { border-top: 1px solid var(--linha); }
.linha {
  display: flex;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--linha);
  font-size: 14px;
}
.linha-chave { flex: 0 0 96px; color: var(--texto-3); }
.linha-valor { flex: 1; overflow-wrap: anywhere; }
.linha-valor button {
  color: var(--texto-3);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.observacao {
  background: var(--painel);
  border: 1px solid var(--linha);
  border-left: 3px solid var(--destaque);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 13px 15px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--texto);
  white-space: pre-wrap;
}

/* linha do tempo de check-ins */
.tempo { position: relative; padding-left: 20px; }
.tempo::before {
  content: '';
  position: absolute; left: 3px; top: 6px; bottom: 6px;
  width: 1px;
  background: var(--linha);
}
.tempo-item { position: relative; padding-bottom: 16px; }
.tempo-item:last-child { padding-bottom: 0; }
.tempo-item::before {
  content: '';
  position: absolute; left: -20px; top: 6px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--presente);
  box-shadow: 0 0 0 3px var(--bg);
}
.tempo-cancelado::before { background: var(--texto-3); }
.tempo-quando {
  font-family: var(--dado);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
}
.tempo-detalhe { font-size: 13px; color: var(--texto-2); }
.tempo-cancelado .tempo-quando { color: var(--texto-3); text-decoration: line-through; }

/* =====================================================================
   EQUIPE
   ===================================================================== */

.equipe-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--linha);
}
.equipe-dados { flex: 1; min-width: 0; }
.equipe-nome { font-size: 15px; font-weight: 500; margin-bottom: 2px; }
.equipe-email {
  font-family: var(--dado);
  font-size: 12px;
  color: var(--texto-3);
  overflow-wrap: anywhere;
}
.equipe-inativo .equipe-nome, .equipe-inativo .equipe-email { opacity: .45; }
.equipe-acao {
  font-size: 13px;
  color: var(--texto-2);
  padding: 6px 11px;
  border: 1px solid var(--linha);
  border-radius: 100px;
  flex: 0 0 auto;
}
.equipe-acao:hover { border-color: var(--linha-forte); color: var(--texto); }

.form-equipe {
  background: var(--painel);
  border: 1px solid var(--linha);
  border-radius: var(--r-md);
  padding: 16px;
  margin-bottom: 26px;
}
.form-dupla { display: flex; gap: 10px; margin-bottom: 12px; }
.form-dupla > * { flex: 1; }

/* =====================================================================
   ESTADOS
   ===================================================================== */

.vazio {
  text-align: center;
  padding: 46px 20px;
  color: var(--texto-2);
}
.vazio-titulo {
  font-family: var(--display);
  font-variation-settings: 'wdth' 112;
  font-weight: 600;
  font-size: 16px;
  color: var(--texto);
  margin-bottom: 6px;
}
.vazio p { font-size: 14px; max-width: 30ch; margin: 0 auto; }

.carregando {
  display: flex; align-items: center; gap: 10px;
  padding: 40px 0;
  color: var(--texto-3);
  font-size: 14px;
  justify-content: center;
}
.girando {
  width: 14px; height: 14px;
  border: 2px solid var(--linha-forte);
  border-top-color: var(--texto-2);
  border-radius: 50%;
  animation: girar .7s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

.rodape-atualizacao {
  text-align: center;
  font-family: var(--dado);
  font-size: 11px;
  color: var(--texto-3);
  padding: 26px 0 4px;
}

.toast {
  position: fixed;
  left: 50%; bottom: calc(22px + var(--base));
  transform: translateX(-50%);
  background: var(--papel);
  color: var(--tinta);
  font-size: 14px;
  font-weight: 500;
  padding: 11px 18px;
  border-radius: 100px;
  box-shadow: var(--sombra);
  z-index: 60;
  max-width: calc(100vw - 36px);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* telas maiores: o painel continua sendo de mão, mas centralizado */
@media (min-width: 640px) {
  .topo, .conteudo, .entrada-caixa { max-width: 620px; margin-left: auto; margin-right: auto; }
  .topo { border-left: 1px solid var(--linha); border-right: 1px solid var(--linha); }
  .recortes { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
}
