/* === Секция «Стоимость» === */
.pricing {
  padding: 5rem 0;
  background: #ffffff;
}

.pricing-header {
  text-align: left;
  margin-bottom: 3rem;
  max-width: 720px;
}

.pricing-header .section-title {
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
  color: var(--fg);
}

.pricing-header .section-underline {
  height: 4px;
  width: 64px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), #2a9d8f, #e63946, #8a5df5);
  opacity: 0.85;
  margin-top: 0.5rem;
}

/* === Сетка — ровно 4 на десктопе, адаптивно === */
.pricing-plans {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  justify-content: center;
  margin-bottom: 3rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* === Базовая карточка === */
.plan {
  background: #fff;
  border: 1px solid #e8ecf1;
  border-radius: 16px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  min-height: 220px;
  transition: all 0.25s ease;
}

/* === Акцентный (наиболее выгодный) блок === */
.plan.is-best {
  background: linear-gradient(135deg, #3a8bff 0%, #7a2fff 100%);
  border: none;
  border-radius: 18px;
  padding: 1.75rem;
  color: white;
  box-shadow: 0 8px 24px rgba(94, 114, 228, 0.25);
}

/* === Бесконечная золотая пробежка — медленная, как дыхание === */
@keyframes gold-sweep {
  0% {
    background-position: -120% 0;
    opacity: 0.15;
  }
  50% {
    opacity: 0.32;
  }
  100% {
    background-position: 120% 0;
    opacity: 0.15;
  }
}

.plan.is-best {
  position: relative;
  overflow: hidden;
}

.plan.is-best::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    110deg,
    transparent,
    transparent 40%,
    rgba(255, 215, 0, 0.16) 48%,
    rgba(255, 215, 0, 0.36) 50%,
    rgba(255, 215, 0, 0.16) 52%,
    transparent 60%,
    transparent
  );
  background-size: 240% 100%;
  background-position: -120% 0;
  opacity: 0.15;
  pointer-events: none;
  z-index: 1;
  border-radius: 18px;
  /* 🔁 Бесконечная медленная анимация */
  animation: gold-sweep 8s cubic-bezier(0.22, 0.8, 0.28, 1) infinite;
}
.plan.is-best.appear::before {
  animation: gold-sweep 8s cubic-bezier(0.22, 0.8, 0.28, 1) 0.3s 1,
              gold-sweep 8s cubic-bezier(0.22, 0.8, 0.28, 1) 4s infinite;
}

/* Внутри is-best — всё белое */
.plan.is-best .plan-lessons,
.plan.is-best .plan-lessons-label,
.plan.is-best .plan-price {
  color: white;
}

/* Верх: уроки + бейдж */
.plan-top {
  display: flex;
  align-items: baseline;
  gap: 0.375rem;
  flex-wrap: nowrap;
}

.plan-lessons {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  margin: 0;
}

.plan-lessons-label {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-light);
  line-height: 1;
  align-self: flex-end;
  margin-bottom: 0.125rem;
}

.plan.is-best .plan-lessons-label {
  color: rgba(255, 255, 255, 0.85);
}

/* Бейдж — красный по умолчанию, жёлтый в is-best */
.plan-badge {
  margin-left: auto;
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.3rem 0.8rem;
  border-radius: 16px;
  background: rgba(230, 57, 70, 0.12);
  color: #e63946;
  white-space: nowrap;
  align-self: flex-start;
}

.plan.is-best .plan-badge {
  background: #FFD700;
  color: #1a1c20;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* Цена */
.plan-price {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.1;
  margin: 0.75rem 0 0;
  white-space: nowrap;
}

.plan-price::after {
  content: "₽";
  display: inline-block;
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text-light);
  margin-left: 0.25rem;
}

.plan.is-best .plan-price::after {
  color: rgba(255, 255, 255, 0.85);
}

/* === Адаптив === */
@media (max-width: 1199px) and (min-width: 769px) {
  .pricing-plans {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .pricing-plans {
    grid-template-columns: 1fr;
  }

  .plan {
    padding: 1.75rem;
    min-height: 200px;
  }

  .plan-lessons {
    font-size: 1.75rem;
  }

  .plan-price {
    font-size: 2rem;
  }
}
