.courses {
  padding: 36px var(--site-padding) 100px;
  background: #fff;
}

.courses__header {
  position: relative;
  max-width: 760px;
  margin: 0 auto 36px;
  text-align: center;
  animation: coursesHeaderIn 0.6s ease both;
}

.courses__title {
  color: #0d1b2e;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 800;
  line-height: 1.16;
}

.courses__modal {
  position: fixed;
  top: calc(var(--header-height) + 16px);
  left: 50%;
  z-index: 95;
  width: min(520px, calc(100vw - 40px));
  padding: 24px 28px;
  color: #24324a;
  background: #fff;
  border: 1px solid rgba(91, 196, 245, 0.26);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(13, 27, 46, 0.18);
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.courses__modal--visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.courses__modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(to right, #5BC4F5, #7B5CF5);
  border-radius: 8px 8px 0 0;
}

.courses__modal-title {
  margin-bottom: 8px;
  color: #0d1b2e;
  font-size: 19px;
  font-weight: 800;
}

.courses__modal-text {
  color: #4c5a70;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}

.courses__modal a {
  color: #0d1b2e;
  font-weight: 800;
  text-decoration: none;
}

.courses__modal a:hover {
  background: linear-gradient(to right, #5BC4F5, #7B5CF5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.courses__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.course-card {
  position: relative;
  min-height: 620px;
  padding: 34px 28px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(13, 27, 46, 0.06);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(13, 27, 46, 0.08);
  animation: courseCardIn 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.course-card:hover {
  border-color: rgba(91, 196, 245, 0.28);
  box-shadow: 0 16px 40px rgba(13, 27, 46, 0.12);
  transform: translateY(-4px);
}

.course-card::before {
  content: '';
  position: absolute;
  top: 144px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, #5BC4F5, #7B5CF5);
  transform: scaleX(0);
  transform-origin: left;
  animation: courseLineIn 0.6s ease 0.35s both;
}

.course-card__title {
  margin-bottom: 22px;
  color: #0d1b2e;
  font-size: clamp(21px, 1.6vw, 25px);
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}

.course-card__price {
  position: relative;
  z-index: 1;
  width: 116px;
  height: 116px;
  display: grid;
  place-items: center;
  margin-bottom: 34px;
  color: #fff;
  background: linear-gradient(135deg, #5BC4F5, #7B5CF5);
  border: 6px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(123, 92, 245, 0.16), 0 8px 24px rgba(13, 27, 46, 0.18);
  font-size: 28px;
  font-weight: 800;
  animation: pricePop 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.course-card:hover .course-card__price,
.course-card__price:hover {
  transform: scale(1.1);
  box-shadow: 0 0 0 2px rgba(123, 92, 245, 0.2), 0 14px 32px rgba(13, 27, 46, 0.22);
}

.course-card__list {
  width: min(100%, 285px);
  list-style: none;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  color: #2f3d54;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  text-align: left;
}

.course-card__list li {
  position: relative;
  min-height: 38px;
  padding: 9px 0 9px 32px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(13, 27, 46, 0.08);
  transition: color 0.25s ease, transform 0.25s ease;
}

.course-card__list li:hover {
  color: #0d1b2e;
  transform: translateX(4px);
}

.course-card__list li:last-child {
  border-bottom: none;
}

.course-card__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, rgba(91, 196, 245, 0.18), rgba(123, 92, 245, 0.18));
  border: 1px solid rgba(123, 92, 245, 0.28);
  border-radius: 50%;
  transform: translateY(-50%);
}

.course-card__list li::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 50%;
  width: 5px;
  height: 8px;
  border-right: 2px solid #7B5CF5;
  border-bottom: 2px solid #7B5CF5;
  transform: translateY(-58%) rotate(45deg);
}

.course-card:has(.course-card__list li:nth-child(9)) .course-card__list {
  font-size: 14px;
}

.course-card:has(.course-card__list li:nth-child(9)) .course-card__list li {
  min-height: 32px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.course-card__btn {
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 194px;
  min-height: 62px;
  margin-top: 40px;
  padding: 17px 38px;
  color: #fff;
  background: linear-gradient(to right, #5BC4F5, #7B5CF5, #5BC4F5);
  background-size: 200% 100%;
  background-position: left;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 800;
  font-family: inherit;
  text-decoration: none;
  transition: background-position 0.5s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.course-card__btn:hover {
  background-position: right;
  box-shadow: 0 10px 22px rgba(91, 196, 245, 0.24);
  transform: translateY(-2px);
}

.course-card:nth-child(1) { animation-delay: 0.08s; }
.course-card:nth-child(2) { animation-delay: 0.16s; }
.course-card:nth-child(3) { animation-delay: 0.24s; }
.course-card:nth-child(4) { animation-delay: 0.32s; }
.course-card:nth-child(5) { animation-delay: 0.4s; }
.course-card:nth-child(6) { animation-delay: 0.48s; }

.course-card:nth-child(1) .course-card__price { animation-delay: 0.22s; }
.course-card:nth-child(2) .course-card__price { animation-delay: 0.3s; }
.course-card:nth-child(3) .course-card__price { animation-delay: 0.38s; }
.course-card:nth-child(4) .course-card__price { animation-delay: 0.46s; }
.course-card:nth-child(5) .course-card__price { animation-delay: 0.54s; }
.course-card:nth-child(6) .course-card__price { animation-delay: 0.62s; }

@keyframes coursesHeaderIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes courseCardIn {
  from {
    opacity: 0;
    transform: translateY(34px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes courseLineIn {
  to {
    transform: scaleX(1);
  }
}

@keyframes pricePop {
  from {
    opacity: 0;
    transform: scale(0.72);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .courses__header,
  .course-card,
  .course-card::before,
  .course-card__price {
    animation: none;
  }

  .courses__modal,
  .course-card,
  .course-card__price,
  .course-card__list li,
  .course-card__btn {
    transition: none;
  }
}

@media (max-width: 1200px) {
  .courses__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .courses__modal {
    top: calc(var(--header-height) + 12px);
    width: calc(100vw - 40px);
    padding: 22px 20px;
  }

  .courses {
    padding-bottom: 72px;
  }

  .courses__grid {
    grid-template-columns: 1fr;
  }

  .course-card {
    min-height: 520px;
  }
}

@media (max-width: 480px) {
  .course-card {
    padding-inline: 22px;
  }

  .course-card__btn {
    width: 100%;
    min-width: 0;
  }
}
