:root {
  --page-bg: #f3f4f6;
  --panel-bg: #ffffff;
  --text-main: #25364a;
  --text-soft: #5d7186;
  --line: #d7dde5;
  --line-soft: #e5ebf1;
  --accent: #0f7f73;
  --accent-dark: #0b5e56;
  --blue: #2f6fe6;
  --radius-lg: 14px;
  --radius-md: 10px;
  --shadow-soft: 0 8px 18px rgba(15, 23, 42, 0.04);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--page-bg);
  color: var(--text-main);
}

body {
  padding: 14px 18px 18px;
}

.page {
  max-width: 1140px;
  margin: 0 auto;
}

.title {
  margin: 0;
  font-size: 32px;
  line-height: 1.08;
  font-weight: 400;
  color: #17324d;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 14px 0 20px;
  font-size: 18px;
  color: #243b53;
}

.layout {
  display: grid;
  grid-template-columns: 385px 1fr;
  gap: 24px;
  align-items: start;
}

.left-col,
.right-col {
  min-width: 0;
}

.left-col {
  display: flex;
  flex-direction: column;
}

.section-panel {
  border: 1px solid #cfd7df;
  background: #f7f8fa;
  border-radius: 12px;
  padding: 13px 14px 14px;
  box-shadow: var(--shadow-soft);
}

.section-panel-title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: #4a4a4a;
}

.sections-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.section-item {
  display: block;
  width: 100%;
  border: 1px solid #b8bcc1;
  border-right: 3px solid #909090;
  border-bottom: 3px solid #909090;
  background: #fbfbfb;
  padding: 9px 12px;
  color: #4a4a4a;
  font: 700 16px/1.12 "Arial Narrow", Arial, Helvetica, sans-serif;
  text-align: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 #fff;
  transition: background .15s ease, color .15s ease, transform .12s ease;
}

.section-item:hover {
  background: #ffffff;
  color: #223548;
  transform: translateY(-1px);
}

.section-item.is-disabled {
  cursor: default;
  opacity: 0.8;
}

.section-code,
.section-title {
  white-space: nowrap;
}

.action-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px auto 0;
  max-width: 180px;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 13px;
  padding: 11px 15px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
  text-align: center;
  text-decoration: none;
  display: inline-block;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-dark);
}

.btn-secondary {
  background: #ffffff;
  color: #17324d;
  border-color: #cfd8e3;
}

.btn-secondary:hover {
  background: #f7fafc;
  border-color: #b8c5d3;
}

.btn-link {
  background: transparent;
  color: #66788a;
  border: 1px solid #d6dee6;
  font-weight: 400;
}

.btn-link:hover {
  background: #f8fbfd;
  color: #20384f;
}

.program-card {
  margin-top: 10px;
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px 12px;
  box-shadow: var(--shadow-soft);
}

.program-card-logo-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  width: 100%;
  margin-bottom: 2px;
}

.program-card-logo {
  width: 46px;
  height: auto;
  display: block;
}

.program-card-textbox {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: #2d3640;
  font-family: "Arial Narrow", Arial, Helvetica, sans-serif;
  gap: 2px;
}

.program-card-line {
  line-height: 1.12;
}

.program-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #111;
  margin-top: 0;
}

.program-card-title span {
  font-weight: 400;
}

.program-card-subtitle-line {
  color: #555;
  font-size: 12px;
  line-height: 1.15;
}

.program-card-dev {
  font-size: 12px;
  margin-top: 6px;
  line-height: 1.12;
}

.program-card-company {
  font-size: 12px;
  letter-spacing: 0;
  line-height: 1.12;
}

.program-card-link {
  color: #2d43d2;
  text-decoration: none;
  font-size: 11px;
  line-height: 1.12;
}

.program-card-link:hover {
  text-decoration: underline;
}

.program-card-rights {
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: 0;
  line-height: 1.12;
}

.content-box {
  min-height: 0;
  background: #ffffff;
  border: 1px solid #d6e0ea;
  border-left: 5px solid var(--blue);
  border-radius: 14px;
  padding: 18px 24px;
  box-shadow: var(--shadow-soft);
}

.content-box h2 {
  margin: 0 0 14px;
  font-size: 20px;
  color: #17324d;
}

.content-box h3 {
  margin: 18px 0 10px;
  font-size: 16px;
  color: #17324d;
}

.content-box p,
.content-box li {
  color: #4b6074;
  font-size: 16px;
  line-height: 1.5;
}

.content-box p {
  margin: 0 0 12px;
}

.content-box ul {
  margin: 0 0 16px 22px;
  padding: 0;
}

.content-note {
  margin-top: 14px;
  border: 1px solid #d9e2ec;
  background: #fbfcfd;
  border-radius: 10px;
  padding: 14px 16px;
}

.content-note .btn {
  margin-top: 8px;
}

.hidden-input {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.34);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal-backdrop.is-open {
  display: flex;
}

.modal {
  width: min(540px, 100%);
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #d7dde5;
  overflow: auto;
  box-shadow: 0 20px 35px rgba(15, 23, 42, 0.18);
}

.modal-header {
    flex: 0 0 auto;
}
.modal-footer {
    border-bottom: 0;
    border-top: 1px solid #e7ebf0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;

    flex: 0 0 auto; /* фиксируем footer */
}
.modal-title {
  margin: 0;
  font-size: 20px;
  color: #17324d;
}

.modal-body {
  padding: 18px;
  color: #334e68;
}

.section-info-name {
  font-size: 20px;
  font-weight: 700;
  color: #17324d;
  margin-bottom: 12px;
}

.section-info-text {
  font-size: 15px;
  line-height: 1.55;
}

.section-info-list {
  margin: 10px 0 0 18px;
  padding: 0;
}

.section-info-list li {
  margin-bottom: 6px;
}

.purchase-list {
  margin: 0;
  padding-left: 18px;
}

.purchase-list li {
  margin-bottom: 8px;
}

.purchase-contact {
  margin-top: 14px;
  padding: 12px;
  background: #f3f7fb;
  border: 1px solid #d8e2ee;
  border-radius: 8px;
}

.purchase-contact strong {
  color: #0b2440;
}

@media (max-width: 980px) {
  body {
    padding: 14px 12px 18px;
  }

  .page {
    max-width: 760px;
  }

  .layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .title {
    font-size: 30px;
  }

  .subtitle {
    margin: 10px 0 16px;
    font-size: 16px;
  }

  .action-stack {
    max-width: none;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .action-stack .btn {
    width: 100%;
  }

  .action-stack .btn-link {
    grid-column: 1 / -1;
  }

  .program-card {
    margin-top: 12px;
  }

  .content-box {
    padding: 16px 18px;
  }
}

@media (max-width: 560px) {
  body {
    padding: 12px 10px 16px;
  }

  .title {
    font-size: 28px;
  }

  .subtitle {
    font-size: 15px;
  }

  .section-panel {
    padding: 12px;
  }

  .section-item {
    padding: 10px 8px;
    font-size: 15px;
    white-space: normal;
  }

  .section-code,
  .section-title {
    white-space: normal;
  }

  .action-stack {
    grid-template-columns: 1fr;
  }

  .content-box {
    padding: 15px 14px;
  }

  .content-box h2 {
    font-size: 19px;
  }

  .content-box p,
  .content-box li {
    font-size: 15px;
    line-height: 1.45;
  }

  .program-card {
    padding: 10px;
  }

  .program-card-logo {
    width: 42px;
  }

  .modal-backdrop {
    padding: 12px;
    align-items: flex-start;
  }

  .modal {
    width: 100%;
    margin-top: 20px;
  }

  .modal-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .modal-footer .btn {
    width: 100%;
  }
}
.modal.wide-modal {
    width: min(900px, calc(100vw - 48px));
    max-width: 900px;
    max-height: calc(100vh - 48px);
}

.modal.wide-modal .modal-body {
    flex: 1 1 auto;
    overflow-y: auto;   /* ← вертикальный скролл */
    overflow-x: hidden;
    padding: 18px 20px;
}
.info-modal-content {
    max-width: 760px;
    margin: 0 auto;
}

.info-modal-content p {
    line-height: 1.6;
}

.info-modal-content ul {
    padding-left: 18px;
}
/* модалка шире + больше отступов от краёв экрана */
.modal.wide-modal {
    width: min(900px, calc(100vw - 80px));
    max-height: calc(100vh - 80px);
    margin: 40px auto;
    border-radius: 10px;
}

/* тело — больше воздуха */
.modal.wide-modal .modal-body {
    max-height: calc(100vh - 180px);
    overflow: auto;
    padding: 26px 32px;
}

/* контент — читаемый */
.info-modal-content {
    max-width: 760px;
    margin: 0 auto;
    font-size: 14px;
    line-height: 1.65;
    color: #1f2937;
}

/* заголовки — больше воздуха */
.info-modal-content h4 {
    margin: 18px 0 8px;
    font-size: 15px;
    font-weight: 700;
    color: #0b2440;
}

/* абзацы */
.info-modal-content p {
    margin: 0 0 12px;
}

/* списки */
.info-modal-content ul {
    margin: 8px 0 14px;
    padding-left: 22px;
}

.info-modal-content li {
    margin-bottom: 6px;
}

/* header */
.modal-header-with-close {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px 12px;
}

/* крестик */
.modal-close-btn {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
    padding: 6px 10px;
}

.modal-close-btn:hover {
    color: #0b2440;
}
