.programs-page {
  padding: 20px 0 72px;
  background: transparent;
}

.programs-page__container {
  width: 920px;
  max-width: none;
  margin: 0 auto;
  padding: 28px;
  background: #f8f9fb;
  border-radius: 28px;
  box-sizing: border-box;
}

.programs-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.programs-tabs__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  background: #ffffff;
  color: #006adb;
  text-decoration: none;
  font-family: Inter, Arial, sans-serif;
  font-size: 18px;
  line-height: 1;
  font-weight: 400;
  transition: background .25s ease, color .25s ease, box-shadow .25s ease;
}

.programs-tabs__item:hover,
.programs-tabs__item.is-active {
  background: #008de9;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(0, 141, 233, .16);
}

/* POPUP */
.program-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.program-modal.is-open {
  display: block;
}

.program-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(18, 27, 46, 0.24);
  backdrop-filter: blur(2px);
}

.program-modal__dialog {
  position: relative;
  width: min(980px, calc(100% - 40px));
  max-height: calc(100vh - 40px);
  margin: 20px auto;
  background: #ffffff;
  border-radius: 28px;
  overflow: auto;
  z-index: 2;
  padding: 26px 26px 30px;
  box-sizing: border-box;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.12);
}

.program-modal__close {
  position: sticky;
  top: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: #f4f6fa;
  color: #1a1a1a;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
}

.program-modal__content {
  margin-top: 10px;
}

.program-modal__loading,
.program-modal__error {
  background: #f8f9fb;
  border-radius: 18px;
  padding: 24px;
  font-family: Inter, Arial, sans-serif;
  font-size: 18px;
  line-height: 1.4;
  color: #1a1a1a;
}

/* ВАЖНО: стили detail внутри popup */
.program-modal .program-detail__back {
  display: none;
}

.program-modal .program-detail__title {
  margin: 0 0 24px;
  font-family: Inter, Arial, sans-serif;
  font-size: 36px;
  line-height: 1.02;
  font-weight: 600;
  color: #1a1a1a;
  max-width: 760px;
}

.program-modal .program-detail__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.program-modal .program-detail__item {
  background: #f8f9fb;
  border-radius: 16px;
  padding: 16px 18px;
  min-height: auto;
  box-sizing: border-box;
}

.program-modal .program-detail__item-label {
  font-family: Inter, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 500;
  color: #7a89ad;
  margin-bottom: 8px;
}

.program-modal .program-detail__item-value {
  font-family: Inter, Arial, sans-serif;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 400;
  color: #1a1a1a;
}

.program-modal .program-detail__block {
  margin-bottom: 20px;
}

.program-modal .program-detail__subtitle {
  margin: 0 0 12px;
  font-family: Inter, Arial, sans-serif;
  font-size: 24px;
  line-height: 1.05;
  font-weight: 600;
  color: #1a1a1a;
}

.program-modal .program-detail__text {
  background: #f8f9fb;
  border-radius: 16px;
  padding: 20px 22px;
  font-family: Inter, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  color: #1a1a1a;
}

.program-modal .program-detail__docs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.program-modal .program-detail__doc {
  display: inline-flex;
  align-items: center;
  min-height: 50px;
  padding: 0 16px;
  border-radius: 12px;
  background: #f8f9fb;
  color: #008de9;
  text-decoration: none;
  font-family: Inter, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.3;
}

.program-modal .program-detail__doc:hover {
  text-decoration: underline;
}

@media (max-width: 1180px) {
  .programs-page__container {
    max-width: calc(100% - 32px);
    padding: 22px;
  }
}

@media (max-width: 767px) {
  .programs-page {
    padding: 12px 0 52px;
  }

  .programs-page__container {
    max-width: calc(100% - 24px);
    padding: 16px;
    border-radius: 20px;
  }

  .programs-tabs {
    gap: 10px;
    margin-bottom: 20px;
  }

  .programs-tabs__item {
    min-height: 42px;
    padding: 0 16px;
    font-size: 15px;
  }

  .program-modal__dialog {
    width: calc(100% - 16px);
    max-height: calc(100vh - 16px);
    margin: 8px auto;
    padding: 16px 16px 20px;
    border-radius: 20px;
  }

  .program-modal__close {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }

  .program-modal .program-detail__title {
    font-size: 28px;
    margin-bottom: 18px;
  }

  .program-modal .program-detail__grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 18px;
  }

  .program-modal .program-detail__item-value {
    font-size: 17px;
  }

  .program-modal .program-detail__subtitle {
    font-size: 22px;
  }

  .program-modal .program-detail__text {
    font-size: 16px;
    padding: 16px 18px;
  }
}