.legal-page {
  background: #f5f7fa;
  padding: 36px 0 64px;
}

.legal-document {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
  color: #1f2a37;
}

.legal-shell {
  background: #ffffff;
  border: 1px solid #dfe7ef;
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(31, 42, 55, 0.08);
  overflow: hidden;
}

.legal-hero {
  position: relative;
  padding: 34px 40px 30px;
  background: linear-gradient(135deg, #ffffff 0%, #f7fbff 64%, #eef6ff 100%);
  border-bottom: 1px solid #e5edf5;
}

.legal-kicker {
  margin-bottom: 8px;
  color: #0d6fae;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.legal-title {
  margin: 0;
  color: #172536;
  font-size: 30px;
  line-height: 1.28;
  font-weight: 700;
  letter-spacing: 0;
}

.legal-subtitle {
  margin: 10px 0 0;
  color: #5f6d7a;
  font-size: 15px;
  line-height: 1.8;
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  color: #516171;
  font-size: 13px;
}

.legal-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 11px;
  background: #ffffff;
  border: 1px solid #d9e5ef;
  border-radius: 4px;
}

.legal-toolbar {
  position: absolute;
  top: 26px;
  right: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0;
  background: transparent;
  border: 0;
}

.legal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.legal-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.72);
  color: #4d6478;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
}

.legal-action:hover,
.legal-action:focus {
  border-color: #8db8d8;
  color: #0b6fb6;
  text-decoration: none;
}

.legal-action--primary {
  border-color: #c9d8e6;
  background: #ffffff;
  color: #2d5f85;
  box-shadow: none;
}

.legal-action--primary:hover,
.legal-action--primary:focus {
  border-color: #8db8d8;
  background: #ffffff;
  color: #0b6fb6;
}

.legal-body {
  padding: 36px 40px 44px;
}

.legal-language {
  scroll-margin-top: 24px;
}

.legal-notice {
  margin-bottom: 32px;
  padding: 18px 20px;
  border: 1px solid #f0d8a8;
  border-left: 5px solid #d99a1e;
  border-radius: 6px;
  background: #fffaf0;
  color: #65430d;
  font-size: 14px;
  line-height: 1.8;
}

.legal-section {
  margin-top: 34px;
  padding-top: 30px;
  border-top: 1px solid #e7edf3;
}

.legal-section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.legal-section h2 {
  margin: 0 0 16px;
  color: #172536;
  font-size: 20px;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: 0;
}

.legal-section h3 {
  margin: 24px 0 10px;
  color: #243447;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: 0;
}

.legal-section p,
.legal-section li {
  color: #3d4c5c;
  font-size: 14px;
  line-height: 1.9;
}

.legal-section p {
  margin: 0 0 12px;
}

.legal-section ul,
.legal-section ol {
  margin: 0 0 14px 20px;
  padding: 0;
}

.legal-section strong {
  color: #172536;
  font-weight: 700;
}

.legal-table-wrap {
  width: 100%;
  margin: 16px 0 20px;
  overflow-x: auto;
  border: 1px solid #dfe7ef;
  border-radius: 6px;
  background: #ffffff;
  -webkit-overflow-scrolling: touch;
}

.legal-table-wrap:focus-visible {
  outline: 3px solid rgba(11, 111, 182, 0.2);
  outline-offset: 2px;
}

.legal-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  table-layout: fixed;
}

.legal-table--services {
  min-width: 680px;
}

.legal-table th,
.legal-table td {
  padding: 13px 14px;
  border-right: 1px solid #e5ebf1;
  border-bottom: 1px solid #e5ebf1;
  color: #3d4c5c;
  font-size: 13px;
  line-height: 1.7;
  text-align: left;
  vertical-align: top;
}

.legal-table th {
  background: #f3f7fa;
  color: #243447;
  font-weight: 700;
}

.legal-table th:last-child,
.legal-table td:last-child {
  border-right: 0;
}

.legal-table tbody tr:last-child td {
  border-bottom: 0;
}

.legal-language-divider {
  height: 1px;
  margin: 52px 0 44px;
  background: #d8e2eb;
}

.legal-language-note {
  margin: 28px 0 0;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid #e3ebf3;
  border-radius: 6px;
  color: #5b6978;
  font-size: 13px;
  line-height: 1.8;
}

@media (max-width: 768px) {
  .legal-page {
    padding: 22px 0 42px;
  }

  .legal-document {
    padding: 0 14px;
  }

  .legal-hero,
  .legal-body {
    padding-left: 20px;
    padding-right: 20px;
  }

  .legal-title {
    font-size: 23px;
  }

  .legal-meta {
    display: block;
  }

  .legal-meta span {
    display: flex;
    margin-top: 8px;
  }

  .legal-toolbar {
    position: static;
    justify-content: flex-start;
    align-items: stretch;
    margin-top: 18px;
  }

  .legal-actions {
    width: 100%;
    flex-wrap: wrap;
    align-items: center;
  }

  .legal-action {
    width: auto;
  }

  .legal-table {
    min-width: 660px;
  }

  .legal-language-divider {
    margin: 42px 0 36px;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 18mm 16mm;
  }

  html,
  body {
    width: auto;
    min-width: 0;
    background: #ffffff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .navbar,
  .tr-header,
  .footer,
  .tr-footer,
  .coupon,
  .back-to-top,
  .legal-toolbar {
    display: none !important;
  }

  .legal-page {
    padding: 0;
    background: #ffffff;
  }

  .legal-document {
    max-width: none;
    padding: 0;
  }

  .legal-shell {
    border: 0;
    box-shadow: none;
    overflow: visible;
  }

  .legal-hero {
    padding: 0 0 10mm !important;
    background: #ffffff !important;
    border-bottom: 1px solid #dfe7ef;
  }

  .legal-body {
    padding: 10mm 0 0 !important;
    background: #ffffff;
  }

  .legal-notice,
  .legal-language-note,
  .legal-table-wrap {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .legal-table-wrap {
    overflow: visible;
  }

  .legal-table {
    min-width: 0;
  }

  .legal-section {
    margin-top: 8mm;
    padding-top: 7mm;
    break-inside: auto;
    page-break-inside: auto;
  }

  .legal-section h2,
  .legal-section h3 {
    break-after: avoid;
    page-break-after: avoid;
  }

  .legal-section p,
  .legal-section li {
    orphans: 3;
    widows: 3;
  }

  .legal-document a[href]::after {
    content: "" !important;
  }
}
