/* ═══════════════════════════════════════════
   legal-pages.css  —  Юридические страницы
   (Договор-оферта, Политика конфиденциальности)
   Dark theme, адаптивно, print-ready.
   ═══════════════════════════════════════════ */

/* === Layout === */
/* Override aidc-scroll flex layout: let body scroll normally */
[data-page="legal"] #app,
[data-page="legal"] #app > .shell,
[data-page="legal"] #app > .shell > main { overflow: visible !important; min-height: auto; }

.legal-page {
  min-height: 100vh;
  padding: 30px 0 60px;
}

.legal-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* === Breadcrumbs === */
.legal-breadcrumbs {
  padding: 12px 0 20px;
  font-size: 13px;
  color: #8a8ea8;
}
.legal-breadcrumbs a {
  color: #7b8cff;
  text-decoration: none;
}
.legal-breadcrumbs a:hover {
  text-decoration: underline;
  color: #a8b4ff;
}
.legal-breadcrumbs .sep {
  margin: 0 6px;
  opacity: .5;
}

/* === Header === */
.legal-header {
  text-align: center;
  padding: 32px 0 28px;
  margin-bottom: 32px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.legal-header h1 {
  font-size: 30px;
  font-weight: 700;
  color: #eaeaff;
  margin: 0 0 6px;
  letter-spacing: .03em;
}
.legal-header .legal-subtitle {
  font-size: 16px;
  color: #8a8ea8;
  margin: 0 0 18px;
}
.legal-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.legal-meta .legal-date {
  color: #8a8ea8;
  font-size: 13px;
}

/* === TOC === */
.legal-toc {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 36px;
}
.legal-toc h2 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 14px;
  color: #c8ccf0;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.legal-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  columns: 2;
  column-gap: 32px;
}
.legal-toc li {
  margin-bottom: 6px;
  break-inside: avoid;
}
.legal-toc a {
  color: #7b8cff;
  text-decoration: none;
  font-size: 14px;
  display: block;
  padding: 4px 0;
  transition: color .15s;
}
.legal-toc a:hover,
.legal-toc a.is-active {
  color: #c0c8ff;
}
.legal-toc a.is-active {
  font-weight: 600;
}

/* === Content === */
.legal-content {
  line-height: 1.85;
  font-size: 15px;
  color: #d0d3e8;
}
.legal-content h2 {
  font-size: 22px;
  font-weight: 700;
  color: #eaeaff;
  margin: 44px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(123,140,255,.35);
  scroll-margin-top: 80px;
}
.legal-content h3 {
  font-size: 17px;
  font-weight: 600;
  color: #c8ccf0;
  margin: 28px 0 12px;
}
.legal-content p {
  margin: 0 0 12px;
  text-align: justify;
}
.legal-content ul,
.legal-content ol {
  margin: 0 0 16px;
  padding-left: 28px;
}
.legal-content li {
  margin-bottom: 8px;
}
.legal-content strong {
  color: #eaeaff;
}

/* Tables */
.legal-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}
.legal-content th,
.legal-content td {
  border: 1px solid rgba(255,255,255,.1);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
.legal-content th {
  background: rgba(255,255,255,.05);
  font-weight: 600;
  color: #c8ccf0;
}

/* Highlight boxes */
.legal-box {
  padding: 18px 20px;
  margin: 24px 0;
  border-radius: 10px;
}
.legal-box--info {
  background: rgba(123,140,255,.08);
  border-left: 4px solid #7b8cff;
}
.legal-box--warn {
  background: rgba(255,193,7,.07);
  border-left: 4px solid #ffc107;
}
.legal-box strong {
  color: #eaeaff;
}

/* === Footer Actions === */
.legal-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  border-top: 1px solid rgba(255,255,255,.08);
  margin-top: 48px;
  gap: 12px;
  flex-wrap: wrap;
}
.legal-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background .2s, opacity .2s;
  text-decoration: none;
}
.legal-btn--print {
  background: rgba(255,255,255,.06);
  color: #c8ccf0;
}
.legal-btn--print:hover {
  background: rgba(255,255,255,.12);
}
.legal-btn--top {
  background: rgba(123,140,255,.12);
  color: #a8b4ff;
}
.legal-btn--top:hover {
  background: rgba(123,140,255,.2);
}

/* Scroll-to-top FAB (fixed) */
.legal-scroll-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(123,140,255,.18);
  border: 1px solid rgba(123,140,255,.3);
  color: #a8b4ff;
  font-size: 20px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .2s;
  z-index: 90;
}
.legal-scroll-top:hover {
  background: rgba(123,140,255,.3);
  transform: scale(1.08);
}
.legal-scroll-top.is-visible {
  display: flex;
}

/* === Responsive === */
@media (max-width: 768px) {
  .legal-header h1 { font-size: 24px; }
  .legal-meta { flex-direction: column; gap: 10px; }
  .legal-toc ol { columns: 1; }
  .legal-content { font-size: 14px; }
  .legal-content h2 { font-size: 19px; }
  .legal-footer-actions { flex-direction: column; align-items: stretch; text-align: center; }
  .legal-scroll-top { bottom: 20px; right: 16px; }
}

@media (max-width: 480px) {
  .legal-container { padding: 0 14px; }
  .legal-header h1 { font-size: 20px; }
  .legal-content table { font-size: 12px; }
  .legal-content th, .legal-content td { padding: 6px 8px; }
}

/* === Print === */
@media print {
  .legal-toc,
  .legal-footer-actions,
  .legal-scroll-top,
  .legal-breadcrumbs,
  [data-aidc-header],
  .site-header,
  .footer,
  [data-include*="header"],
  [data-include*="footer"] {
    display: none !important;
  }
  .legal-page { padding: 0; }
  .legal-container { max-width: 100%; box-shadow: none; }
  .legal-content { color: #000; }
  .legal-content h2 { color: #000; border-color: #333; }
  .legal-content h3 { color: #333; }
  .legal-content th,
  .legal-content td { border-color: #999; }
  .legal-content th { background: #eee; color: #000; }
  .legal-header h1 { color: #000; }
  .legal-header .legal-subtitle { color: #555; }
  .legal-box--info { background: #eef; border-color: #339; }
  .legal-box--warn { background: #ffe; border-color: #c90; }
  body { background: #fff !important; }
}
