/* =========================================================
   ASOCLIMACR – CSS GLOBAL COMPARTIDO
   ---------------------------------------------------------
   Estructura:
   1) Variables de marca
   2) Base (reset, tipografía, helpers)
   3) Formulario y validación
   4) Sistema de botones (píldora unificado + chips)
   5) Navbar y enlaces
   6) Estados/Utilidades
   7) Leaflet & tooling
   8) Notificaciones (toasts Bootstrap)
   9) Footer
   ========================================================= */


/* 1) VARIABLES DE MARCA ---------------------------------- */
:root{
  /* Verdes de marca */
  --brand-green: #2e7d32;
  --brand-green-dark: #1b5e20;

  /* Rojos (acciones destructivas) */
  --brand-red: #b42318;
  --brand-red-dark: #8a2017;

  /* Claros para hovers */
  --green-50: #eaf7ee;
  --red-50:   #fdeceb;

  /* Neutros */
  --neutral-50:  #f9fafb;
  --neutral-100: #f3f4f6;
  --neutral-200: #e5e7eb;
  --neutral-300: #d1d5db;
  --neutral-700: #374151;
  --neutral-900: #111827;
}


/* 2) BASE (RESET, TIPOGRAFÍA) ---------------------------- */
*,
*::before,
*::after{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

body{
  font-family: 'Poppins', sans-serif;
  background-color: #EBF5EC;    /* fondo verdoso suave del sitio */
  color: var(--neutral-900);
}

img, svg, video{ max-width: 100%; height: auto; }

.numero{
  font-size: 2.5rem; font-weight: 700; color: #2F4F4F;
}
.descripcion{
  font-family: 'Poppins', sans-serif; font-size: 1rem; color: #2F4F4F;
}


/* 3) FORMULARIO Y VALIDACIÓN ----------------------------- */
.form-control{
  border-radius: 10px; padding: 10px 15px; font-size: 1rem;
}
.form-control:focus{
  box-shadow: 0 0 5px rgba(0,123,255,.5);
  border-color: #4CAF50;
}

/* Estados de error */
.is-invalid{ border: 2px solid #dc3545 !important; }
.error-message{
  color: #dc3545; font-size: .85rem; margin-top: 5px;
}
.error-messages{
  background: rgba(255,0,0,.1);
  border: 1px solid #ff0000; border-radius: 8px; color: #ff0000;
  padding: 10px; margin-bottom: 20px; font-size: .9rem; display: none;
}


/* 4) SISTEMA DE BOTONES (PÍLDORA + CHIPS) ---------------- */
/* Base para .btn (excluye .btn-link y componentes especiales) */
.btn:not(.btn-link),
.btn-calcular,
.btn-donar{
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 1rem;
  text-transform: uppercase;
  border: 1px solid var(--neutral-200);
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  transition:
    transform .15s ease,
    box-shadow .15s ease,
    background-color .2s ease,
    border-color .2s ease,
    color .2s ease;
}
.btn:focus-visible{ outline: 2px solid #93c5fd; outline-offset: 2px; }
.btn:disabled{
  opacity: .6; pointer-events: none; transform: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

/* Verde de marca (primario/success) */
.btn-primary,
.btn-success,
.btn-calcular,
.btn-donar{
  background: var(--brand-green) !important;
  color: #fff !important;
  border-color: rgba(46,125,50,.25) !important;
}
.btn-primary:hover,
.btn-success:hover,
.btn-calcular:hover,
.btn-donar:hover{
  background: var(--brand-green-dark) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
}
.btn-primary:active,
.btn-success:active,
.btn-calcular:active,
.btn-donar:active{
  background: #1f5a23 !important;
  transform: translateY(0);
}

/* Outline success */
.btn-outline-success{
  background: #fff !important;
  color: var(--brand-green) !important;
  border-color: rgba(46,125,50,.28) !important;
  border-radius: 999px;
}
.btn-outline-success:hover{
  background: var(--green-50) !important;
  color: var(--brand-green-dark) !important;
  border-color: rgba(46,125,50,.38) !important;
}

/* Secundario (neutral) */
.btn-secondary{
  background: #fff !important;
  color: var(--neutral-700) !important;
  border-color: var(--neutral-200) !important;
}
.btn-secondary:hover{
  background: var(--neutral-100) !important;
  border-color: var(--neutral-300) !important;
}

/* Peligro */
.btn-danger{
  background: var(--brand-red) !important; color: #fff !important;
  border-color: rgba(180,35,24,.28) !important;
}
.btn-danger:hover{ background: var(--brand-red-dark) !important; }

/* Outline danger */
.btn-outline-danger{
  background: #fff !important; color: var(--brand-red) !important;
  border-color: rgba(180,35,24,.28) !important;
}
.btn-outline-danger:hover{
  background: var(--red-50) !important; color: var(--brand-red-dark) !important;
  border-color: rgba(180,35,24,.38) !important;
}

/* Tamaños */
.btn-lg{ padding: 14px 24px; font-size: 1.05rem; }

/* 4.1) Chips universales */
.btn-chip{
  display:inline-flex; align-items:center; gap:8px;
  padding:10px 14px; border-radius:999px;
  border:1px solid var(--neutral-200);
  background:#fff; color: var(--neutral-700);
  font-weight:500; box-shadow:0 2px 8px rgba(0,0,0,.04);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, color .15s ease, background-color .2s ease;
  cursor:pointer;
}
.btn-chip .icon{
  display:grid; place-items:center; width:22px; height:22px;
  border-radius:50%; font-weight:700; line-height:1;
}
.btn-chip:hover{ transform:translateY(-1px); box-shadow:0 6px 18px rgba(0,0,0,.08); }
.btn-chip:active{ transform:translateY(0); box-shadow:0 2px 8px rgba(0,0,0,.04); }
.btn-chip:focus-visible{ outline:2px solid #93c5fd; outline-offset:2px; }

/* Variantes */
.btn-chip.add .icon{ background:#e8f5e9; color: var(--brand-green); }
.btn-chip.clear{ color: var(--brand-red); border-color: rgba(180,35,24,.28); }
.btn-chip.clear .icon{ background:#fde8e7; color: var(--brand-red); }

/* Hovers variantes */
.btn-chip.add:hover,
.btn-chip.add:focus-visible{
  background: var(--green-50); border-color: rgba(46,125,50,.28);
  color: var(--brand-green-dark);
}
.btn-chip.add:hover .icon,
.btn-chip.add:focus-visible .icon{
  background: rgba(46,125,50,.14); color: var(--brand-green-dark);
}
.btn-chip.clear:hover,
.btn-chip.clear:focus-visible{
  background: var(--red-50); border-color: rgba(180,35,24,.28);
  color: var(--brand-red-dark);
}
.btn-chip.clear:hover .icon,
.btn-chip.clear:focus-visible .icon{
  background: rgba(180,35,24,.14); color: var(--brand-red-dark);
}


/* 5) NAVBAR Y ENLACES ------------------------------------ */
.navbar-auth{
  background: var(--brand-green) !important;
  position: fixed; top: 0; width: 100%; z-index: 3000;
  padding: 1rem 2rem; box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.navbar-auth.scrolled{
  background: rgba(0,0,0,.6) !important;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.navbar-auth .nav-link{
  color:#fff !important; font-weight:500; margin-right:1rem;
}
.navbar-auth .nav-link:hover{ text-decoration: underline; }

/* Enlaces genéricos (fuera del navbar) */
.nav-link{
  color:#fff !important; font-weight:500; margin:0 15px;
  transition: color .3s ease; font-size:16px; text-decoration:none;
}
.nav-link.active{ text-decoration: underline; font-weight:700; }
.nav-link:hover{ color:#4CAF50 !important; }


/* 6) ESTADOS / UTILIDADES -------------------------------- */
.estado-aprobado{ color:#4CAF50; font-weight:700; }
.estado-pendiente{ color:orange; font-weight:700; }
.estado-rechazado{ color:red; font-weight:700; }

.tooltip-co2{ font-weight:700; font-size:14px; color:#2F4F4F; }


/* 7) LEAFLET & TOOLING ----------------------------------- */
.leaflet-draw-toolbar a{
  background-color: #4CAF50 !important; /* <-- ¡CORREGIDO! */
  color:#fff !important; 
  border-radius:4px;
}


/* 8) NOTIFICACIONES (TOASTS) ----------------------------- */
#toast-container{
  position: fixed; top: 99px; right: 20px; left: auto;
  transform: none; z-index: 5000;
}
#toast-container .toast{
  pointer-events: auto; border-radius: 8px; font-size: .95rem;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.toast .toast-body{ font-weight: 500; }
.toast.text-bg-success{ background:#4CAF50 !important; }
.toast.text-bg-danger{  background:#dc3545 !important; }
.toast.text-bg-warning{ background:#ffc107 !important; color:#000 !important; }
.toast.text-bg-info{    background:#0dcaf0 !important; color:#000 !important; }

/* Responsive: centra toasts en móviles */
@media (max-width: 576px){
  #toast-container{
    right: auto; left: 50%; transform: translateX(-50%);
    width: calc(100% - 32px); max-width: 560px;
  }
}


/* 9) FOOTER ---------------------------------------------- */
.footer-logo{ height: 120px; margin: 0 15px; }
.footer-divider{ border-top: 1px solid #CCC; margin: 20px 0; }
.footer-copyright{
  font-size: .85rem; color: #555;
}
footer.footer{
  background: inherit; color: #2F4F4F; font-size: .95rem;
  border-top: 1px solid #ddd;
}
footer.footer h5{
  font-weight: 600; font-size: 1.1rem; margin-bottom: 1rem; color:#2F4F4F;
}
footer.footer p,
footer.footer li,
footer.footer a{
  font-size: .95rem; color:#2F4F4F; text-decoration:none;
}
footer.footer a:hover{ text-decoration: underline; color:#4CAF50; }
footer.footer ul{ padding-left: 0; list-style: none; }
footer .me-2{ margin-right: .5rem; }

/* Botón “suave” reutilizable */
.btn-soft-success{
  background: var(--green-50) !important; color: var(--brand-green) !important;
  border: 1px solid rgba(46,125,50,.28) !important; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04); font-weight: 700;
  text-transform: uppercase; padding: 12px 22px;
}
.btn-soft-success:hover{
  background: #dff3e6 !important; color: var(--brand-green-dark) !important;
  border-color: rgba(46,125,50,.38) !important;
  transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.08);
}
.btn-soft-success:active{ background: #d6eedf !important; transform: translateY(0); }