/* ==========================================================================
   PALETA DE CORES INSTITUCIONAL - ISAB (CLEAN & CORES DA LOGO)
   ========================================================================== */
:root {
  --isab-gold: #D4A017;         /* Dourado / Amarelo da logo */
  --isab-gold-dark: #B8860B;    /* Dourado mais escuro para hover */
  --isab-terracotta: #C0392B;   /* Terracota / Tom quente da logo */
  --isab-dark: #1A1A1A;         /* Preto institucional para textos e títulos */
  --isab-bg-light: #F9FAFB;     /* Off-white clean para fundos secundários */
  --isab-border: #E5E7EB;       /* Linha sutil de divisão */
  --isab-surface: #FFFFFF;      /* Branco puro */
}

/* ==========================================================================
   1. HEADER INSTITUCIONAL (Fundo claro neutro)
   ========================================================================== */
.header-figma {
  background-color: var(--isab-surface) !important;
  width: 100% !important;
  box-sizing: border-box;
  padding: 0.8rem 1.5rem;
  border-bottom: 2px solid var(--isab-border) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03) !important;
}

.header-figma__container {
  max-width: var(--layout-max-width, 1200px);
  margin: 0 auto;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 2rem;
}

.brand-figma {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--isab-dark) !important;
  font-weight: 700;
  text-decoration: none;
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-right: 1rem;
}

.brand-figma img {
  height: 38px;
  width: auto;
}

.brand-figma span {
  color: var(--isab-dark) !important;
}

/* LINKS DO HEADER */
.nav-links {
  display: flex !important;
  align-items: center !important;
  gap: 1.25rem !important;
}

.header-figma .nav-link {
  color: #4B5563 !important;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 9999px;
  transition: all 0.2s ease;
  text-decoration: none !important;
  white-space: nowrap !important;
}

.header-figma .nav-link:hover {
  color: var(--isab-dark) !important;
  background-color: var(--isab-bg-light) !important;
}

.header-figma .nav-link.active {
  background-color: var(--isab-dark) !important;
  color: #ffffff !important;
  font-weight: 600;
}

.btn-auth-figma {
  background-color: #3b6b55 !important;
  color: #ffffff !important;
  padding: 0.6rem 1.25rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.9rem;
  border: none !important;
  transition: all 0.2s ease;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(212, 160, 23, 0.2);
}

.btn-auth-figma:hover {
  color: #ffffff !important;
  transform: translateY(-1px);
}

/* ==========================================================================
   2. HERO CLEAN (Sua nova seção principal do Index)
   ========================================================================== */
.hero-clean {
  background-color: var(--isab-surface);
  border: 1px solid var(--isab-border);
  border-radius: 20px;
  padding: 3.5rem 2.5rem;
  margin-bottom: 2.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.hero-clean__container {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2.5rem;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
}

.hero-clean__badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--isab-terracotta);
  background-color: rgba(192, 57, 43, 0.08);
  padding: 0.4rem 0.9rem;
  border-radius: 50px;
  margin-bottom: 1.25rem;
}

.hero-clean__title {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--isab-dark);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero-clean__description {
  font-size: 1.05rem;
  color: #4B5563;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.hero-clean__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-isab-primary {
 background-color: #ebd05c;
    color: #000000 !important;
  font-weight: 700;
  padding: 0.85rem 1.8rem;
  border-radius: 10px;
  text-decoration: none !important;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(78, 76, 69, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-isab-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(78, 76, 69, 0.25);
}

.btn-isab-secondary {
  background-color: #FFFFFF;
  color: var(--isab-dark) !important;
  font-weight: 600;
  padding: 0.85rem 1.8rem;
  border-radius: 10px;
  border: 1px solid var(--isab-border);
  text-decoration: none !important;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-isab-secondary:hover {
  border-color: var(--isab-dark);
  background-color: var(--isab-bg-light);
}

.hero-clean__image-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--isab-bg-light);
  border-radius: 16px;
  padding: 2.5rem;
  border: 1px solid var(--isab-border);
}

.hero-clean__logo-img {
  max-width: 350px;
  height: auto;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.08));
}

/* ==========================================================================
   3. CARDS PADRONIZADOS E SEÇÕES
   ========================================================================== */
.figma-card {
  background-color: var(--isab-surface) !important;
  border: 1px solid var(--isab-border) !important;
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

/* ESTRUTURA ZIG-ZAG */
.figma-grid-zigzag {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.figma-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
}

.figma-row__text h2 {
  color: var(--isab-dark);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.figma-row__text p {
  color: #4B5563;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.figma-row__image {
  width: 100%;
  height: 240px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--isab-border);
}

.figma-row__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* CARD INFERIOR */
.figma-card--bottom {
  background-color: var(--isab-surface);
  border: 1px solid var(--isab-border);
}

.figma-card--bottom h2 {
  color: var(--isab-dark);
  margin-bottom: 1rem;
}

.how-it-works-list p {
  margin-bottom: 0.75rem;
  color: #4B5563;
  line-height: 1.5;
}

/* ==========================================================================
   4. MAPA (Evita problemas de renderização)
   ========================================================================== */
#map, .mapa-container {
  width: 100%;
  height: 400px !important;
  border-radius: 12px;
  z-index: 1;
  background-color: var(--isab-bg-light);
  position: relative;
  overflow: hidden;
}

/* ÁREA DE IDENTIFICAÇÃO DO USUÁRIO */
#area-ong-header, 
.ong-header-logada {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 12px !important;
  white-space: nowrap !important;
}

#usuario-identificacao,
.ong-header-nome {
  white-space: nowrap !important;
  display: inline-block !important;
  margin: 0 !important;
}

/* ==========================================================================
   5. POPOVER DE PERFIL
   ========================================================================== */
.perfil-popover-wrapper {
  position: relative;
  display: inline-block;
}

.btn-perfil-trigger {
  background: var(--isab-bg-light);
  color: var(--isab-dark);
  border: 1px solid var(--isab-border);
  padding: 6px 16px;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.btn-perfil-trigger:hover {
  background: #E5E7EB;
}

.perfil-popover-card {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 310px;
  max-width: 310px;
  background-color: var(--isab-surface);
  color: var(--isab-dark);
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  padding: 20px;
  z-index: 1000;
  display: none;
  border: 1px solid var(--isab-border);
  box-sizing: border-box !important;
  animation: popoverFadeIn 0.2s ease;
}

.perfil-popover-card * {
  box-sizing: border-box !important;
}

.perfil-popover-card.is-open {
  display: block;
}

@keyframes popoverFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.8rem;
  color: #666666;
  border-bottom: 1px solid var(--isab-border);
  padding-bottom: 8px;
}

.popover-close-btn {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  color: #666666;
  cursor: pointer;
  padding: 0;
}

.popover-body {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.popover-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--isab-gold);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: bold;
  margin-bottom: 10px;
  box-shadow: 0 4px 10px rgba(212, 160, 23, 0.25);
}

.popover-saudacao {
  font-size: 1.15rem;
  font-weight: bold;
  color: var(--isab-dark);
  margin: 0 0 4px 0;
}

.popover-email {
  font-size: 0.82rem;
  color: #666666;
  margin: 0 0 10px 0;
  word-break: break-all;
}

.popover-badge {
  display: inline-block;
  padding: 4px 12px;
  background-color: rgba(212, 160, 23, 0.12);
  color: var(--isab-gold-dark);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.btn-popover-editar {
  background-color: var(--isab-gold) !important;
  color: #ffffff !important;
  border: none !important;
  padding: 8px 16px !important;
  border-radius: 9999px !important;
  font-size: 0.85rem !important;
  font-weight: bold !important;
  cursor: pointer !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 4px 0 0 0 !important;
  display: block !important;
  transition: background-color 0.2s ease !important;
}

.btn-popover-editar:hover {
  background-color: var(--isab-gold-dark) !important;
}

/* TOAST DE NOTIFICAÇÃO */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  background-color: #ffffff;
  color: #1a1a1a;
  padding: 14px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 5px solid var(--isab-gold);
  font-weight: 500;
  font-size: 0.95rem;
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast--sucesso { border-left-color: var(--isab-gold); }
.toast--erro { border-left-color: var(--isab-terracotta); }
.toast--alerta { border-left-color: #f59e0b; }

.toast__content { flex: 1; }
.toast__close { background: transparent; border: none; font-size: 1.1rem; color: #666666; cursor: pointer; }

/* ==========================================================================
   MODAL DE AUTENTICAÇÃO / LOGIN (AUTH GUARD CLEAN)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.65); /* Overlay escuro translúcido */
  backdrop-filter: blur(4px);            /* Desfoque suave do fundo */
  display: none;                          /* Oculto por padrão; o JS alterna para flex */
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
  animation: modalFadeIn 0.25s ease-out;
}

/* Quando o JS exibe o overlay (style.display = 'flex'), mantém o conteúdo centralizado */
.modal-overlay[style*="display: flex"],
.modal-overlay[style*="display:flex"] {
  display: flex !important;
}

.modal-box {
  background: #FFFFFF;
  border-radius: 20px;
  border: 1px solid var(--isab-border, #E5E7EB);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  width: 100%;
  max-width: 440px;
  padding: 2.5rem 2rem;
  text-align: center;
  transform: translateY(0);
  animation: modalSlideUp 0.25s ease-out;
}

.modal-auth-icon-wrapper {
  width: 64px;
  height: 64px;
  background-color: rgba(212, 160, 23, 0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem auto;
}

.modal-auth-icon-wrapper svg {
  width: 30px;
  height: 30px;
  color: var(--isab-gold, #D4A017);
}

.modal-auth__title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--isab-dark, #1A1A1A);
  margin-bottom: 0.5rem;
}

.modal-auth__subtitle {
  font-size: 0.95rem;
  color: #4B5563;
  line-height: 1.5;
  margin-bottom: 1.75rem;
}

.modal-auth-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.btn-modal-primary {
  background-color: var(--isab-gold, #D4A017);
  color: #FFFFFF !important;
  font-weight: 700;
  padding: 0.85rem 1.5rem;
  border-radius: 12px;
  border: none;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(212, 160, 23, 0.25);
  width: 100%;
}

.btn-modal-primary:hover {
  background-color: var(--isab-gold-dark, #B8860B);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(212, 160, 23, 0.35);
}

.btn-modal-link {
  background: transparent;
  border: none;
  color: #6B7280;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: color 0.2s ease;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-modal-link:hover {
  color: var(--isab-dark, #1A1A1A);
}

/* Animações */
@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   6. RESPONSIVIDADE MOBILE (AJUSTADO)
   ========================================================================== */

/* Reset global para evitar estouro de tamanhos */
*, *::before, *::after {
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .header-figma { 
    padding: 0.75rem 0; 
  }
  
  .header-figma__container { 
    gap: 0.75rem; 
    padding: 0.5rem 1rem; 
  }
  
  .brand-figma { 
    font-size: 1rem; 
  }
  
  .brand-figma img { 
    height: 32px; 
  }
  
  #area-ong-header { 
    gap: 0.5rem !important; 
  }
  
  .btn-auth-figma { 
    padding: 0.5rem 1rem; 
    font-size: 0.85rem; 
  }

  /* Ajustes do Hero para Mobile */
  .hero-clean { 
    padding: 1.5rem 1rem !important; 
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden;
  }
  
  /* Força a estrutura em 1 coluna única na vertical */
  .hero-clean__container { 
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 1.5rem !important;
    text-align: center !important;
  }

  /* Impede a quebra esquisita de palavras */
  .hero-clean__title { 
    font-size: 1.5rem !important; 
    word-break: normal !important;
    overflow-wrap: normal !important;
    hyphens: manual !important;
  }

  .hero-clean__description {
    font-size: 0.95rem !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    hyphens: manual !important;
  }

  /* Botões empilhados ocupando a largura do cartão */
  .hero-clean__actions { 
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.75rem !important;
  }

  .btn-isab-primary,
  .btn-isab-secondary {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 0.85rem 1rem !important;
  }

  /* Ajuste da Imagem/Logo no mobile */
  .hero-clean__image-wrapper {
    width: 100% !important;
    padding: 1.5rem !important;
  }

  .hero-clean__logo-img {
    max-width: 180px !important;
    width: 100% !important;
    height: auto !important;
  }

  /* Demais cards e linhas */
  .figma-row { 
    grid-template-columns: 1fr !important; 
  }
  
  .figma-card { 
    padding: 1.25rem !important; 
  }
  
  .figma-row__image { 
    height: 180px !important; 
  }
}

@media (max-width: 480px) {
  .header-figma__container { 
    padding: 0.5rem 0.75rem; 
  }
  
  .brand-figma span { 
    display: none; 
  }
  
  .perfil-popover-card {
    width: calc(100vw - 2rem);
    max-width: calc(100vw - 2rem);
    right: -0.5rem;
  }
}

/* ==========================================================================
   DROPDOWN CUSTOMIZADO COM CHECKBOXES (Categoria / Itens da doação)
   O container pai (.form-group) usa position: relative para ancorar o menu.
   ========================================================================== */

/* Campo "gatilho" que o usuário clica para abrir o menu */
.dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.dropdown-trigger:focus,
.dropdown-trigger:focus-visible {
  outline: 2px solid var(--isab-green-main, #286447);
  outline-offset: 1px;
}

.dropdown-seta {
  font-size: 0.7rem;
  color: #64748b;
  transition: transform 0.2s ease;
  pointer-events: none;
}

/* Caixa de opções: escondida por padrão, flutua sobre o conteúdo abaixo */
.dropdown-menu-custom {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  max-height: 260px;
  overflow-y: auto;
  background-color: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.06);
  padding: 0.4rem;
}

/* Cada opção da lista */
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.7rem;
  margin: 0;
  border-radius: 6px;
  font-size: 0.92rem;
  color: #1f2937;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.dropdown-item:hover {
  background-color: #f1f5f9;
}

.dropdown-item input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: var(--isab-green-main, #286447);
  cursor: pointer;
  flex-shrink: 0;
}

/* Estado vazio (nenhuma categoria selecionada no menu de itens) */
.dropdown-menu-custom .dropdown-vazio {
  padding: 0.7rem;
  font-size: 0.88rem;
  color: #94a3b8;
  text-align: center;
}
