/* SIMO_Link — celular primeiro.
 * Cores e fontes do design system da SIMOV (direção "Noturno"), as mesmas do painel e do app. */

:root {
  color-scheme: dark;
  --deep: #1b2028; --bg: #222831; --surface: #393e46; --surface-2: #4a515b;
  --line: #4a515b; --line-soft: #434952;
  --text: #eeeeee; --dim: #a7afb9; --faint: #8f98a3;
  --accent: #ffd369; --accent-soft: #ffd36926; --on-accent: #222831;
  --ok: #3dd68c; --ok-soft: #3dd68c26; --bad: #ff6b6b; --bad-soft: #ff6b6b26;
  --info: #5aa9ff; --info-soft: #5aa9ff26; --gone: #9aa3ae;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --titulo: "Archivo", "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  min-height: 100vh; background: radial-gradient(700px 360px at 50% -10%, #ffd36914, transparent 70%), var(--deep);
  color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
main, .topo { width: min(520px, 100%); margin: 0 auto; padding: 0 16px; }

.topo { display: flex; align-items: center; justify-content: space-between; padding-top: 18px; padding-bottom: 14px; }
.logo { width: 108px; height: 21px; color: var(--accent); }
.selo { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-size: 12.5px; font-weight: 600; }
.selo i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulso 2s ease-in-out infinite; }
@keyframes pulso { 50% { opacity: 0.3; } }

.cabeca { margin: 4px 0 14px; }
.rotulo { font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
h1 { margin: 2px 0 0; font: 800 24px/1.2 var(--titulo); letter-spacing: -0.01em; }
h2 { margin: 0 0 10px; font: 700 13px/1 var(--font); letter-spacing: 0.04em; text-transform: uppercase; color: var(--faint); }

.situacao { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 12px; }
.situacao.viagem { border-color: #ffd36966; background: linear-gradient(135deg, var(--accent-soft), transparent 60%), var(--surface); }
.situacao.atraso { border-color: #ff6b6b66; }
.sit-icone { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0; background: var(--surface-2); color: var(--dim); }
.situacao.viagem .sit-icone { background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.sit-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sit-txt b { font: 800 18px/1.25 var(--titulo); }
.sit-txt span { color: var(--dim); font-size: 14px; }
.sit-txt .grande { font-family: var(--mono); color: var(--accent); }

.mapa-caixa { position: relative; height: min(62vh, 460px); border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); margin-bottom: 12px; }
#mapa { position: absolute; inset: 0; }
.mapa-aviso { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--dim); font-size: 14px; background: var(--surface); }
.atualizado { position: absolute; left: 10px; bottom: 10px; z-index: 2; padding: 4px 9px; border-radius: 8px; background: #1b2028e0; color: var(--dim); font-size: 12px; }
.atualizado.velho { color: var(--bad); }
.maplibregl-ctrl-attrib { font-size: 10px; }

.van { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); border: 3px solid #1b2028; box-shadow: 0 0 0 7px #ffd36940, 0 6px 16px #0008; }
.parada-mk { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid #1b2028; box-shadow: 0 1px 4px #0007; }
.parada-mk.ponta { border-radius: 4px; background: #1b2028; border-color: #fff; }

.cartao { padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 12px; }
.paradas { list-style: none; margin: 0; padding: 0; }
.paradas li { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 0 9px 26px; }
.paradas li::before { content: ""; position: absolute; left: 7px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.paradas li:first-child::before { top: 50%; }
.paradas li:last-child::before { bottom: 50%; }
.paradas li.passed::before { background: var(--ok); }
.paradas li > i { position: absolute; left: 1px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--surface-2); }
.paradas li.passed > i { background: var(--ok); border-color: var(--ok); }
.paradas li.next > i { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.paradas .nome { flex: 1; min-width: 0; }
.paradas li.passed .nome { color: var(--dim); }
.paradas li.next .nome { font-weight: 700; }
.paradas .eta { font-family: var(--mono); font-size: 13.5px; text-align: right; white-space: nowrap; }
.paradas .eta small { display: block; font-family: var(--font); font-size: 11.5px; color: var(--faint); }
.paradas li.next .eta { color: var(--accent); }
.paradas .eta.atraso { color: var(--bad); }

.saidas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.saidas li { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.saidas li + li { border-top: 1px solid var(--line-soft); }
.saidas .h { font-family: var(--mono); font-weight: 700; font-size: 15px; min-width: 52px; }
.saidas .r { flex: 1; color: var(--dim); font-size: 13.5px; }
.saidas .falta { font-size: 12.5px; color: var(--faint); white-space: nowrap; }
.saidas li:first-child .h { color: var(--accent); }

.acoes { display: flex; justify-content: center; margin: 6px 0 14px; }
.botao { display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 12px; border: 1px solid var(--surface-2); background: var(--surface); color: var(--text); font: 600 14px var(--font); cursor: pointer; }
.botao:active { transform: translateY(1px); }
.rodape { color: var(--faint); font-size: 12.5px; text-align: center; margin: 0 0 28px; line-height: 1.55; }

.erro { text-align: center; padding-top: 18vh; }
.erro p { color: var(--dim); }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 11px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--surface-2); box-shadow: 0 10px 30px #0009; font-size: 14px; z-index: 10; }

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

/* minha parada, aviso e opinião */
.dica { margin: -4px 0 8px; color: var(--faint); font-size: 13px; }
.paradas li { cursor: pointer; border-radius: 10px; }
.paradas li:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.paradas li.minha .nome { font-weight: 700; color: var(--text); }
.paradas li.minha > i { border-color: var(--accent); }
.tag-minha { font-style: normal; font-size: 11px; font-weight: 700; color: var(--on-accent); background: var(--accent); padding: 1px 7px; border-radius: 999px; margin-left: 4px; vertical-align: 1px; white-space: nowrap; }
.botao-aviso { width: 100%; justify-content: center; margin-top: 10px; }
.botao-aviso.ligado { border-color: #3dd68c80; color: var(--ok); background: var(--ok-soft); }
#dica-aviso { margin: 8px 0 0; text-align: center; }
.opiniao p { margin: 0 0 10px; }
.op-botoes { display: flex; gap: 10px; }
.op-botoes .botao { flex: 1; justify-content: center; }
.opiniao label { display: block; margin-bottom: 6px; font-size: 14px; }
.opiniao label small { color: var(--faint); }
.opiniao textarea { width: 100%; resize: vertical; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--surface-2); background: var(--bg); color: var(--text); font: 15px/1.4 var(--font); margin-bottom: 10px; }
.botao-primario { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
#op-obrigado { color: var(--ok); margin: 0; }

/* controles do mapa */
.mapa-ctrl { position: absolute; right: 10px; top: 10px; z-index: 3; display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; background: #1b2028e8; border: 1px solid var(--surface-2); box-shadow: 0 4px 14px #0006; }
.mapa-ctrl button { width: 42px; height: 42px; display: grid; place-items: center; border: 0; background: transparent; color: var(--text); font: 600 22px/1 var(--font); cursor: pointer; }
.mapa-ctrl button + button { border-top: 1px solid var(--surface-2); }
.mapa-ctrl button:active, .mapa-estilo button:active { background: var(--surface-2); }
.mapa-estilo { position: absolute; left: 10px; top: 10px; z-index: 3; display: flex; padding: 3px; gap: 2px; border-radius: 12px; background: #1b2028e8; border: 1px solid var(--surface-2); box-shadow: 0 4px 14px #0006; }
.mapa-estilo button { border: 0; background: transparent; color: var(--dim); font: 600 13px var(--font); padding: 7px 11px; border-radius: 9px; cursor: pointer; }
.mapa-estilo button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.ir-van { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 3; display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 999px; border: 0; background: var(--accent); color: var(--on-accent); font: 700 14.5px var(--font); box-shadow: 0 6px 18px #0008; cursor: pointer; white-space: nowrap; }
.ir-van:disabled { background: #1b2028e8; color: var(--dim); border: 1px solid var(--surface-2); box-shadow: 0 4px 14px #0006; cursor: default; font-weight: 600; font-size: 13px; }
.ir-van.seguindo { background: var(--ok); }
.atualizado { bottom: 64px; }
.mapa-caixa .maplibregl-ctrl-bottom-right { bottom: 0; }
.mapa-ctrl #tela-cheia[aria-pressed="true"] { color: var(--accent, #ffd369); }
/* Tela cheia: o mapa por cima de tudo, com a mesma barra de controles. */
.mapa-caixa.cheia { position: fixed; inset: 0; z-index: 50; height: auto; border-radius: 0; border: 0; margin: 0; }
body.mapa-cheio { overflow: hidden; }
.van { cursor: pointer; }
