/* ==========================================================================
   Vou de Van — sistema visual
   Paleta tirada do logótipo: petróleo #0F3D4C + cinzento #D9D9D9,
   com âmbar de sinalização rodoviária como cor de acção.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Manrope:wght@400;500;600;700&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  --petroleo: #0F3D4C;
  --petroleo-800: #0B2E3A;
  --petroleo-900: #06212B;
  --petroleo-100: #E3ECEF;
  --sinal: #FFC53D;
  --sinal-forte: #E9A50E;
  --nevoa: #EDF1F2;
  --papel: #FFFFFF;
  --tinta: #0E232B;
  --tinta-fraca: #64787F;
  --tinta-tenue: #90A2A8;
  --linha: #DEE7E9;
  --verde: #17835B;
  --verde-fundo: #E4F4EC;
  --vermelho: #C13B3B;
  --vermelho-fundo: #FBE9E9;
  --ambar-fundo: #FFF4DA;

  --r-p: 10px;
  --r-m: 16px;
  --r-g: 22px;
  --sombra: 0 1px 2px rgba(11, 46, 58, .05), 0 8px 24px -12px rgba(11, 46, 58, .18);
  --sombra-alta: 0 24px 48px -24px rgba(6, 33, 43, .45);
  --barra: 68px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  background: var(--petroleo-900);
  color: var(--tinta);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
  overscroll-behavior-y: none;
}

h1, h2, h3, h4 {
  font-family: 'Bricolage Grotesque', 'Manrope', sans-serif;
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 0;
  line-height: 1.15;
}

a { color: inherit; text-decoration: none; }

button, input, select, textarea { font: inherit; color: inherit; }

.icone { width: 20px; height: 20px; flex: none; }
.icone.pequeno { width: 16px; height: 16px; }
.icone.grande { width: 26px; height: 26px; }

.mono { font-family: 'JetBrains Mono', monospace; letter-spacing: -.02em; }

/* ---------------------------------------------------------------- estrutura */

.app {
  max-width: 560px;
  margin: 0 auto;
  background: var(--nevoa);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 80px rgba(0, 0, 0, .35);
}

.conteudo {
  flex: 1;
  padding: 18px 18px calc(var(--barra) + 28px);
}

.conteudo.sem-barra { padding-bottom: 32px; }

/* --------------------------------------------------------------- barra topo */

.barra-topo {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--petroleo);
  color: #fff;
  padding: 14px 16px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 0 0 24px 24px;
}

.barra-topo .marca {
  width: 38px; height: 38px;
  background: #fff;
  border-radius: 12px;
  display: grid; place-items: center;
  flex: none;
  overflow: hidden;
}
.barra-topo .marca img { width: 26px; height: auto; display: block; }

.barra-topo .titulo { flex: 1; min-width: 0; }
.barra-topo .titulo span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: rgba(255, 255, 255, .55);
  font-weight: 600;
}
.barra-topo .titulo h1 { font-size: 19px; color: #fff; }

.acao-topo {
  width: 40px; height: 40px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .07);
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
  position: relative;
  transition: background .15s;
}
.acao-topo:hover { background: rgba(255, 255, 255, .16); }
.acao-topo .ponto {
  position: absolute; top: 7px; right: 8px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--sinal);
  border: 2px solid var(--petroleo);
}

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

.barra-abas {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 560px;
  height: var(--barra);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--linha);
  display: flex;
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom);
}

.barra-abas a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--tinta-tenue);
  font-size: 10.5px;
  font-weight: 600;
  position: relative;
  transition: color .15s;
}
.barra-abas a.activa { color: var(--petroleo); }
.barra-abas a.activa::before {
  content: '';
  position: absolute;
  top: 0;
  width: 26px; height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--sinal);
}
.barra-abas a .selo {
  position: absolute;
  top: 8px;
  margin-left: 20px;
  background: var(--vermelho);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  display: grid; place-items: center;
  padding: 0 4px;
}

/* -------------------------------------------------------------------- cartão */

.cartao {
  background: var(--papel);
  border-radius: var(--r-g);
  border: 1px solid var(--linha);
  box-shadow: var(--sombra);
  padding: 18px;
  margin-bottom: 14px;
}
.cartao.compacto { padding: 14px; }
.cartao.escuro {
  background: var(--petroleo);
  border-color: var(--petroleo-800);
  color: #fff;
}
.cartao.escuro .rotulo, .cartao.escuro .sub { color: rgba(255, 255, 255, .6); }

.cabecalho-seccao {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 26px 2px 12px;
}
.cabecalho-seccao:first-child { margin-top: 6px; }
.cabecalho-seccao h2 { font-size: 16px; }
.cabecalho-seccao a { font-size: 12.5px; font-weight: 700; color: var(--petroleo); }

.rotulo {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 700;
  color: var(--tinta-tenue);
}
.sub { font-size: 13px; color: var(--tinta-fraca); }
.mini { font-size: 12px; color: var(--tinta-fraca); }

/* ------------------------------------------- bilhete (elemento de assinatura) */

.bilhete {
  background: var(--papel);
  border-radius: var(--r-g);
  box-shadow: var(--sombra);
  border: 1px solid var(--linha);
  overflow: hidden;
  margin-bottom: 16px;
  position: relative;
}

.bilhete .faixa {
  background: var(--petroleo);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}
.bilhete .faixa::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 5px;
  background: repeating-linear-gradient(115deg,
      var(--sinal) 0 12px, var(--petroleo-800) 12px 24px);
}
.bilhete .faixa h3 { font-size: 15px; color: #fff; flex: 1; }

.bilhete .corpo { padding: 18px; }

.bilhete .picotado {
  position: relative;
  height: 1px;
  margin: 16px -18px;
  background: repeating-linear-gradient(90deg, var(--linha) 0 6px, transparent 6px 12px);
}
.bilhete .picotado::before,
.bilhete .picotado::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--nevoa);
  border: 1px solid var(--linha);
  transform: translateY(-50%);
}
.bilhete .picotado::before { left: -10px; border-left-color: transparent; }
.bilhete .picotado::after { right: -10px; border-right-color: transparent; }

/* ------------------------------------------------------------------- botões */

.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 18px;
  border-radius: 15px;
  border: 1px solid transparent;
  background: var(--petroleo);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform .08s, filter .15s, background .15s;
  text-align: center;
}
.botao:hover { filter: brightness(1.08); }
.botao:active { transform: scale(.985); }
.botao.largo { width: 100%; }
.botao.sinal { background: var(--sinal); color: var(--petroleo-900); }
.botao.claro { background: var(--papel); color: var(--petroleo); border-color: var(--linha); }
.botao.contorno { background: transparent; color: var(--petroleo); border-color: var(--petroleo); }
.botao.perigo { background: var(--vermelho-fundo); color: var(--vermelho); border-color: #F3D2D2; }
.botao.verde { background: var(--verde); }
.botao.pequeno { padding: 9px 13px; font-size: 12.5px; border-radius: 12px; }
.botao:disabled { opacity: .45; cursor: not-allowed; }

.botoes { display: flex; gap: 10px; }
.botoes > * { flex: 1; }

/* ------------------------------------------------------------------ formulário */

.campo { margin-bottom: 14px; }
.campo > label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--tinta-fraca);
  margin-bottom: 7px;
}
.campo input, .campo select, .campo textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--linha);
  border-radius: 14px;
  background: var(--papel);
  transition: border-color .15s, box-shadow .15s;
  font-size: 15px;
}
.campo textarea { min-height: 92px; resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus {
  outline: none;
  border-color: var(--petroleo);
  box-shadow: 0 0 0 4px var(--petroleo-100);
}
.campo .dica { font-size: 12px; color: var(--tinta-tenue); margin-top: 6px; }
.campo-icone { position: relative; }
.campo-icone .icone {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--tinta-tenue);
}
.campo-icone input { padding-left: 44px; }
.campo-icone .ver {
  position: absolute; right: 6px; top: 50%;
  transform: translateY(-50%);
  background: none; border: 0; padding: 8px;
  color: var(--tinta-tenue); cursor: pointer;
}

.dupla { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* segmentado */
.seg {
  display: flex;
  background: var(--petroleo-100);
  border-radius: 15px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 18px;
}
.seg label { flex: 1; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 4px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--petroleo);
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
}
.seg input:checked + span {
  background: var(--papel);
  box-shadow: 0 2px 6px rgba(11, 46, 58, .12);
}

/* ------------------------------------------------------------------- avatares */

.avatar {
  width: 42px; height: 42px;
  border-radius: 14px;
  display: grid; place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  flex: none;
  overflow: hidden;
  background: var(--petroleo);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.pequeno { width: 34px; height: 34px; border-radius: 11px; font-size: 12px; }
.avatar.grande { width: 64px; height: 64px; border-radius: 20px; font-size: 20px; }

/* ------------------------------------------------------------------ etiquetas */

.etiqueta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--nevoa);
  color: var(--tinta-fraca);
  white-space: nowrap;
}
.etiqueta.ok { background: var(--verde-fundo); color: var(--verde); }
.etiqueta.erro { background: var(--vermelho-fundo); color: var(--vermelho); }
.etiqueta.espera { background: var(--ambar-fundo); color: #92660A; }
.etiqueta.destaque { background: var(--petroleo); color: #fff; }
.etiqueta.neutro { background: var(--nevoa); color: var(--tinta-fraca); }

.estrelas { display: inline-flex; gap: 1px; color: #D6DDE0; }
.estrelas i { display: block; }
.estrelas .icone { width: 13px; height: 13px; }
.estrelas i.cheia { color: var(--sinal-forte); }
.estrelas i.cheia .icone { fill: var(--sinal); }

/* ---------------------------------------------------------------------- lista */

.lista { display: flex; flex-direction: column; gap: 10px; }

.item {
  background: var(--papel);
  border: 1px solid var(--linha);
  border-radius: 18px;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--sombra);
  transition: transform .1s, border-color .15s;
}
a.item:hover { border-color: var(--petroleo); transform: translateY(-1px); }
.item .texto { flex: 1; min-width: 0; }
.item .texto strong { display: block; font-size: 14px; font-weight: 700; }
.item .texto small { display: block; color: var(--tinta-fraca); font-size: 12.5px; }
.item .fim { text-align: right; flex: none; }

/* --------------------------------------------------------------- estatísticas */

.estatisticas { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.estatisticas.tres { grid-template-columns: repeat(3, 1fr); }
.estat {
  background: var(--papel);
  border: 1px solid var(--linha);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--sombra);
}
.estat .n { font-family: 'Bricolage Grotesque', sans-serif; font-size: 24px; font-weight: 700; letter-spacing: -.03em; }
.estat .r { font-size: 11.5px; color: var(--tinta-fraca); font-weight: 600; margin-top: 2px; }
.estat .icone { color: var(--tinta-tenue); margin-bottom: 8px; }

/* ----------------------------------------------------------------------- mapa */

.mapa {
  height: 300px;
  border-radius: var(--r-g);
  overflow: hidden;
  border: 1px solid var(--linha);
  box-shadow: var(--sombra);
  margin-bottom: 14px;
  background: var(--petroleo-100);
}
.mapa.alto { height: 400px; }
.leaflet-container { font-family: 'Manrope', sans-serif; }
.marcador-van {
  background: var(--petroleo);
  border: 3px solid #fff;
  border-radius: 14px;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  color: var(--sinal);
  box-shadow: 0 6px 16px rgba(6, 33, 43, .4);
}
.marcador-van.pulsa { animation: pulsar 2s infinite; }
@keyframes pulsar {
  0% { box-shadow: 0 0 0 0 rgba(255, 197, 61, .55); }
  70% { box-shadow: 0 0 0 16px rgba(255, 197, 61, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 197, 61, 0); }
}
.marcador-ponto {
  width: 16px; height: 16px; border-radius: 50%;
  border: 3px solid #fff; background: var(--sinal-forte);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}
.marcador-ponto.escola { background: var(--verde); }

/* ------------------------------------------------------------------- percurso */

.percurso { position: relative; padding-left: 26px; }
.percurso::before {
  content: '';
  position: absolute;
  left: 7px; top: 10px; bottom: 10px;
  width: 2px;
  background: repeating-linear-gradient(180deg, var(--linha) 0 5px, transparent 5px 10px);
}
.paragem { position: relative; padding: 9px 0; display: flex; gap: 10px; align-items: center; }
.paragem::before {
  content: '';
  position: absolute;
  left: -26px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--papel);
  border: 3px solid var(--linha);
}
.paragem.feita::before { background: var(--verde); border-color: var(--verde-fundo); }
.paragem.actual::before { background: var(--sinal); border-color: var(--ambar-fundo); }

/* --------------------------------------------------------------------- avisos */

.aviso {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 13px 15px;
  border-radius: 16px;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 14px;
  border: 1px solid;
}
.aviso.sucesso { background: var(--verde-fundo); color: #0F6446; border-color: #C6E7D8; }
.aviso.erro { background: var(--vermelho-fundo); color: #9C2C2C; border-color: #F2CFCF; }
.aviso.info { background: var(--petroleo-100); color: var(--petroleo); border-color: #CFDEE3; }
.aviso.atencao { background: var(--ambar-fundo); color: #8A6008; border-color: #F5E0AE; }

/* ---------------------------------------------------------------------- vazio */

.vazio {
  text-align: center;
  padding: 36px 22px;
  background: var(--papel);
  border: 1px dashed var(--linha);
  border-radius: var(--r-g);
}
.vazio .icone { width: 34px; height: 34px; color: var(--tinta-tenue); margin-bottom: 10px; }
.vazio h3 { font-size: 15px; margin-bottom: 6px; }
.vazio p { font-size: 13px; color: var(--tinta-fraca); margin: 0 0 14px; }

/* ---------------------------------------------------------------- conversa */

.conversa { display: flex; flex-direction: column; gap: 8px; padding: 4px 0 12px; }
.balao {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  box-shadow: var(--sombra);
}
.balao .hora { display: block; font-size: 10px; opacity: .6; margin-top: 4px; text-align: right; }
.balao.meu { align-self: flex-end; background: var(--petroleo); color: #fff; border-bottom-right-radius: 6px; }
.balao.dele { align-self: flex-start; background: var(--papel); border: 1px solid var(--linha); border-bottom-left-radius: 6px; }

.barra-envio {
  position: sticky;
  bottom: calc(var(--barra) + 8px);
  display: flex;
  gap: 8px;
  background: var(--nevoa);
  padding-top: 8px;
}
.barra-envio input {
  flex: 1;
  padding: 13px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--linha);
  background: var(--papel);
}
.barra-envio button {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 0;
  background: var(--petroleo);
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
}

/* ------------------------------------------------------------------- entrada */

.entrada {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(120% 60% at 50% 0%, #14495A 0%, var(--petroleo-900) 70%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 34px 20px 40px;
  position: relative;
  overflow: hidden;
}
.entrada::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 8px;
  background: repeating-linear-gradient(115deg, var(--sinal) 0 16px, var(--petroleo-900) 16px 32px);
}
.entrada .caixa { width: 100%; max-width: 420px; }
.entrada .logo {
  width: 74px; height: 74px;
  background: #fff;
  border-radius: 24px;
  display: grid; place-items: center;
  margin: 0 auto 18px;
  box-shadow: var(--sombra-alta);
}
.entrada .logo img { width: 46px; }
.entrada h1 { color: #fff; font-size: 28px; text-align: center; }
.entrada .lema {
  color: rgba(255, 255, 255, .6);
  text-align: center;
  font-size: 13.5px;
  margin: 8px 0 26px;
}
.painel {
  background: var(--papel);
  border-radius: 26px;
  padding: 22px;
  box-shadow: var(--sombra-alta);
}
.entrada .rodape { text-align: center; color: rgba(255, 255, 255, .55); font-size: 13px; margin-top: 22px; }
.entrada .rodape a { color: var(--sinal); font-weight: 700; }

/* contas de demonstração */
.demos { margin-top: 20px; }
.demos > .rotulo { color: rgba(255, 255, 255, .5); display: block; margin-bottom: 10px; text-align: center; }
.demo {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  margin-bottom: 8px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .06);
  color: #fff;
  cursor: pointer;
  text-align: left;
  transition: background .15s, border-color .15s;
}
.demo:hover { background: rgba(255, 255, 255, .13); border-color: var(--sinal); }
.demo .icone { color: var(--sinal); }
.demo b { display: block; font-size: 13.5px; }
.demo small { display: block; font-size: 11.5px; color: rgba(255, 255, 255, .55); }
.demo .mono { font-size: 11px; color: rgba(255, 255, 255, .75); }

/* --------------------------------------------------------------------- folha */

.folha-fundo {
  position: fixed;
  inset: 0;
  background: rgba(6, 33, 43, .5);
  backdrop-filter: blur(3px);
  z-index: 80;
  display: none;
}
.folha-fundo.aberta { display: block; }
.folha {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%; max-width: 560px;
  background: var(--papel);
  border-radius: 28px 28px 0 0;
  padding: 10px 18px calc(24px + env(safe-area-inset-bottom));
  z-index: 90;
  max-height: 88vh;
  overflow-y: auto;
  transition: transform .28s cubic-bezier(.32, .72, 0, 1);
}
.folha.aberta { transform: translateX(-50%) translateY(0); }
.folha .puxador {
  width: 42px; height: 4px;
  background: var(--linha);
  border-radius: 3px;
  margin: 4px auto 16px;
}
.folha h2 { font-size: 18px; margin-bottom: 4px; }

/* ------------------------------------------------------------------ animação */

.entra { animation: entra .32s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes entra { from { opacity: 0; transform: translateY(8px); } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

:focus-visible { outline: 3px solid var(--sinal); outline-offset: 2px; border-radius: 6px; }

/* -------------------------------------------------------------------- ecrã largo */

@media (min-width: 900px) {
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
      radial-gradient(80% 50% at 20% 0%, #14495A 0%, transparent 60%),
      repeating-linear-gradient(115deg, rgba(255, 197, 61, .05) 0 30px, transparent 30px 60px);
    pointer-events: none;
  }
  .app { border-radius: 0; }
}
