* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #0f1117;
  color: white;
  font-family: Arial, sans-serif;
  padding: 40px 20px;
}

.formations {
  max-width: 1200px;
  margin: 0 auto;
}

.formations h2 {
  text-align: center;
  font-size: 32px;
  margin-bottom: 30px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 35px;
}

.filter-btn {
  background: #1a1d26;
  color: white;
  border: 1px solid #2b3140;
  border-radius: 25px;
  padding: 10px 18px;
  cursor: pointer;
  font-size: 14px;
  transition: 0.25s ease;
}

.filter-btn:hover {
  background: #252a36;
}

.filter-btn.active {
  background: #2f6fed;
  border-color: #2f6fed;
}

.formations-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 25px;
}

.formation-card {
  background: #1a1d26;
  border: 1px solid #2b3140;
  border-radius: 16px;
  padding: 18px;
  text-align: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.formation-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.image-box {
  width: 100%;
  height: 180px;
  border-radius: 12px;
  overflow: hidden;
  background: #11141b;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
  cursor: pointer;
}

.image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.formation-card h3 {
  font-size: 18px;
  line-height: 1.4;
  min-height: 50px;
}

.image-viewer {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 30px;
  z-index: 1000;
}

.image-viewer.active {
  display: flex;
}

.image-viewer img {
  max-width: 92vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.45);
}

.close-viewer {
  position: absolute;
  top: 18px;
  right: 24px;
  background: transparent;
  border: none;
  color: white;
  font-size: 42px;
  cursor: pointer;
  line-height: 1;
}

@media (max-width: 1000px) {
  .formations-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .formations-grid {
    grid-template-columns: 1fr;
  }

  .formations h2 {
    font-size: 26px;
  }

  .filter-btn {
    font-size: 13px;
    padding: 9px 14px;
  }
}