/* GERAL */
body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", sans-serif;
  height: 100vh;
}

/* MAPA */
#mapa {
  width: 100vw;
  height: 100vh;
  z-index: 1;
}

/* BARRA DE BUSCA (Centralizada e Bonita) */
#barra-busca {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: white;
  padding: 8px 15px;
  border-radius: 50px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  display: flex;
  gap: 10px;
  align-items: center;
  width: 90%;
  max-width: 700px;
}

#endereco {
  flex-grow: 1;
  padding: 10px;
  border: none;
  outline: none;
  font-size: 16px;
}

#filtro-rede {
  padding: 8px;
  border: 1px solid #eee;
  border-radius: 20px;
  background: #f9f9f9;
  font-size: 14px;
  cursor: pointer;
}

#btn-buscar {
  padding: 10px 25px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  font-weight: bold;
}
#btn-buscar:hover {
  background-color: #0056b3;
}

/* MENU DE USUÁRIO (Arrumado) */
.user-menu-container {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1001;
}

.user-btn {
  background: white;
  border: none;
  padding: 10px 20px;
  border-radius: 30px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 5px;
}

.user-dropdown {
  display: none;
  position: absolute;
  top: 50px;
  right: 0;
  background: white;
  min-width: 200px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  overflow: hidden;
}
.user-dropdown.show {
  display: block;
}

.user-dropdown p {
  padding: 15px;
  margin: 0;
  background: #f8f9fa;
  border-bottom: 1px solid #eee;
  font-size: 14px;
  font-weight: bold;
}

.user-dropdown a {
  display: block;
  padding: 12px 15px;
  text-decoration: none;
  color: #333;
  font-size: 14px;
  transition: 0.2s;
}
.user-dropdown a:hover {
  background-color: #f1f1f1;
}

/* ESCONDER CAIXA DE ROTA DO LEAFLET */
/* CAIXA DE ROTA (Agora visível, mas organizada) */
.leaflet-routing-container {
  background-color: white;
  padding: 10px;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  font-size: 14px;

  /* A MÁGICA: Empurra para baixo do menu de usuário */
  margin-top: 60px !important;
}

/* Esconde o texto chato ("Vire a direita"), mantém o resumo */
.leaflet-routing-alt table {
  display: none;
}

/* Estilo do cabeçalho da rota */
.leaflet-routing-alt h2 {
  font-size: 16px;
  margin: 0;
  color: #007bff;
}

/* CSS DO LOGIN */

body.login-page {
  background: linear-gradient(135deg, #004e92 0%, #000428 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  font-family: "Segoe UI", sans-serif;
}

/* A Caixa Branca (Card) */
.login-card {
  background: white;
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 380px;
  text-align: center;
  animation: slideUp 0.5s ease-out;
}

/* Título e Ícone */
.login-header i {
  font-size: 50px;
  color: #007bff;
  margin-bottom: 10px;
}
.login-header h2 {
  color: #333;
  margin-bottom: 5px;
  font-size: 24px;
}
.login-header p {
  color: #777;
  font-size: 14px;
  margin-bottom: 30px;
}

/* Campos de Texto com Ícones */
.input-group {
  position: relative;
  margin-bottom: 20px;
}
.input-group i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #007bff;
}
.input-group input {
  width: 100%;
  padding: 12px 15px 12px 45px;
  border: 1px solid #ddd;
  border-radius: 30px;
  font-size: 15px;
  outline: none;
  transition: 0.3s;
  background-color: #f9f9f9;

  box-sizing: border-box;
  display: block;
}
.input-group input:focus {
  border-color: #007bff;
  background-color: #fff;
  box-shadow: 0 0 8px rgba(0, 123, 255, 0.2);
}

/* Botão Moderno */
.btn-login {
  width: 100%;
  padding: 12px;
  background: linear-gradient(to right, #007bff, #0056b3);
  color: white;
  border: none;
  border-radius: 30px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 86, 179, 0.4);
}

/* Mensagens de Erro */
.flash-message {
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 13px;
  font-weight: bold;
}
.text-danger {
  background-color: #ffebee;
  color: #c62828;
}
.text-success {
  background-color: #e8f5e9;
  color: #2e7d32;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Container Centralizado para Login e Cadastro */
.login-container {
  background: white;
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 450px; /* Largura máxima fixa */
  margin: 50px auto; /* Margem automática nas laterais = CENTRALIZA */
  text-align: center; /* Centraliza títulos e botões */
  display: block; /* Garante que não seja flex */
}

/* Alinhamento dos campos (Labels e Inputs) */
.login-container label {
  text-align: left; /* Texto do rótulo à esquerda */
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #444;
}

.login-container input,
.login-container select {
  width: 100%; /* Ocupa toda a largura do pai */
  box-sizing: border-box; /* Evita vazar a borda */
  padding: 12px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

/* Botão de Ação (Verde) */
.login-container button {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}

/* Ajuste do Cabeçalho com Botão Voltar */
.header-cadastro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

/* =========================================
   ESTILO RESPONSIVO (CELULAR / MOBILE)
   ========================================= */
@media (max-width: 768px) {
  /* 1. MUDAR O BOTÃO DE USUÁRIO PARA APENAS ÍCONE */
  .user-btn {
    font-size: 0; /* Esconde o texto "Minha Conta" */
    width: 45px;
    height: 45px;
    border-radius: 50%; /* Vira uma bolinha perfeita */
    padding: 0;
    justify-content: center;
    position: fixed; /* Fixa na tela */
    top: 15px;
    right: 15px;
  }

  .user-btn i {
    font-size: 18px; /* Mantém o ícone visível */
    margin: 0;
  }

  /* 2. REORGANIZAR A BARRA DE BUSCA */
  #barra-busca {
    top: 70px; /* Desce para não bater no botão de usuário */
    width: 90%; /* Ocupa quase toda a largura */
    flex-wrap: wrap; /* Permite quebrar linha */
    padding: 15px;
    gap: 10px;
    border-radius: 15px; /* Bordas menos redondas ficam mais modernas */
  }

  /* O campo de endereço ocupa a linha toda */
  #endereco {
    width: 100%;
    flex-basis: 100%;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    text-align: center; /* Texto centralizado fica estilo App */
  }

  /* Os selects (filtros) dividem espaço */
  #filtro-rede,
  #filtro-operadora {
    flex-grow: 1; /* Crescem para preencher espaço */
    height: 40px; /* Mais alto para o dedo */
    font-size: 13px;
  }

  /* Botão de Buscar ocupa a largura toda no final */
  #btn-buscar {
    width: 100%;
    margin-top: 5px;
    padding: 12px;
    border-radius: 10px;
    font-size: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
  }

  /* 3. AJUSTAR O MENU DROPDOWN (QUANDO CLICA NA CONTA) */
  .user-dropdown {
    top: 65px;
    right: 15px;
    width: 200px;
  }
}
