/* ==========================================================================
   LAYOUT.CSS – ARQUITETURA E GRELHAS (PADRÃO PLANGO 2.0 / LABGEO & GEFORTE)
   Manual de Padronização Técnica e Visual - UECE
   ========================================================================== */

/* RESET E BASE */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #021b14;
  color: #f0fdf4;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ==========================================================================
   1. BARRA SUPERIOR DE ACESSIBILIDADE (.app-topbar) - SECÇÃO 5 DO MANUAL
   ========================================================================== */
.app-topbar {
  background-color: #01140e;
  border-bottom: 1px solid rgba(16, 185, 129, 0.22);
  padding: 8px 24px;
  width: 100%;
  position: relative;
  z-index: 1000;
  flex-shrink: 0;
}

.topbar-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #a7f3d0;
  letter-spacing: 0.5px;
}

.brand-sigla {
  color: #10b981;
  font-weight: 700;
}

.brand-divisao {
  color: rgba(16, 185, 129, 0.4);
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tools-label {
  font-size: 0.8rem;
  color: #a7f3d0;
  margin-right: 4px;
}

.tool-btn {
  background: #062d22;
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #f0fdf4;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tool-btn:hover {
  background: rgba(16, 185, 129, 0.18);
  border-color: #10b981;
}

.tool-btn-voice {
  border-color: rgba(16, 185, 129, 0.4);
}

/* ==========================================================================
   2. INVÓLUCRO PRINCIPAL (.app-shell)
   ========================================================================== */
.app-shell {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
}

/* ==========================================================================
   3. CABEÇALHO HERO E VÍDEO (.app-hero) - SECÇÃO 2 DO MANUAL
   ========================================================================== */
.app-hero {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(16, 185, 129, 0.5);
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 440px;
  background: #021b14;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px 36px;
}

.hero-video-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  opacity: 0.85;
  pointer-events: none;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(2, 27, 20, 0.3) 0%, rgba(2, 27, 20, 0.85) 100%);
  z-index: 2;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 3;
  max-width: 760px;
}

.hero-badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.hero-badge {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #a7f3d0;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.version-badge {
  background: #10b981;
  color: #021b14;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
}

.hero-title {
  color: #f0fdf4;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.hero-subtitle {
  color: #a7f3d0;
  font-size: 1.05rem;
  line-height: 1.5;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.hero-status-card {
  position: relative;
  z-index: 3;
  align-self: flex-start;
  background: rgba(1, 20, 14, 0.85);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-pulse {
  width: 9px;
  height: 9px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 10px #10b981;
  animation: pulsoStatus 2s infinite;
}

@keyframes pulsoStatus {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.status-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: #f0fdf4;
}

.status-tip {
  font-size: 0.75rem;
  color: #a7f3d0;
  opacity: 0.85;
}

/* ==========================================================================
   4. ÁREA DE AUTENTICAÇÃO / LOGIN PADRONIZADA (.auth-wrapper)
   ========================================================================== */
.auth-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 10px 0 20px;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: #062d22;
  border: 1px solid rgba(16, 185, 129, 0.22);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.auth-card-header {
  padding: 24px 28px 18px;
  background: #011710;
  border-bottom: 1px solid rgba(16, 185, 129, 0.2);
  text-align: center;
}

.auth-card-header h2 {
  font-size: 1.3rem;
  color: #f0fdf4;
  font-weight: 700;
  margin-bottom: 4px;
}

.auth-card-header p {
  font-size: 0.85rem;
  color: #a7f3d0;
}

.auth-card-body {
  padding: 26px 28px 30px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-card-body label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #a7f3d0;
  margin-bottom: 6px;
}

.auth-card-body input[type="text"],
.auth-card-body input[type="email"],
.auth-card-body input[type="password"] {
  width: 100%;
  background: #031811;
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 8px;
  padding: 12px 14px;
  color: #f0fdf4;
  font-family: inherit;
  font-size: 0.9rem;
  margin-bottom: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-card-body input:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.auth-submit-btn {
  width: 100%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #021b14;
  border: none;
  border-radius: 8px;
  padding: 13px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: filter 0.2s, transform 0.1s;
  margin-top: 6px;
}

.auth-submit-btn:hover {
  filter: brightness(1.1);
}

.auth-submit-btn:active {
  transform: scale(0.99);
}

.auth-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.auth-links a {
  color: #a7f3d0;
  font-size: 0.82rem;
  text-decoration: none;
  cursor: pointer;
}

.auth-links a:hover {
  color: #10b981;
  text-decoration: underline;
}

.msg-erro {
  color: #ef4444;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  min-height: 18px;
}

/* ==========================================================================
   5. FAIXA DO USUÁRIO E AMBIENTE CARTOGRÁFICO (.main-map-section)
   ========================================================================== */
.main-map-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.user-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #062d22;
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 12px;
  padding: 10px 18px;
}

.user-strip-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: #f0fdf4;
  font-weight: 600;
}

.user-strip-badge {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #a7f3d0;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.72rem;
}

.btn-sair-strip {
  background: #dc2626;
  border: none;
  color: #ffffff;
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-sair-strip:hover {
  opacity: 0.85;
}

.mapa-container {
  position: relative;
  width: 100%;
  height: 580px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

#map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

.map-controls-bar {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  width: calc(100% - 32px);
  max-width: 820px;
  pointer-events: none;
}

.map-controls-bar > * {
  pointer-events: auto;
}

.map-btn {
  background: rgba(6, 45, 34, 0.92);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #f0fdf4;
  padding: 9px 15px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
}

.map-btn:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: #10b981;
}

.map-btn-accent {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #021b14;
  border: none;
}

.map-btn-accent:hover {
  filter: brightness(1.1);
}

.map-btn-primary {
  border-color: #10b981;
}

/* ==========================================================================
   6. PAINEL LATERAL (SIDEBAR)
   ========================================================================== */
.sidebar-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 390px;
  max-width: 90vw;
  height: 100%;
  background: #062d22;
  border-left: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.7);
  z-index: 2500;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.sidebar-panel.open {
  right: 0;
}

.sidebar-header {
  padding: 18px 20px;
  background: #01140e;
  border-bottom: 1px solid rgba(16, 185, 129, 0.22);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-header h2 {
  font-size: 1.15rem;
  color: #10b981;
  font-weight: 700;
}

.btn-close {
  background: transparent;
  border: none;
  color: #a7f3d0;
  font-size: 1.3rem;
  cursor: pointer;
}

.sidebar-tools {
  padding: 16px 20px;
  background: rgba(3, 24, 17, 0.7);
  border-bottom: 1px solid rgba(16, 185, 129, 0.2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-tools input,
.sidebar-tools select {
  width: 100%;
  background: #031811;
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 8px;
  padding: 9px 12px;
  color: #f0fdf4;
  font-family: inherit;
  font-size: 0.85rem;
}

.sidebar-export-actions {
  display: flex;
  gap: 8px;
}

.btn-secondary-sm {
  flex: 1;
  background: #062d22;
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #f0fdf4;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.btn-secondary-sm:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
}

.empty-state {
  text-align: center;
  color: #a7f3d0;
  opacity: 0.7;
  font-size: 0.85rem;
  padding: 30px 10px;
}

/* ==========================================================================
   7. MODAL DE PONTO E DETALHES (.plan-card)
   ========================================================================== */
.modal,
.detalhes-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(1, 15, 11, 0.85);
  backdrop-filter: blur(4px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.modal-content,
.detalhes-container {
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  background: #062d22;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 16px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 18px 24px;
  background: #01140e;
  border-bottom: 1px solid rgba(16, 185, 129, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  color: #10b981;
  font-size: 1.15rem;
  font-weight: 700;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: #a7f3d0;
  font-size: 1.25rem;
  cursor: pointer;
}

.modal-scroll-area {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-scroll-area label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #a7f3d0;
}

.modal-scroll-area input[type="text"],
.modal-scroll-area select,
.modal-scroll-area textarea {
  width: 100%;
  background: #031811;
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 8px;
  padding: 9px 12px;
  color: #f0fdf4;
  font-family: inherit;
  font-size: 0.88rem;
}

.modal-scroll-area textarea {
  resize: vertical;
}

.coords-info {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.8rem;
  color: #f0fdf4;
}

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

.pedagogical-box {
  background: rgba(1, 20, 14, 0.85);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pedagogical-box h4 {
  font-size: 0.85rem;
  color: #10b981;
}

.copiloto-input-group {
  display: flex;
  gap: 8px;
}

.btn-copiloto {
  background: #062d22;
  border: 1px solid #10b981;
  color: #f0fdf4;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.copiloto-feedback-box {
  background: #031811;
  border-left: 3px solid #10b981;
  padding: 10px 12px;
  font-size: 0.82rem;
  color: #f0fdf4;
  line-height: 1.45;
  border-radius: 4px;
}

.modal-footer {
  padding: 14px 24px;
  background: #01140e;
  border-top: 1px solid rgba(16, 185, 129, 0.2);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-secondary {
  background: #062d22;
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #f0fdf4;
  padding: 9px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #021b14;
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}

/* ==========================================================================
   8. RODAPÉ INSTITUCIONAL: QUADRO ÚNICO ENVOLVENTE (SECÇÃO 4 DO MANUAL)
   ========================================================================== */
.app-footer {
  width: 100%;
  margin-top: 10px;
  flex-shrink: 0;
}

.footer-frame-container {
  max-width: 1200px;
  margin: 0 auto;
  border: 1px solid rgba(16, 185, 129, 0.32);
  border-radius: 20px;
  background: #021b14;
  padding: 34px 38px;
}

.footer-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.logo-box {
  width: 82px;
  height: 68px;
  background: #01140e;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
}

.logo-box img {
  max-height: 44px;
  max-width: 58px;
  object-fit: contain;
}

.footer-divider {
  width: 100%;
  height: 1px;
  background: rgba(16, 185, 129, 0.22);
  border: none;
  margin: 22px 0;
}

.footer-institutional-text {
  text-align: justify;
}

.institutional-statement {
  color: #a7f3d0;
  font-size: 0.8rem;
  line-height: 1.6;
  margin: 0;
}

.institutional-statement strong {
  color: #10b981;
}

.footer-bottom-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  font-size: 0.75rem;
  color: rgba(167, 243, 208, 0.6);
  flex-wrap: wrap;
  gap: 10px;
}

.lgpd-link {
  color: #10b981;
  text-decoration: none;
  cursor: pointer;
}

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

/* ==========================================================================
   RESPONSIVIDADE (MOBILE / TABLETS)
   ========================================================================== */
@media (max-width: 768px) {
  .app-shell {
    padding: 16px 12px 32px;
    gap: 16px;
  }

  .app-hero {
    min-height: 380px;
    padding: 24px 20px;
    aspect-ratio: auto;
  }

  .hero-title {
    font-size: 1.85rem;
  }

  .hero-subtitle {
    font-size: 0.92rem;
  }

  .grid-form-2 {
    grid-template-columns: 1fr;
  }

  .footer-frame-container {
    padding: 24px 18px;
  }

  .footer-institutional-text {
    text-align: left;
  }
}