/* Юридические документы: политика конфиденциальности и согласие на обработку */

body {
  line-height: 1.7;
  padding: 2rem 1rem;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding: 3rem 4rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .container {
    padding: 2rem 1.75rem;
  }
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  color: var(--primary);
  font-weight: 500;
}

.back-link__icon {
  width: 1.25em;
  height: 1.25em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.15s ease;
}

.back-link:hover .back-link__icon { transform: translateX(-2px); }

@media (prefers-reduced-motion: reduce) {
  .back-link__icon { transition: none; }
  .back-link:hover .back-link__icon { transform: none; }
}

/* Заголовок длинный, поэтому размер плавно уменьшается на узких экранах */
h1 {
  font-size: clamp(1.25rem, 1rem + 1.2vw, 1.75rem);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  color: var(--text);
}

.doc-date {
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 1rem;
}

h2 {
  font-size: 1.1rem;
  line-height: 1.4;
  letter-spacing: 0.02em;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--text);
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 0.4rem;
}

p {
  margin-bottom: 1rem;
}

ul,
ol {
  margin: 0 0 1.25rem 1.5rem;
}

/* Список сразу после вводного абзаца прижимаем ближе к нему */
p + ul {
  margin-top: -0.5rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Вложенные списки, если появятся */
li > ul,
li > ol {
  margin-top: 0.5rem;
  margin-bottom: 0;
}

strong {
  font-weight: 600;
}

.note {
  font-style: italic;
  color: var(--text-muted);
  margin-top: -0.5rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1rem;
  line-height: 1.4;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

/* ===== Публичная оферта ===== */

.doc-subtitle {
  margin-bottom: 1rem;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.doc-actions {
  margin-bottom: 1.5rem;
}

.doc-download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-sm);
  color: var(--text-inverse);
  background: var(--primary);
  font-weight: 500;
}

.doc-download:hover {
  color: var(--text-inverse);
  background: var(--primary-hover);
  text-decoration: none;
}

.doc-download__icon {
  flex: none;
  width: 1.25em;
  height: 1.25em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Содержание */
.doc-toc {
  margin: 1.5rem 0 2rem;
  padding: 1.25rem 1.5rem;
  background: var(--brand-50);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-sm);
}

.doc-toc__title {
  margin-bottom: 0.75rem;
  font-weight: 700;
  color: var(--heading);
}

.doc-toc__list {
  columns: 2;
  column-gap: 2rem;
  margin: 0;
  list-style: none;
}

.doc-toc__list li {
  margin-bottom: 0.4rem;
  break-inside: avoid;
}

@media (max-width: 900px) {
  .doc-toc__list { columns: 1; }
}

/* Формула расчёта */
.formula {
  display: block;
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--brand-50);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Реквизиты: термин и значение в две колонки */
.details {
  display: grid;
  grid-template-columns: minmax(8rem, 14rem) 1fr;
  margin: 0 0 1.25rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.details dt,
.details dd {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
}

.details dt {
  color: var(--text-muted);
  background: var(--brand-50);
  font-weight: 600;
}

.details dt:nth-last-of-type(1),
.details dd:last-of-type {
  border-bottom: 0;
}

@media (max-width: 640px) {
  .details { grid-template-columns: 1fr; }
  .details dt { padding-bottom: 0.2rem; border-bottom: 0; }
  .details dd { padding-top: 0.2rem; }
}

/* Таблицы тарифов */
.table-wrap {
  margin-bottom: 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.table {
  width: 100%;
  min-width: 30rem;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.4;
  overflow-wrap: normal;
}

.table caption {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 700;
  color: var(--heading);
  background: var(--surface);
  border-bottom: 1px solid var(--border-strong);
}

.table th,
.table td {
  padding: 0.7rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.table tbody tr:last-child > * {
  border-bottom: 0;
}

.table thead th {
  color: var(--text-inverse);
  background: var(--primary);
  font-weight: 600;
}

.table thead th:first-child,
.table tbody th {
  text-align: left;
}

.table tbody th {
  font-weight: 500;
  background: var(--brand-50);
}

.table__price {
  font-weight: 700;
  white-space: nowrap;
}

.table__yes { color: var(--success); font-weight: 700; }
.table__no { color: var(--text-muted); }

footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-strong);
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
}

/* Печать и экспорт в PDF */
@page {
  size: A4;
  margin: 18mm 17mm 19mm;
}

@media print {
  html,
  body {
    background: var(--surface);
  }

  body {
    display: block;
    min-height: 0;
    padding: 0;
    font-family: Arial, "Helvetica Neue", sans-serif;
    font-size: 10pt;
    line-height: 1.45;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .container {
    width: auto;
    max-width: none;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow-wrap: break-word;
  }

  .back-link,
  .doc-actions { display: none; }

  h1 {
    margin: 0 0 0.35rem;
    font-size: 22pt;
    line-height: 1.15;
    text-transform: none;
  }

  .doc-subtitle {
    margin-bottom: 0.5rem;
    font-size: 11pt;
  }

  .doc-date {
    margin-bottom: 1rem;
    padding-bottom: 0.55rem;
  }

  h2 {
    margin-top: 1.35rem;
    margin-bottom: 0.5rem;
    font-size: 12pt;
    line-height: 1.25;
    letter-spacing: 0;
  }

  h3 {
    margin-top: 1rem;
    margin-bottom: 0.4rem;
    font-size: 10.5pt;
  }

  p { margin-bottom: 0.65rem; }

  ul,
  ol { margin: 0 0 0.8rem 1.25rem; }

  li { margin-bottom: 0.3rem; }

  a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--border-strong);
  }

  .doc-toc {
    margin: 1rem 0 1.25rem;
    padding: 0.8rem 1rem;
    border-radius: 0;
  }

  .doc-toc__title { margin-bottom: 0.45rem; }

  .doc-toc__list {
    column-gap: 1.25rem;
    font-size: 9pt;
    line-height: 1.35;
  }

  .doc-toc__list li { margin-bottom: 0.25rem; }

  .formula {
    padding: 0.5rem 0.7rem;
    border-radius: 0;
  }

  .details {
    grid-template-columns: 10rem 1fr;
    break-inside: avoid;
  }

  .details dt,
  .details dd { padding: 0.4rem 0.65rem; }

  .table-wrap {
    overflow: visible;
    border-radius: 0;
  }

  .table {
    min-width: 0;
    font-size: 8.5pt;
    line-height: 1.3;
  }

  .table th,
  .table td { padding: 0.45rem 0.5rem; }

  .table thead { display: table-header-group; }
  .table tr { break-inside: avoid; }

  footer {
    margin-top: 1.5rem;
    padding-top: 0.75rem;
    font-size: 8.5pt;
  }

  p,
  li,
  dd { orphans: 3; widows: 3; }

  h2,
  h3 { break-after: avoid; }

  .details,
  .formula,
  .doc-toc { break-inside: avoid; }
}

@media (max-width: 640px) {
  body {
    padding: 1rem 0.5rem;
  }

  .container {
    padding: 1.75rem 1.25rem;
  }
}
