/* =========================================
   IMPACT SECTION HEADER (PARTNERS/NEWS STYLE)
   + IMPACT CARDS (SCREENSHOT STYLE)
   Keeps your impact-stat + counting animation
   No duplicates
   ========================================= */

/* =========================
   SECTION BACKGROUND
   ========================= */
.impact-section-background{
  position: relative;
  overflow: hidden;
  margin: 0;
  background:
    radial-gradient(circle at 15% 25%, rgba(245, 123, 44, 0.06) 0%, transparent 38%),
    radial-gradient(circle at 80% 35%, rgba(11, 79, 102, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 55% 85%, rgba(20, 119, 109, 0.05) 0%, transparent 45%),
    linear-gradient(135deg,
      rgba(255, 255, 255, 0.98) 0%,
      rgba(243, 250, 250, 0.96) 50%,
      rgba(255, 255, 255, 0.98) 100%);
}

/* dot texture like partners */
.impact-section-background::before{
  content:"";
  position:absolute;
  inset:0;
  background-image: radial-gradient(circle, rgba(11, 79, 102, 0.10) 1.2px, transparent 1.3px);
  background-size: 22px 22px;
  opacity: 0.14;
  pointer-events:none;
  z-index:0;
}

.impact-section-background > .container{
  position: relative;
  z-index: 1;
}

/* =========================
   HEADER
   ========================= */
.impact-title-wrap{
  text-align: center;
  max-width: 920px;
  margin: 0 auto 34px;
}

.impact-title-wrap h2{
  margin: 0;
  font-weight: 900;
  letter-spacing: 0.2px;
  line-height: 1.1;
  font-size: clamp(1.8rem, 2.8vw, 3rem);
}

.impact-title-wrap .t-primary{ color: var(--ahda-teal); }
.impact-title-wrap .t-accent{ color: var(--ahda-orange); }

.impact-underline{
  display: inline-block;
  width: min(260px, 62%);
  height: 6px;
  margin-top: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg,
    rgba(245, 123, 44, 0.0) 0%,
    rgba(245, 123, 44, 0.9) 30%,
    rgba(245, 123, 44, 0.6) 55%,
    rgba(245, 123, 44, 0.0) 100%);
  position: relative;
}

.impact-underline::after{
  content:"";
  position:absolute;
  left:50%;
  transform: translateX(-50%);
  top:-3px;
  width:52px;
  height:12px;
  border-radius:999px;
  background: rgba(245, 123, 44, 0.18);
}

.impact-subtitle{
  margin: 10px auto 0;
  color: var(--ahda-text-gray);
  font-weight: 600;
  font-size: 1.02rem;
  line-height: 1.5;
  max-width: 780px;
}

/* =========================================================
   IMPACT STAT CARDS (SCREENSHOT STYLE)
   - keeps your .stat-icon + .corner-accent in DOM
   - does NOT break JS counting (.number)
   ========================================================= */
.impact-stat{
  position: relative;
  height: 100%;
  min-height: 195px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  text-align: center;
  padding: 30px 22px 26px;

  border-radius: 22px;
  overflow: hidden;

  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(243, 250, 250, 0.95) 55%,
    rgba(255, 255, 255, 0.98) 100%);

  border: 1px solid rgba(11, 79, 102, 0.10);

  box-shadow:
    0 14px 35px rgba(11, 79, 102, 0.10),
    0 4px 12px rgba(0, 0, 0, 0.06);

  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

/* thin orange top line like screenshot */
.impact-stat::before{
  content:"";
  position:absolute;
  top:0;
  left:14px;
  right:14px;
  height:4px;
  border-radius: 0 0 999px 999px;
  background: linear-gradient(90deg,
    rgba(245,123,44,0) 0%,
    rgba(245,123,44,1) 22%,
    rgba(245,123,44,1) 78%,
    rgba(245,123,44,0) 100%);
  opacity: .95;
}

/* soft corner tint (very subtle) */
.impact-stat::after{
  content:"";
  position:absolute;
  inset:0;
  background:
    radial-gradient(circle at 18% 22%, rgba(245,123,44,0.10) 0%, transparent 42%),
    radial-gradient(circle at 82% 82%, rgba(11,79,102,0.06) 0%, transparent 44%);
  opacity: .55;
  pointer-events:none;
}

.impact-stat > *{
  position: relative;
  z-index: 1;
}

/* hover like premium card */
.impact-stat:hover{
  transform: translateY(-6px);
  border-color: rgba(11, 79, 102, 0.16);
  box-shadow:
    0 18px 45px rgba(11, 79, 102, 0.14),
    0 6px 16px rgba(0, 0, 0, 0.08);
}

/* Number centered and bold */
.impact-stat .number{
  margin: 0 0 18px;
  font-weight: 900;
  line-height: 1;
  font-size: clamp(2.1rem, 2.2vw, 2.55rem);
  color: var(--ahda-teal);
  text-shadow: 0 3px 8px rgba(0,0,0,0.06);
}

/* Keep your existing "animate" hook working */
.impact-stat .number.animate{
  animation: gradientPulse 0.8s ease-out;
}

/* Label becomes a pill (like screenshot) */
.impact-stat p{
  margin: 0;
  padding: 10px 14px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: 999px;
  font-weight: 700;
  letter-spacing: .3px;
  font-size: 0.92rem;
  line-height: 1.2;

  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(11, 79, 102, 0.14);
  box-shadow: 0 8px 18px rgba(11, 79, 102, 0.08);

  /* keep your inline style color but ensure consistent look */
  color: var(--ahda-text-gray) !important;
}

/* Icon: keep it, but make it subtle and clean */
.impact-stat .stat-icon{
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: linear-gradient(135deg, var(--ahda-teal), var(--ahda-green));
  color: var(--ahda-white);

  opacity: 0.9;
  box-shadow: 0 6px 16px rgba(11, 79, 102, 0.18);
  transition: transform .25s ease, opacity .25s ease;
}

.impact-stat:hover .stat-icon{
  transform: rotate(10deg) scale(1.05);
  opacity: 1;
}

/* Corner accent: keep it but soften it to match screenshot */
.impact-stat .corner-accent{
  position: absolute;
  top: 0;
  right: 0;
  width: 52px;
  height: 52px;
  border-radius: 0 22px 0 52px;
  background: linear-gradient(135deg, transparent 52%, rgba(245,123,44,0.95) 52%);
  opacity: .55;
}
/* =======================
   MOBILE IMPROVEMENTS - 2 CARDS PER LINE
   ======================= */
@media (max-width: 768px){
  .impact-section-background{
    padding-top: 38px !important;
    padding-bottom: 38px !important;
  }

  .impact-title-wrap h2{ font-size: 1.95rem; }
  .impact-subtitle{ font-size: 0.95rem; }

  /* ===== FIX: MAKE EXACTLY 2 CARDS PER LINE ===== */
  .row.g-4 {
    display: flex;
    flex-wrap: wrap;
    margin-left: -8px !important;
    margin-right: -8px !important;
    row-gap: 16px !important;
  }
  
  .col-md-3.col-sm-6 {
    flex: 0 0 50% !important; /* Force 2 columns */
    width: 50% !important;
    max-width: 50% !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  .impact-stat{
    min-height: 165px;
    padding: 22px 14px 20px;
    border-radius: 18px;
    width: 100%; /* Take full width of parent */
  }

  .impact-stat::before{
    left: 12px;
    right: 12px;
  }

  .impact-stat .number{
    font-size: 2rem;
    margin-bottom: 14px;
  }

  .impact-stat p{
    font-size: 0.85rem;
    padding: 9px 12px;
    white-space: nowrap; /* Prevent text wrapping */
  }

  .impact-stat .stat-icon{
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    font-size: 0.95rem;
  }

  .impact-stat .corner-accent{
    width: 46px;
    height: 46px;
    border-radius: 0 18px 0 46px;
  }
}

/* Small phones - STILL 2 CARDS PER LINE */
@media (max-width: 480px){
  .impact-title-wrap h2{ font-size: 1.75rem; }
  
  .col-md-3.col-sm-6 {
    flex: 0 0 50% !important; /* Still 2 columns */
    width: 50% !important;
    max-width: 50% !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
  }
  
  .row.g-4 {
    margin-left: -6px !important;
    margin-right: -6px !important;
    row-gap: 12px !important;
  }

  .impact-stat{
    min-height: 155px;
    padding: 18px 10px 16px;
  }

  .impact-stat .number{
    font-size: 1.85rem;
    margin-bottom: 12px;
  }
  
  .impact-stat p {
    font-size: 0.75rem;
    padding: 7px 8px;
  }
}

/* Tiny phones - STILL 2 CARDS PER LINE */
@media (max-width: 360px){
  .col-md-3.col-sm-6 {
    padding-left: 4px !important;
    padding-right: 4px !important;
  }
  
  .row.g-4 {
    margin-left: -4px !important;
    margin-right: -4px !important;
    row-gap: 8px !important;
  }
  
  .impact-stat {
    min-height: 140px;
    padding: 16px 8px 14px;
  }
  
  .impact-stat .number {
    font-size: 1.6rem;
    margin-bottom: 10px;
  }
  
  .impact-stat p {
    font-size: 0.7rem;
    padding: 6px 6px;
  }
  
  .impact-stat .stat-icon {
    width: 24px;
    height: 24px;
    top: 8px;
    right: 8px;
  }
}