/* Основная секция */
.exam-section {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Сетка карточек */
.exam-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  justify-items: center;
}

/* Базовые стили для карточек */
.exam-card,
.modal-join-link {
  background: #fff;
  border-radius: 1.35rem;
  box-shadow: 0 2px 16px rgba(55, 185, 195, 0.09);
  border: 1px solid #d5f9f6;
  padding: 1.5rem;
  width: 100%;
  max-width: 300px;
  height: 280px;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  color: #217895;
  cursor: pointer;
  transition: box-shadow 0.18s, transform 0.11s;
  box-sizing: border-box;
  overflow: hidden;
  justify-content: flex-start;
}

.exam-card:hover,
.modal-join-link:hover {
  box-shadow: 0 6px 36px rgba(40, 220, 200, 0.10);
  transform: translateY(-2px) scale(1.0112);
}

/* Карточки без ссылок */
.exam-card:not(a) {
  cursor: default;
}

/* Иконки карточек */
.exam-card-icon,
.modal-join-link .exam-card-icon {
  font-size: 4.4rem;
  line-height: 1;
  user-select: none;
  width: 4.4rem;
  height: 4.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.exam-card-icon img,
.modal-join-link .exam-card-icon img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* Заголовки карточек */
.exam-card h3,
.modal-join-link h3 {
  margin: 0;
  font-weight: 600;
  font-size: 1.3rem;
}

/* Описания карточек */
.exam-card p,
.modal-join-link p {
  font-size: 1rem;
  text-align: center;
  color: #4a7277;
  margin: 0.1rem 0 0 0;
}

/* Секция сервисов */
.exam-services-section {
  margin-top: 2.5rem;
}

.exam-services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  justify-items: center;
}

.exam-services-grid .exam-card {
  max-width: 300px;
  aspect-ratio: 1 / 1;
}

/* ========================================
   МЕДИА-ЗАПРОСЫ
   ======================================== */

/* Планшеты и меньше (1100px) */
@media (max-width: 1100px) {
  .exam-grid,
  .exam-services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
  }

  .exam-card,
  .modal-join-link {
    max-width: 320px;
  }
}

/* Средние планшеты (900px) */
@media (max-width: 900px) {
  .exam-grid,
  .exam-services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .exam-card,
  .modal-join-link {
    max-width: 280px;
    height: auto;
    padding: 1.2rem;
  }

  .exam-card h3,
  .modal-join-link h3 {
    font-size: 1.2rem;
  }
}

/* Мобильные устройства (768px) */
@media (max-width: 768px) {
  .exam-grid,
  .exam-services-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .exam-card,
  .modal-join-link {
    max-width: 90vw;
    height: auto;
    aspect-ratio: auto;
  }
}

/* Малые мобильные (400px) */
@media (max-width: 400px) {
  .exam-card,
  .modal-join-link {
    padding: 1rem;
  }

  .exam-card h3,
  .modal-join-link h3 {
    font-size: 1.1rem;
  }

  .exam-card p,
  .modal-join-link p {
    font-size: 0.9rem;
  }

  .exam-card-icon,
  .modal-join-link .exam-card-icon {
    width: 3.8rem;
    height: 3.8rem;
    font-size: 3.8rem;
  }
}
