.lessons-page {
  padding: 34px 0 64px;
}

.lessons-content {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 0 18px;
}

.lessons-section {
  position: relative;
  overflow: clip;
  padding: 38px 36px 34px;
  border-radius: 30px;
  background:
    radial-gradient(circle at top left, rgba(233, 247, 255, 0.95), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(243, 251, 255, 0.94) 100%);
  border: 1px solid rgba(83, 178, 233, 0.18);
  box-shadow: 0 22px 42px rgba(70, 145, 188, 0.12);
}

.lessons-section::after {
  content: "";
  position: absolute;
  right: -54px;
  bottom: -68px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(117, 203, 239, 0.14);
}

.lessons-lead {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto 24px;
  text-align: center;
}

.lessons-lead p {
  margin: 0;
  color: #45697d;
  font-size: clamp(17px, 1.8vw, 21px);
  line-height: 1.9;
  font-weight: 600;
}

.lessons-tabs {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 10px;
  margin-bottom: 28px;
}

.lessons-tab {
  display: inline-flex;
  position: relative;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 30px;
  overflow: hidden;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.04em;
  border: 1px solid rgba(255, 255, 255, 0.28);
  text-decoration: none;
  box-shadow:
    0 12px 20px rgba(70, 145, 188, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
  transform: translateY(0);
  animation: class-tab-float 4.8s ease-in-out infinite;
}

.lessons-tab::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 46%);
  pointer-events: none;
}

.lessons-tab::after {
  content: "";
  position: absolute;
  inset: -40% auto auto -18%;
  width: 44%;
  height: 180%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0));
  transform: rotate(18deg);
  opacity: 0.56;
  pointer-events: none;
}

.lesson-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 30px;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 18px rgba(70, 145, 188, 0.12);
}

.lessons-tab.pink,
.lesson-label.pink { background: linear-gradient(135deg, #ed9ad0 0%, #d96fb3 52%, #bf5399 100%); }
.lessons-tab.green,
.lesson-label.green { background: linear-gradient(135deg, #66cb63 0%, #3da43d 52%, #2f8731 100%); }
.lessons-tab.yellow,
.lesson-label.yellow { background: linear-gradient(135deg, #ffe277 0%, #e1bf33 52%, #c79e15 100%); color: #3f3400; }
.lessons-tab.blue,
.lesson-label.blue { background: linear-gradient(135deg, #7ed0ff 0%, #53b2e9 50%, #318fca 100%); }

.lessons-tab:nth-child(2n) {
  animation-delay: -2.4s;
}

.lessons-tab:nth-child(3n) {
  animation-duration: 5.6s;
}

.lessons-empty {
  margin: 0;
  padding: 48px 24px;

  color: #587583;
  background: #fff;
  border: 1px solid rgba(85, 176, 215, 0.22);
  border-radius: 18px;

  font-size: 17px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.04em;

  box-shadow: 0 12px 28px rgba(43, 124, 161, 0.08);
}

@keyframes class-tab-float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .lessons-tab {
    animation: none;
  }
}

.lesson-group {
  position: relative;
  z-index: 1;
  scroll-margin-top: 120px;
}

.lesson-group + .lesson-group {
  margin-top: 32px;
}

.lesson-label {
  margin-bottom: 16px;
}

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.lesson-grid--featured {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lesson-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 22px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(83, 178, 233, 0.14);
  box-shadow: 0 14px 30px rgba(70, 145, 188, 0.08);
}

.lesson-card--blue {
  border-color: rgba(83, 178, 233, 0.38);
  box-shadow: 0 14px 30px rgba(83, 178, 233, 0.12);
}

.lesson-card--green {
  border-color: rgba(61, 164, 61, 0.34);
  box-shadow: 0 14px 30px rgba(61, 164, 61, 0.1);
}

.lesson-card--yellow {
  border-color: rgba(225, 191, 51, 0.42);
  box-shadow: 0 14px 30px rgba(225, 191, 51, 0.11);
}

.lesson-card--pink {
  border-color: rgba(217, 111, 179, 0.36);
  box-shadow: 0 14px 30px rgba(217, 111, 179, 0.11);
}

.lesson-card h2 {
  margin: 0 0 14px;
  color: #53b2e9;
  font-size: clamp(21px, 2vw, 28px);
  line-height: 1.35;
  font-weight: 800;
}

.lesson-thumb {
  overflow: hidden;
  margin-bottom: 16px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(70, 145, 188, 0.1);
}

.lesson-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.lesson-card p {
  margin: 0;
  color: #345669;
  font-size: clamp(15px, 1.45vw, 17px);
  line-height: 1.9;
  font-weight: 500;
}

@media (max-width: 740px) {
  .lessons-page {
    padding: 24px 0 44px;
  }

  .lessons-content {
    padding: 0 12px;
  }

  .lessons-section {
    padding: 28px 18px 24px;
    border-radius: 24px;
  }

  .lessons-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 10px;
    margin-bottom: 22px;
  }

  .lessons-tab {
    width: 100%;
    min-width: 0;
    padding: 0 14px;
  }

  .lesson-grid,
  .lesson-grid--featured {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .lesson-card {
    padding: 18px;
    border-radius: 20px;
  }

  .lesson-card p {
    font-size: 15px;
    line-height: 1.8;
  }
}
