/* Strony prawne — regulamin, polityka prywatności, formularze */

.legal-shell {
  padding: 32px 0 64px;
  background: #f8fafc;
  min-height: 70vh;
}

.legal-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
  align-items: start;
}

@media (max-width: 900px) {
  .legal-grid { grid-template-columns: 1fr; }
  .legal-toc { position: static; top: auto; }
  .legal-toc__inner { max-height: none; }
}

/* TOC */
.legal-toc {
  position: sticky;
  top: 88px;
}
.legal-toc__inner {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.legal-toc h2 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 12px;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.legal-toc ol {
  margin: 0 0 16px;
  padding-left: 18px;
  font-size: 13.5px;
  line-height: 1.5;
}
.legal-toc ol li { margin-bottom: 6px; }
.legal-toc a {
  color: #334155;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.legal-toc a:hover { color: #ea580c; border-bottom-color: #ea580c; }
.legal-print { width: 100%; box-sizing: border-box; }

/* Document body */
.legal-doc {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 48px 56px;
  color: #1e293b;
  font-size: 15.5px;
  line-height: 1.7;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.legal-doc a { word-break: break-word; }
.legal-doc table { display: block; max-width: 100%; overflow-x: auto; }
.legal-grid > * { min-width: 0; }
.legal-doc--narrow { max-width: 820px; margin: 0 auto; }

@media (max-width: 700px) {
  .legal-doc { padding: 28px 22px; font-size: 15px; }
}

.legal-doc h1 {
  font-size: 28px;
  line-height: 1.25;
  margin: 0 0 24px;
  color: #0f172a;
  font-weight: 800;
}
.legal-doc h2 {
  font-size: 21px;
  margin: 40px 0 14px;
  color: #0f172a;
  font-weight: 700;
  scroll-margin-top: 88px;
}
.legal-doc h3 {
  font-size: 17px;
  margin: 28px 0 10px;
  color: #0f172a;
  font-weight: 700;
}
.legal-doc h4 {
  font-size: 15px;
  margin: 20px 0 8px;
  color: #334155;
  font-weight: 700;
}
.legal-doc p { margin: 0 0 14px; }
.legal-doc ul, .legal-doc ol { margin: 0 0 16px; padding-left: 24px; }
.legal-doc li { margin-bottom: 6px; }
.legal-doc strong { color: #0f172a; font-weight: 700; }
.legal-doc a { color: #ea580c; text-decoration: underline; text-underline-offset: 2px; }
.legal-doc a:hover { color: #c2410c; }
.legal-doc hr {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 28px 0;
}
.legal-doc blockquote {
  border-left: 3px solid #ea580c;
  background: #fff7ed;
  padding: 12px 18px;
  margin: 18px 0;
  border-radius: 0 8px 8px 0;
  color: #1e293b;
}
.legal-doc blockquote p { margin: 0; }
.legal-doc code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.92em;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 14px;
}
.legal-table th, .legal-table td {
  border: 1px solid #e2e8f0;
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
.legal-table thead th {
  background: #f1f5f9;
  font-weight: 700;
  color: #0f172a;
}
.legal-table tbody tr:nth-child(even) { background: #fafafa; }

/* Action bar (formularze) */
.legal-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #e2e8f0;
}

/* Print: ukryj wszystko poza treścią dokumentu */
@media print {
  body * { visibility: hidden; }
  .legal-doc, .legal-doc * { visibility: visible; }
  .legal-doc {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    border: none;
    padding: 0;
    box-shadow: none;
    font-size: 11pt;
  }
  .legal-doc h1 { font-size: 20pt; }
  .legal-doc h2 { font-size: 14pt; page-break-after: avoid; }
  .legal-doc h3 { font-size: 12pt; page-break-after: avoid; }
  .no-print, .legal-toc, .breadcrumbs, .site-footer, .site-header { display: none !important; }
  a { color: inherit !important; text-decoration: none !important; }
  blockquote { page-break-inside: avoid; }
  table { page-break-inside: avoid; }
}
