/* ============================================================
   AERO ROTA - Estilos Principais
   assets/css/style.css
   ============================================================ */

/* config_fonte: 'B612' | 'Inter' | 'Roboto' | 'Exo 2' | 'Arial' | 'Helvetica' */
@import url('https://fonts.googleapis.com/css2?family=B612:wght@400;700&family=Orbitron:wght@400;600;700;900&family=Exo+2:wght@300;400;500;600&family=Inter:wght@300;400;500;600&family=Roboto:wght@300;400;500;700&display=swap');

/* ── Variáveis ── */
:root {
  --config-fonte: 'B612', sans-serif;
  --azul-escuro: #0a0e1a;
  --azul-painel: #0d1b2a;
  --azul-borda: #1e3a5f;
  --azul-medio: #0d47a1;
  --azul-claro: #1565c0;
  --azul-acento: #42a5f5;
  --azul-glow: #1976d2;
  --texto-prim: #e3f2fd;
  --texto-sec: #90caf9;
  --texto-mut: #546e7a;
  --verde: #00e676;
  --vermelho: #ef5350;
  --amarelo: #ffd740;
  --branco: #ffffff;
  --sidebar-w: 360px;
  --topbar-h: 60px;
  --radius: 12px;
  --sombra: 0 8px 32px rgba(0, 0, 0, .5);
  --trans: .2s ease;
}

/* ── Reset & Base ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  background: var(--azul-escuro);
  color: var(--texto-prim);
  font-family: var(--config-fonte);
  font-size: 14px;
  overflow: hidden;
}

/* ── Scrollbar personalizada ── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--azul-painel);
}

::-webkit-scrollbar-thumb {
  background: var(--azul-borda);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--azul-acento);
}

/* ══════════════════════════════════════════
   TOPBAR
   ══════════════════════════════════════════ */
#topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  background: linear-gradient(90deg, #060b18 0%, #0a1628 60%, #060b18 100%);
  border-bottom: 1px solid var(--azul-borda);
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 1100;
  gap: 16px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, .6);
}

#topbar .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

#topbar .logo-img {
  height: 42px;
  width: auto;
  display: block;
  object-fit: contain;
}

#topbar .logo-icon {
  font-size: 24px;
  filter: drop-shadow(0 0 8px var(--azul-acento));
}

#topbar .logo-text {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--texto-prim);
  letter-spacing: 3px;
  text-shadow: 0 0 20px var(--azul-acento);
}

#topbar .logo-sub {
  font-size: 9px;
  color: var(--azul-acento);
  letter-spacing: 1px;
  font-family: 'Orbitron', sans-serif;
  margin-top: -4px;
}

#topbar .nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 50px;
  font-family: var(--config-fonte);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--trans);
  text-decoration: none;
  border: none;
  letter-spacing: .5px;
}

.btn-nav-ghost {
  background: transparent;
  color: var(--texto-sec);
  border: 1px solid var(--azul-borda);
}

.btn-nav-ghost:hover {
  background: rgba(255, 255, 255, .06);
  border-color: var(--azul-acento);
  color: var(--texto-prim);
}

.btn-nav-primary {
  background: linear-gradient(135deg, var(--azul-medio), var(--azul-claro));
  color: #fff;
  box-shadow: 0 4px 14px rgba(21, 101, 192, .4);
}

.btn-nav-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(21, 101, 192, .6);
  color: #fff;
}

.btn-nav-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--azul-borda);
  color: var(--texto-sec);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: var(--trans);
  text-decoration: none;
  flex-shrink: 0;
}

.btn-nav-close:hover {
  background: rgba(239, 83, 80, .15);
  border-color: var(--vermelho, #ef5350);
  color: var(--vermelho, #ef5350);
}

/* ══ AERÓDROMO MODAL ══ */
.modal-aerodromo-box {
  max-width: 620px !important;
  width: 96%;
}

.ma-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
  margin-bottom: 4px;
}

.ma-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ma-field.ma-full {
  grid-column: 1 / -1;
}

.ma-field>label:not(.form-label) {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--texto-mut);
  font-family: 'Orbitron', sans-serif;
}

.ma-field>span {
  font-size: 13px;
  color: var(--texto-sec);
  word-break: break-word;
}

.ma-link {
  color: var(--azul-acento);
  text-decoration: none;
  font-size: 13px;
}

.ma-link:hover {
  text-decoration: underline;
}

.ma-divider {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--azul-acento);
  font-family: 'Orbitron', sans-serif;
  padding: 14px 0 10px;
  border-top: 1px solid var(--azul-borda);
  margin-top: 12px;
}

.ma-update-info {
  font-size: 11px;
  color: var(--texto-mut);
  text-align: center;
  padding: 7px 12px;
  background: rgba(255, 255, 255, .02);
  border: 1px solid var(--azul-borda);
  border-radius: 8px;
  margin: 12px 0 4px;
}

.ma-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.ma-actions .btn-primary {
  flex: 1;
}

/* Botão aeródromo na sidebar */
.ponto-aero-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(66, 165, 245, .1);
  border: 1px solid rgba(66, 165, 245, .25);
  color: var(--azul-acento);
  cursor: pointer;
  transition: var(--trans);
  margin-left: 5px;
  vertical-align: middle;
  line-height: 1.6;
}

.ponto-aero-btn:hover {
  background: rgba(66, 165, 245, .22);
  border-color: var(--azul-acento);
}

/* Resultado de busca — aeródromo */
.result-aerodromo {
  border-left: 2px solid var(--azul-acento);
}

.usuario-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(21, 101, 192, .15);
  border: 1px solid var(--azul-borda);
  border-radius: 50px;
  color: var(--texto-sec);
  font-size: 13px;
}

.usuario-badge .ub-avatar {
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, var(--azul-medio), var(--azul-acento));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

/* ══════════════════════════════════════════
   LAYOUT PRINCIPAL (subpáginas)
   ══════════════════════════════════════════ */
#main-layout {
  display: flex;
  height: 100vh;
  padding-top: var(--topbar-h);
}

/* ── Mapa: ocupa 100% da tela ── */
#map-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
}

#map {
  width: 100%;
  height: 100%;
}

/* ── Busca flutuante — desktop: canto superior esquerdo abaixo do topbar ── */
#busca-container {
  position: fixed;
  top: calc(var(--topbar-h) + 8px);
  left: 8px;
  width: 360px;
  z-index: 1000;
  background: var(--azul-painel);
  border: 1px solid var(--azul-borda);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .5);
}

/* Resultados abaixo da caixa de busca */
#search-results {
  position: fixed;
  top: calc(var(--topbar-h) + 8px + 54px);
  left: 8px;
  width: 360px;
  max-height: 280px;
  overflow-y: auto;
  background: var(--azul-escuro);
  border: 1px solid var(--azul-borda);
  border-radius: 0 0 12px 12px;
  z-index: 1000;
  display: none;
}

#search-results.active {
  display: block;
}

/* ── Painel de rota flutuante — desktop: abaixo da busca ── */
.sidebar-body {
  position: fixed;
  top: calc(var(--topbar-h) + 8px + 54px);
  left: 8px;
  width: 360px;
  /* 90px = 30px(bottom controls offset) + 36px(control height) + 24px(margem) */
  max-height: calc(100vh - var(--topbar-h) - 54px - 90px);
  overflow-y: auto;
  background: var(--azul-painel);
  border: 1px solid var(--azul-borda);
  border-radius: 12px;
  z-index: 900;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .55);
}

/* ══════════════════════════════════════════
   SIDEBAR - BUSCA
   ══════════════════════════════════════════ */
.sidebar-search {
  padding: 16px;
  border-bottom: 1px solid var(--azul-borda);
}

.search-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--azul-acento);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.search-wrapper {
  position: relative;
}

.search-wrapper input {
  width: 100%;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--azul-borda);
  border-radius: var(--radius);
  padding: 11px 40px 11px 14px;
  color: var(--texto-prim);
  caret-color: var(--texto-prim);
  color-scheme: dark;
  font-family: var(--config-fonte);
  font-size: 14px;
  transition: var(--trans);
  outline: none;
}

.search-wrapper input::placeholder {
  color: var(--texto-mut);
}

.search-wrapper input:focus {
  border-color: var(--azul-acento);
  background: rgba(66, 165, 245, .06);
  box-shadow: 0 0 0 3px rgba(66, 165, 245, .1);
}

.search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--texto-mut);
  font-size: 16px;
  pointer-events: none;
  transition: var(--trans);
}

.search-wrapper input:focus~.search-icon {
  color: var(--azul-acento);
}

/* ── Lista de resultados ── */
#search-results {
  margin-top: 8px;
  max-height: 220px;
  overflow-y: auto;
  background: var(--azul-escuro);
  border: 1px solid var(--azul-borda);
  border-radius: var(--radius);
  display: none;
}

#search-results.active {
  display: block;
}

.result-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  cursor: pointer;
  transition: var(--trans);
  border-bottom: 1px solid rgba(30, 58, 95, .5);
}

.result-item:last-child {
  border-bottom: none;
}

.result-item:hover {
  background: rgba(66, 165, 245, .1);
  border-left: 3px solid var(--azul-acento);
}

.result-icon {
  width: 28px;
  height: 28px;
  background: rgba(21, 101, 192, .3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
  margin-top: 1px;
}

.result-nome {
  font-weight: 600;
  color: var(--texto-prim);
  font-size: 13px;
  line-height: 1.3;
}

.result-end {
  color: var(--texto-mut);
  font-size: 11px;
  margin-top: 2px;
  line-height: 1.4;
}

/* ══════════════════════════════════════════
   SIDEBAR - PAINEL DE ROTA
   ══════════════════════════════════════════ */

/* Container scrollável que envolve rota-panel + sem-pontos + footer */
.sidebar-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.sidebar-rota {
  padding: 14px 16px;
}

.rota-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.rota-titulo {
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--azul-acento);
  text-transform: uppercase;
}

.btn-limpar {
  background: rgba(239, 83, 80, .1);
  border: 1px solid rgba(239, 83, 80, .3);
  color: var(--vermelho);
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 11px;
  cursor: pointer;
  transition: var(--trans);
  font-family: var(--config-fonte);
}

.btn-limpar:hover {
  background: rgba(239, 83, 80, .2);
}

/* ── Pontos da rota ── */
.pontos-lista {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ponto-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  position: relative;
  padding-bottom: 4px;
}

.ponto-linha {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.ponto-circulo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--azul-acento);
  background: var(--azul-escuro);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--azul-acento);
  font-family: 'Orbitron', sans-serif;
  flex-shrink: 0;
  z-index: 1;
}

.ponto-circulo.partida {
  border-color: var(--verde);
  color: var(--verde);
}

.ponto-circulo.destino {
  border-color: var(--amarelo);
  color: var(--amarelo);
  background: rgba(255, 215, 64, .1);
}

.ponto-conector {
  width: 2px;
  flex: 1;
  min-height: 30px;
  background: linear-gradient(180deg, var(--azul-acento) 0%, rgba(66, 165, 245, .2) 100%);
  margin: 2px auto;
  border-left: 2px dashed rgba(66, 165, 245, .4);
}

.ponto-info {
  flex: 1;
  padding: 4px 0 16px;
}

.ponto-nome {
  font-weight: 600;
  font-size: 13px;
  color: var(--texto-prim);
  line-height: 1.3;
}

.ponto-end {
  font-size: 11px;
  color: var(--texto-mut);
  margin-top: 2px;
}

.ponto-dist {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 4px 10px;
  background: rgba(66, 165, 245, .07);
  border: 1px solid rgba(66, 165, 245, .15);
  border-radius: 20px;
  width: fit-content;
}

.ponto-dist .dist-val {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  color: var(--azul-acento);
  font-weight: 600;
}

.ponto-dist .tempo-val {
  font-size: 11px;
  color: var(--verde);
  font-weight: 500;
}

.ponto-dist .proa-val {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  color: #ffb74d;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* ── Totais ── */
.rota-totais {
  margin-top: 12px;
  padding: 14px;
  background: rgba(21, 101, 192, .1);
  border: 1px solid rgba(21, 101, 192, .3);
  border-radius: var(--radius);
}

.totais-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.totais-row:last-child {
  margin-bottom: 0;
}

.totais-label {
  font-size: 11px;
  color: var(--texto-mut);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.totais-val {
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  color: var(--texto-prim);
  font-weight: 700;
}

.totais-val.destaque {
  color: var(--azul-acento);
}

/* ── Velocidade ── */
.vel-info {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--texto-mut);
}

.vel-badge {
  background: rgba(66, 165, 245, .1);
  border: 1px solid rgba(66, 165, 245, .2);
  color: var(--azul-acento);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 600;
}

/* ── Sidebar Footer ── */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--azul-borda);
}

.btn-salvar-rota {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #1b5e20, #2e7d32);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--trans);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-salvar-rota:hover {
  background: linear-gradient(135deg, #2e7d32, #388e3c);
  box-shadow: 0 4px 20px rgba(0, 230, 118, .2);
  transform: translateY(-1px);
}

/* ══════════════════════════════════════════
   POPUP DO MAPA (Marker Info)
   ══════════════════════════════════════════ */
.marker-popup {
  background: var(--azul-painel) !important;
  border: 1px solid var(--azul-borda) !important;
  border-radius: var(--radius) !important;
  padding: 0 !important;
  box-shadow: var(--sombra) !important;
  min-width: 220px;
  overflow: hidden;
}

.popup-header {
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--azul-borda);
}

.popup-nome {
  font-weight: 600;
  color: var(--texto-prim);
  font-size: 13px;
  line-height: 1.3;
}

.popup-end {
  font-size: 11px;
  color: var(--texto-mut);
  margin-top: 3px;
}

.popup-coords {
  font-size: 10px;
  color: var(--azul-acento);
  font-family: 'Orbitron', sans-serif;
  margin-top: 4px;
  opacity: .7;
}

.popup-actions {
  padding: 10px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.popup-btn {
  flex: 1;
  min-width: 80px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--azul-borda);
  background: rgba(255, 255, 255, .04);
  color: var(--texto-sec);
  font-size: 11px;
  font-family: var(--config-fonte);
  font-weight: 600;
  cursor: pointer;
  transition: var(--trans);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
}

.popup-btn:hover {
  background: rgba(66, 165, 245, .12);
  border-color: var(--azul-acento);
  color: var(--azul-acento);
}

.popup-btn.btn-rota,
.popup-btn.btn-partida {
  background: rgba(0, 230, 118, .15);
  border-color: rgba(0, 230, 118, .6);
  color: #00e676;
  text-shadow: 0 0 8px rgba(0, 230, 118, .5);
}

.popup-btn.btn-rota:hover,
.popup-btn.btn-partida:hover {
  background: rgba(0, 230, 118, .3);
}

.popup-btn.btn-salvar-local {
  background: rgba(0, 230, 118, .06);
  border-color: rgba(0, 230, 118, .3);
  color: var(--verde);
}

.popup-btn.btn-compartilhar {
  background: rgba(255, 215, 64, .06);
  border-color: rgba(255, 215, 64, .3);
  color: var(--amarelo);
}

.popup-btn.btn-remover-ponto {
  background: rgba(211, 47, 47, .15);
  border-color: rgba(211, 47, 47, .4);
  color: #ef5350;
}

.popup-btn.btn-remover-ponto:hover {
  background: rgba(211, 47, 47, .3);
}

/* ══════════════════════════════════════════
   OVERLAY DE LINHA (distância no mapa)
   ══════════════════════════════════════════ */
.linha-label {
  background: rgba(10, 14, 26, .85) !important;
  border: 1px solid var(--azul-borda) !important;
  color: var(--texto-prim) !important;
  padding: 4px 10px !important;
  border-radius: 20px !important;
  font-family: 'Orbitron', sans-serif !important;
  font-size: 10px !important;
  white-space: nowrap;
  pointer-events: none;
}

/* ══════════════════════════════════════════
   MODAIS
   ══════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .7);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: var(--azul-painel);
  border: 1px solid var(--azul-borda);
  border-radius: 20px;
  padding: 32px;
  width: 90%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(30px) scale(.97);
  transition: transform .25s;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
}

.modal-overlay.active .modal-box {
  transform: translateY(0) scale(1);
}

.modal-header {
  text-align: center;
  margin-bottom: 24px;
}

.modal-icon {
  font-size: 36px;
  margin-bottom: 10px;
}

.modal-titulo {
  font-family: 'Orbitron', sans-serif;
  font-size: 16px;
  color: var(--texto-prim);
  font-weight: 700;
  letter-spacing: 1px;
}

.modal-subtitulo {
  color: var(--texto-mut);
  font-size: 13px;
  margin-top: 6px;
  line-height: 1.5;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--azul-borda);
  color: var(--texto-mut);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--trans);
  line-height: 1;
}

.modal-close:hover {
  background: rgba(239, 83, 80, .15);
  border-color: var(--vermelho);
  color: var(--vermelho);
}

/* ── Formulários ── */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--texto-sec);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: .8px;
}

.form-control {
  width: 100%;
  background: rgba(255, 255, 255, .05) !important;
  border: 1px solid var(--azul-borda);
  border-radius: 10px;
  padding: 11px 14px;
  color: #e3f2fd !important;
  -webkit-text-fill-color: #e3f2fd !important;
  caret-color: #e3f2fd;
  color-scheme: dark;
  font-family: var(--config-fonte);
  font-size: 14px;
  transition: var(--trans);
  outline: none;
}

.form-control:focus {
  border-color: var(--azul-acento);
  background: rgba(66, 165, 245, .06) !important;
  box-shadow: 0 0 0 3px rgba(66, 165, 245, .1);
  color: #e3f2fd !important;
  -webkit-text-fill-color: #e3f2fd !important;
}

.form-control::placeholder {
  color: var(--texto-mut);
}

select.form-control {
  background: #0d1b2a !important;
}

select.form-control option {
  background: #0d1b2a;
  color: #e3f2fd;
}

/* ── Velocidade / radio ── */
.vel-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.vel-row .form-control {
  flex: 1;
}

.radio-group {
  display: flex;
  gap: 6px;
  align-items: center;
}

.radio-opt {
  position: relative;
}

.radio-opt input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-opt label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--azul-borda);
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: var(--texto-mut);
  transition: var(--trans);
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 1px;
  white-space: nowrap;
}

.radio-opt input:checked+label {
  background: rgba(21, 101, 192, .25);
  border-color: var(--azul-acento);
  color: var(--azul-acento);
  box-shadow: 0 0 10px rgba(66, 165, 245, .15);
}

.radio-opt label:hover {
  border-color: rgba(66, 165, 245, .5);
  color: var(--texto-sec);
}

/* ── Tipo de usuário ── */
.tipo-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tipo-opt {
  position: relative;
}

.tipo-opt input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.tipo-opt label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--azul-borda);
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--texto-mut);
  transition: var(--trans);
  text-align: center;
}

.tipo-opt label .tipo-icon {
  font-size: 24px;
}

.tipo-opt input:checked+label {
  background: rgba(21, 101, 192, .2);
  border-color: var(--azul-acento);
  color: var(--azul-acento);
}

.tipo-opt label:hover {
  border-color: rgba(66, 165, 245, .4);
  color: var(--texto-sec);
}

/* ── Botões primários ── */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--azul-medio), var(--azul-claro));
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  letter-spacing: 1.5px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--trans);
  margin-top: 8px;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--azul-claro), var(--azul-glow));
  box-shadow: 0 6px 24px rgba(21, 101, 192, .5);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  width: 100%;
  padding: 12px;
  background: transparent;
  color: var(--texto-sec);
  border: 1px solid var(--azul-borda);
  border-radius: 12px;
  font-family: var(--config-fonte);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--trans);
  margin-top: 6px;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, .06);
  border-color: var(--azul-acento);
  color: var(--texto-prim);
}

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--azul-borda);
}

.tab-btn {
  flex: 1;
  padding: 10px;
  background: none;
  border: none;
  color: var(--texto-mut);
  font-family: var(--config-fonte);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: var(--trans);
}

.tab-btn.active {
  color: var(--azul-acento);
  border-bottom-color: var(--azul-acento);
}

.tab-btn:hover:not(.active) {
  color: var(--texto-sec);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* ── Alertas ── */
.alert {
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-erro {
  background: rgba(239, 83, 80, .1);
  border: 1px solid rgba(239, 83, 80, .3);
  color: #ef9a9a;
}

.alert-ok {
  background: rgba(0, 230, 118, .08);
  border: 1px solid rgba(0, 230, 118, .25);
  color: #a5d6a7;
}

.alert-info {
  background: rgba(66, 165, 245, .08);
  border: 1px solid rgba(66, 165, 245, .2);
  color: var(--texto-sec);
}

/* ── Separador ── */
.sep {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: var(--texto-mut);
  font-size: 12px;
}

.sep::before,
.sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--azul-borda);
}

/* ══════════════════════════════════════════
   MODAL SALVAR ROTA
   ══════════════════════════════════════════ */
.resultado-calculo {
  background: rgba(0, 230, 118, .07);
  border: 1px solid rgba(0, 230, 118, .2);
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
}

.calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.calc-row:last-child {
  margin-bottom: 0;
}

.calc-label {
  font-size: 12px;
  color: var(--texto-mut);
}

.calc-val {
  font-family: 'Orbitron', sans-serif;
  font-size: 15px;
  color: var(--verde);
  font-weight: 700;
}

/* ══════════════════════════════════════════
   TOAST NOTIFICATIONS
   ══════════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--sombra);
  animation: slideIn .3s ease;
  max-width: 320px;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast-ok {
  background: linear-gradient(135deg, #1b5e20, #2e7d32);
}

.toast-err {
  background: linear-gradient(135deg, #b71c1c, #c62828);
}

.toast-info {
  background: linear-gradient(135deg, #0d47a1, #1565c0);
}

/* ══════════════════════════════════════════
   SPINNER / LOADING
   ══════════════════════════════════════════ */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, .2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ══════════════════════════════════════════
   RADAR DECORATIVO (fundo mapa)
   ══════════════════════════════════════════ */
.map-watermark {
  position: absolute;
  bottom: 20px;
  left: 20px;
  z-index: 100;
  pointer-events: none;
  opacity: .6;
}

.map-watermark span {
  font-family: 'Orbitron', sans-serif;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--azul-acento);
  text-shadow: 0 0 10px var(--azul-acento);
}

/* ══════════════════════════════════════════
   SELETOR DE TIPO DE MAPA
   ══════════════════════════════════════════ */
.map-type-control {
  position: fixed;
  bottom: calc(30px + env(safe-area-inset-bottom, 0px));
  right: 10px;
  z-index: 1000;
  display: flex;
  gap: 2px;
  background: rgba(10, 14, 26, .85);
  border: 1px solid var(--azul-borda);
  border-radius: 20px;
  padding: 3px;
  backdrop-filter: blur(6px);
}

.mtp-btn {
  padding: 4px 12px;
  border-radius: 16px;
  border: none;
  background: transparent;
  color: var(--texto-sec);
  font-size: 11px;
  font-family: var(--config-fonte);
  font-weight: 600;
  cursor: pointer;
  transition: var(--trans);
  letter-spacing: .3px;
}

.mtp-btn.active {
  background: var(--azul-acento);
  color: #fff;
}

.mtp-btn:not(.active):hover {
  background: rgba(255, 255, 255, .08);
  color: var(--texto-prim);
}

/* ══════════════════════════════════════════
   BOTÕES DE ZOOM NO MAPA
   ══════════════════════════════════════════ */
.map-zoom-control {
  position: fixed;
  bottom: calc(30px + env(safe-area-inset-bottom, 0px));
  left: 10px;
  z-index: 1000;
  display: flex;
  flex-direction: row;
  gap: 2px;
  background: rgba(10, 14, 26, .85);
  border: 1px solid var(--azul-borda);
  border-radius: 8px;
  padding: 3px;
  backdrop-filter: blur(6px);
}

.map-zoom-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--texto-prim);
  font-size: 22px;
  font-weight: 300;
  cursor: pointer;
  border-radius: 6px;
  transition: var(--trans);
  line-height: 1;
  font-family: var(--config-fonte);
}

.map-zoom-btn:hover {
  background: rgba(66, 165, 245, .18);
  color: var(--azul-acento);
}

.map-centrar-btn {
  width: auto;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

/* ══════════════════════════════════════════
   BOTÃO X LIMPAR BUSCA
   ══════════════════════════════════════════ */
.search-clear {
  display: none;
  position: absolute;
  right: 36px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .1);
  border: none;
  border-radius: 50%;
  color: var(--texto-mut);
  font-size: 11px;
  cursor: pointer;
  transition: var(--trans);
  z-index: 2;
}

.search-clear:hover {
  background: rgba(239, 83, 80, .2);
  color: var(--vermelho, #ef5350);
}

/* ══════════════════════════════════════════
   REORDENAR PONTOS DA ROTA
   ══════════════════════════════════════════ */
/* ── Botão remover ponto ── */
.ponto-del-btn {
  width: 22px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 83, 80, .08);
  border: 1px solid rgba(239, 83, 80, .25);
  border-radius: 4px;
  color: var(--vermelho);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: var(--trans);
  flex-shrink: 0;
}

.ponto-del-btn:hover {
  background: rgba(239, 83, 80, .25);
  border-color: var(--vermelho);
}

.ponto-mover {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 0 0 4px;
  flex-shrink: 0;
}

.ponto-mover-btn {
  width: 22px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--azul-borda);
  border-radius: 4px;
  color: var(--texto-mut);
  font-size: 9px;
  cursor: pointer;
  transition: var(--trans);
  line-height: 1;
}

.ponto-mover-btn:hover {
  background: rgba(66, 165, 245, .15);
  border-color: var(--azul-acento);
  color: var(--azul-acento);
}

.ponto-mover-esp {
  display: block;
  width: 22px;
  height: 20px;
}

/* ══════════════════════════════════════════
   MENU HAMBURGER / MOBILE NAV
   ══════════════════════════════════════════ */
.btn-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--azul-borda);
  border-radius: 8px;
  color: var(--texto-sec);
  font-size: 18px;
  cursor: pointer;
  transition: var(--trans);
  margin-left: auto;
  flex-shrink: 0;
}

.btn-hamburger:hover {
  background: rgba(255, 255, 255, .06);
  color: var(--texto-prim);
}

/* ══════════════════════════════════════════
   RESPONSIVO
   ══════════════════════════════════════════ */
/* ── Tablet + mobile: hamburguer e nav em coluna ── */
@media (max-width: 1024px) {

  /* Hamburger visível em mobile e tablet */
  .btn-hamburger {
    display: flex;
  }

  /* Nav-actions em coluna quando menu aberto */
  #topbar .nav-actions {
    display: none;
    flex-direction: column;
    width: 100%;
    padding: 8px 16px 14px;
    gap: 6px;
    border-top: 1px solid var(--azul-borda);
    background: var(--azul-painel);
  }

  #topbar.mobile-open .nav-actions {
    display: flex;
  }

  #topbar {
    flex-wrap: wrap;
    height: auto;
    min-height: 56px;
  }

  /* Controles do mapa: bottom maior para ficar acima da barra do browser */
  .map-type-control {
    bottom: max(72px, calc(48px + env(safe-area-inset-bottom, 0px)));
    right: 8px;
  }

  .map-zoom-control {
    bottom: max(72px, calc(48px + env(safe-area-inset-bottom, 0px)));
    left: 8px;
  }

  /* Páginas internas */
  .page-container {
    padding: 0 12px;
  }

  .rota-meta {
    flex-direction: column;
    gap: 6px;
  }

  .rota-actions {
    flex-wrap: wrap;
  }

  .local-card {
    padding: 8px 10px;
  }

  #main-layout {
    padding-top: 0;
  }
}

/* ── Mobile apenas: busca e sidebar full-width ── */
@media (max-width: 768px) {
  :root {
    --sidebar-w: 100%;
  }

  /* Busca full-width abaixo do topbar */
  #busca-container {
    top: var(--topbar-h);
    left: 0;
    width: 100%;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    box-shadow: none;
    padding: 8px 12px;
  }

  /* Resultados: full-width abaixo da busca */
  #search-results {
    top: calc(var(--topbar-h) + 54px);
    left: 0;
    width: 100%;
    border-radius: 0;
    max-height: 160px;
  }

  /* Painel de rota: full-width abaixo da busca, máx 35% da tela */
  .sidebar-body {
    top: calc(var(--topbar-h) + 54px);
    left: 0;
    width: 100%;
    max-height: 35vh;
    border-radius: 0;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar-rota {
    padding: 8px 12px;
  }
}

@media (max-width: 480px) {
  #topbar {
    padding: 0 12px;
  }

  .logo-img {
    height: 32px;
  }

  .mtp-btn {
    padding: 4px 8px;
    font-size: 10px;
  }

  .rota-card {
    padding: 14px 14px;
  }
}

/* ══════════════════════════════════════════
   LOCAIS SALVOS
   ══════════════════════════════════════════ */
.local-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--azul-borda);
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: var(--trans);
}

.local-card:hover {
  background: rgba(66, 165, 245, .08);
  border-color: var(--azul-acento);
}

.local-card-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #0d47a1, #1565c0);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.local-card-nome {
  font-size: 13px;
  font-weight: 600;
  color: var(--texto-prim);
}

.local-card-end {
  font-size: 11px;
  color: var(--texto-mut);
  margin-top: 2px;
}

/* ── Fix: garantir cor branca em inputs durante digitação (todos os tipos) ── */
input,
textarea,
select {
  color: var(--texto-prim) !important;
  caret-color: var(--texto-prim) !important;
  color-scheme: dark !important;
}

input[type="number"],
input[type="text"],
input[type="email"],
input[type="password"] {
  color: #e3f2fd !important;
  caret-color: #e3f2fd !important;
  -webkit-text-fill-color: #e3f2fd !important;
  color-scheme: dark !important;
}

input:focus,
input:active,
input:not(:placeholder-shown) {
  color: #e3f2fd !important;
  -webkit-text-fill-color: #e3f2fd !important;
}

/* Remove autofill background */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px #0d1b2a inset !important;
  -webkit-text-fill-color: #e3f2fd !important;
  caret-color: #e3f2fd !important;
  transition: background-color 5000s ease-in-out 0s;
}

/* ══════════════════════════════════════════
   LEAFLET — ESTILOS ESPECÍFICOS
   ══════════════════════════════════════════ */

/* Marcadores de rota (Leaflet DivIcon) */
.lf-route-marker {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  font-family: 'Orbitron', sans-serif;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .5);
}

/* Label de distância sobre as linhas */
.lf-label-overlay {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Tooltip de aeródromo (Leaflet tooltip) */
.lf-aero-tooltip {
  background: #0d1b2a !important;
  border: 1px solid #1e3a5f !important;
  border-radius: 8px !important;
  color: #e0e0e0 !important;
  font-family: var(--config-fonte) !important;
  font-size: 12px !important;
  padding: 6px 10px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .5) !important;
}

.lf-aero-tooltip::before {
  border-top-color: #1e3a5f !important;
}

/* Popup Leaflet personalizado */
.lf-popup .leaflet-popup-content-wrapper {
  background: #0d1b2a;
  border: 1px solid #1e3a5f;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .6);
  padding: 0;
}

.lf-popup .leaflet-popup-content {
  margin: 0;
  width: auto !important;
}

.lf-popup .leaflet-popup-tip-container {
  display: none;
}

.lf-popup .leaflet-popup-close-button {
  color: #546e7a !important;
  font-size: 18px !important;
  top: 6px !important;
  right: 8px !important;
}

.lf-popup .leaflet-popup-close-button:hover {
  color: #90caf9 !important;
}

/* Ocultar a barra de atribuição do Leaflet em telas pequenas */
@media (max-width: 768px) {
  .leaflet-control-attribution {
    font-size: 9px;
  }
}

/* ══════════════════════════════════════════
   BANNER INSTALAR APP (PWA)
   ══════════════════════════════════════════ */
.install-app-box {
  display: none;
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  z-index: 9999;
  background: var(--azul-painel);
  border: 1px solid var(--azul-borda);
  border-radius: var(--radius);
  box-shadow: var(--sombra);
  padding: 16px;
  color: var(--texto-prim);
  font-size: .9rem;
}

.install-app-box strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 6px;
  color: var(--azul-acento);
}

.install-app-box p {
  margin: 0 0 4px;
  color: var(--texto-sec);
  font-size: .85rem;
}

.install-app-tip {
  display: none;
}

.install-app-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.install-app-actions .btn {
  color: #fff;
}

.install-app-actions .btn-default {
  background: transparent;
  border: 1px solid var(--azul-borda);
}

.install-app-actions .btn-default:hover {
  background: var(--azul-borda);
  color: #fff;
}

@media (min-width: 600px) {
  .install-app-box {
    max-width: 380px;
    left: auto;
    right: 24px;
    bottom: 24px;
  }
}

/* ════════════════════════════════════════════
   MODO GPS
   ════════════════════════════════════════════ */

/* Botão GPS na ponto-linha — só aparece em touch/mobile */
.ponto-gps-btn {
  display: none;
  background: rgba(0, 230, 118, .12);
  border: 1px solid rgba(0, 230, 118, .35);
  color: #00e676;
  border-radius: 6px;
  font-size: 13px;
  padding: 2px 5px;
  cursor: pointer;
  margin-top: 3px;
  line-height: 1;
  transition: background .2s;
  flex-shrink: 0;
}

.ponto-gps-btn:hover {
  background: rgba(0, 230, 118, .25);
}

@media (pointer: coarse),
(max-width: 1024px) {
  .ponto-gps-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* ── Aba toggle painel esquerdo ── */
#painel-tab {
  position: fixed;
  left: 0;
  top: calc(var(--topbar-h, 60px) + 2px);
  width: 26px;
  height: 64px;
  background: rgba(13, 27, 42, .97);
  border: 1px solid #1e3a5f;
  border-left: none;
  border-radius: 0 12px 12px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #42a5f5;
  font-size: 12px;
  cursor: pointer;
  z-index: 1200;
  transition: top .3s ease, color .2s, background .2s;
  box-shadow: 2px 0 8px rgba(0, 0, 0, .4);
  -webkit-tap-highlight-color: transparent;
}

#painel-tab:hover,
#painel-tab:active {
  background: rgba(66, 165, 245, .25);
  color: #90caf9;
}

#painel-tab.aberto {
  color: #00e676;
  border-color: rgba(0, 230, 118, .4);
}

/* Fecha painel esquerdo */
body.painel-fechado #busca-container,
body.painel-fechado #sidebar-body {
  transform: translateX(-110%) !important;
  transition: transform .3s ease !important;
  pointer-events: none;
}

/* Recolhe busca e sidebar ao entrar no GPS */
body.gps-mode #busca-container,
body.gps-mode #sidebar-body {
  transform: translateX(-120%) !important;
  transition: transform .35s ease !important;
  pointer-events: none;
}

/* O mapa NÃO gira — apenas o ícone do avião gira */

/* ── Overlay GPS ── */
#gps-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  pointer-events: none;
}

/* ── HUD topo ── */
.gps-top-hud {
  position: absolute;
  top: var(--topbar-h, 60px);
  left: 0;
  right: 0;
  padding: 10px 12px 8px;
  background: rgba(0, 0, 0, .68);
  text-align: center;
  pointer-events: none;
}

.gps-dest-text {
  font-size: 13px;
  font-weight: 700;
  font-family: 'Orbitron', monospace;
  color: #fff;
  letter-spacing: .4px;
  margin-bottom: 6px;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}

.gps-hdg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.gps-hud-left,
.gps-hud-right {
  font-size: 10px;
  font-family: 'Orbitron', monospace;
  color: #90caf9;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gps-hud-right {
  align-items: flex-end;
}

.gps-hdg-center {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.gps-current-hdg {
  font-family: 'Orbitron', monospace;
  font-size: 26px;
  font-weight: 700;
  transition: color .25s;
  min-width: 80px;
  text-align: center;
}

.gps-current-hdg.on-course {
  color: #00e676;
}

.gps-current-hdg.off-course {
  color: #ff5252;
}

.gps-arrow {
  font-size: 22px;
  color: #ff5252;
  animation: gps-pisca .7s step-end infinite;
  width: 24px;
  text-align: center;
}

@keyframes gps-pisca {
  50% {
    opacity: 0;
  }
}

/* ── Âncora: posiciona o avião no centro exato da tela (50% / 50%) ── */
.gps-plane-anchor {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
}

/*
 * Wrap interno: gira via JS em torno do centro do ícone do avião.
 * Dotted line = 90px, ícone = 30px → centro do ícone = 90 + 15 = 105px do topo.
 * transform-origin: 50% 105px  → eixo de rotação = centro do avião.
 * translateY(-105px)            → move o wrap para cima de modo que o centro
 *                                  do avião fique exatamente na âncora (50% / 70%).
 */
.gps-plane-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateX(-50%) translateY(-105px);
  transform-origin: 50% 105px;
  transition: transform .1s linear;
  pointer-events: none;
}

/* Cor dinâmica via variável: vermelho = fora da proa, verde = na proa */
.gps-plane-wrap {
  --gps-cor: #ff1744;
}

.gps-plane-wrap.gps-on-course {
  --gps-cor: #00e676;
}

/* Linha pontilhada à frente do avião (3× o ícone ≈ 90 px) */
.gps-dotted-line {
  width: 3px;
  height: 90px;
  background: repeating-linear-gradient(to bottom,
      var(--gps-cor) 0px, var(--gps-cor) 7px,
      transparent 7px, transparent 14px);
  opacity: .9;
}

.gps-plane-icon {
  font-size: 30px;
  line-height: 1;
  color: var(--gps-cor);
  filter: drop-shadow(0 0 6px rgba(0, 0, 0, .8));
  display: block;
  transition: color .25s;
}

/* ── Botão Sair GPS no menu mobile ── */
body.gps-mode #btn-sair-gps {
  display: inline-flex !important;
}

/* Controles de mapa já são position:fixed, ficam acima do overlay GPS */
body.gps-mode .map-zoom-control,
body.gps-mode #map-type-control {
  z-index: 1600;
}