/* ==========================================================================
   STATS / TRUST NUMBERS SECTION
   Dark navy band with 4 stat columns (icon, animated count, label, divider,
   description), plus decorative square shapes in the top-left and
   bottom-right corners.
   ========================================================================== */

.stats-section {
  --stat-bg: #003389;
  --stat-bg-dark: #003389;
  --stat-icon-bg: rgba(255, 255, 255, 0.14);
  --stat-divider: rgba(255, 255, 255, 0.22);
  --stat-text-muted: rgba(255, 255, 255, 0.72);
  --stat-font-heading: var(--font-primary, "Poppins", "Segoe UI", sans-serif);
  --stat-font-body: var(--font-secondary, "Inter", "Segoe UI", sans-serif);

  position: relative;
  width: 100%;
  padding: 64px 5vw;
  background: linear-gradient(
    135deg,
    var(--stat-bg) 0%,
    var(--stat-bg-dark) 100%
  );
  font-family: var(--stat-font-body);
  overflow: hidden;
  isolation: isolate;
}

.stats-section * {
  box-sizing: border-box;
}

/* ---------- Decorative corner shapes ---------- */

.stats-shape {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  width: 90px;
  height: 90px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.09);
}

.stats-shape--top-left {
  top: 4px;
  left: 4px;
  animation: statsShapeFloatDown 6s ease-in-out infinite;
}

.stats-shape--bottom-right {
  bottom: 8px;
  right: 20px;
  animation: statsShapeFloatUp 6s ease-in-out infinite;
  animation-delay: 0.3s;
}

@keyframes statsShapeFloatDown {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(14px);
  }
}

@keyframes statsShapeFloatUp {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-14px);
  }
}

/* ---------- Container / grid ---------- */

.stats-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--container-width, 1320px);
  margin: 0 auto;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}

/* ---------- Stat item ---------- */

.stat-item {
  position: relative;
  padding: 8px 22px;
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.stats-section.is-in-view .stat-item {
  opacity: 1;
  transform: translateY(0);
}

.stats-section.is-in-view .stat-item:nth-child(1) {
  transition-delay: 0.05s;
}
.stats-section.is-in-view .stat-item:nth-child(2) {
  transition-delay: 0.15s;
}
.stats-section.is-in-view .stat-item:nth-child(3) {
  transition-delay: 0.25s;
}
.stats-section.is-in-view .stat-item:nth-child(4) {
  transition-delay: 0.35s;
}
.stats-section.is-in-view .stat-item:nth-child(5) {
  transition-delay: 0.45s;
}

.stat-item:not(:first-child)::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: rgba(255, 255, 255, 0.14);
}

.stat-item:first-child {
  padding-left: 0;
}

.stat-item:last-child {
  padding-right: 0;
}

.stat-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--stat-icon-bg);
  color: #ffffff;
  font-size: 1.25rem;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stat-item:hover .stat-icon {
  transform: scale(1.08) rotate(-4deg);
}

.stat-top-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.stat-heading {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stat-number {
  font-family: var(--stat-font-heading);
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.25;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.stat-number--text {
  font-size: 1.28rem;
}

.stat-label {
  display: block;
  font-family: var(--stat-font-body);
  font-weight: 400;
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--stat-text-muted);
}

.stat-divider {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--stat-divider);
  margin-bottom: 18px;
}

.stat-desc {
  font-family: var(--stat-font-body);
  font-size: 0.86rem;
  line-height: 1.65;
  color: var(--stat-text-muted);
  margin: 0;
  max-width: 30ch;
}

@media (prefers-reduced-motion: reduce) {
  .stat-item {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .stat-icon {
    transition: none !important;
  }
  .stats-shape--top-left,
  .stats-shape--bottom-right {
    animation: none !important;
  }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    row-gap: 40px;
  }
  .stat-item {
    padding: 8px 24px;
  }
  .stat-item::before {
    display: block;
  }
  .stat-item:nth-child(3n + 1) {
    padding-left: 0;
  }
  .stat-item:nth-child(3n + 1)::before {
    display: none;
  }
  .stat-item:nth-child(3n) {
    padding-right: 0;
  }
}

@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 40px;
  }
  .stat-item {
    padding: 8px 24px;
  }
  .stat-item::before {
    display: block;
  }
  .stat-item:nth-child(odd) {
    padding-left: 0;
  }
  .stat-item:nth-child(odd)::before {
    display: none;
  }
  .stat-item:nth-child(even) {
    padding-right: 0;
  }
  .stat-item:nth-child(even)::before {
    display: block;
  }
}

@media (max-width: 720px) {
  .stats-section {
    padding: 52px 6vw;
  }
  .stats-grid {
    grid-template-columns: 1fr;
    row-gap: 34px;
  }
  .stat-item {
    padding: 0 !important;
  }
  .stat-item::before {
    display: none !important;
  }
  .stat-number {
    font-size: 1.7rem;
  }
  .stat-desc {
    max-width: 42ch;
  }
}

@media (max-width: 380px) {
  .stats-shape--top-left {
    top: 14px;
    left: 14px;
    width: 56px;
    height: 56px;
  }
  .stats-shape--bottom-right {
    right: 16px;
    bottom: 16px;
    width: 56px;
    height: 56px;
  }
}
