/* ============================================================
   /legal - clean, modern document styling.
   No card-boxes, no left TOC sidebar: a single centred column
   with hairline dividers between sections. Scoped to .legal-doc.
   Normalises the two clause structures (rules-clause for
   imprint/privacy/cancellation, rule-item for terms) into one look.
   ============================================================ */

/* Two-column: clean sticky TOC on the left + content. */
.legal-doc .rules-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 56px;
  max-width: none;
  margin: 0;
  align-items: start;
}
.legal-doc .rules-body { display: block; min-width: 0; }

/* TOC: keep rules.css's single line + orange active marker; just refine. */
.legal-doc .rules-toc-label {
  font-family: var(--font-body) !important; /* same font as the rest, not Geist Mono */
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-dim);
  padding: 0 0 14px 0 !important; /* flush left (above the line) */
  margin: 0;
}
.legal-doc .rules-toc-link { font-size: 13px; line-height: 1.45; padding: 6px 0; }
.legal-doc .rules-toc-link[hidden] { display: none; }

/* ---------- Search / filter bar ---------- */
.legal-search-wrap { max-width: 240px; margin: 0 0 22px; }
.legal-search {
  width: 100%;
  background: var(--bg-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a3a3a3' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E") no-repeat 16px center;
  background-size: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 16px 13px 44px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.legal-search::placeholder { color: var(--text-dim); }
.legal-search:focus { outline: none; border-color: rgba(255, 140, 26, 0.45); }
.legal-doc .rules-section[hidden] { display: none !important; }
.legal-empty { margin: 8px 0 0; color: var(--text-muted); font-size: 14px; }
.legal-empty[hidden] { display: none; }

/* Sections: no boxes - separated by a hairline + generous spacing */
.legal-doc .rules-section {
  background: none !important;
  border: 0 !important;
  border-top: 1px solid var(--border) !important;
  border-radius: 0 !important;
  padding: 34px 0 0 !important;
  margin: 34px 0 0 !important;
}
.legal-doc .rules-section:first-child {
  border-top: 0 !important;
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* Section header: plain icon (no chip box) + title */
.legal-doc .rules-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 0;
  border-bottom: 0;
}
.legal-doc .rules-section-icon {
  background: none;
  border: 0;
  width: auto;
  height: auto;
  color: var(--orange);
  flex-shrink: 0;
}
.legal-doc .rules-section-icon svg { width: 19px; height: 19px; }
.legal-doc .rules-section-title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0;
}

/* Clauses - normalise both structures */
.legal-doc .rule-item { background: none; border: 0; padding: 0; margin: 0; }
.legal-doc .rules-clause,
.legal-doc .rule-item-body { margin-top: 22px; }
.legal-doc .rules-section-body > :first-child,
.legal-doc .rules-clause:first-child { margin-top: 0; }

.legal-doc .rules-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.legal-doc .rules-section p {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.75;
  margin: 0 0 8px;
}
.legal-doc .rules-section strong { color: var(--text); font-weight: 600; }

/* Lists - clean grey dots, vertically centred, no boxes */
.legal-doc .rules-section ul,
.legal-doc .rule-list {
  list-style: none;
  margin: 12px 0 4px;
  padding: 0;
  gap: 0;
  display: block;
}
.legal-doc .rules-section li,
.legal-doc .rule-list li {
  position: relative;
  padding: 4px 0 4px 22px;
  margin: 0;
  background: none;
  border: 0;
  border-radius: 0;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.7;
}
.legal-doc .rules-section li::before,
.legal-doc .rule-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  /* vertically centred on the first text line (li has 4px top padding,
     line-height 1.7 → half line ≈ 0.85em) */
  top: calc(4px + 0.85em);
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.32);
  box-shadow: none;
}

/* Intro paragraphs that sit directly in the body (before the first section)
   - e.g. the Widerruf notices - need spacing + the same readable type. */
.legal-doc .rules-body > p {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.75;
  margin: 0 0 14px;
}

/* Red asterisk marker in the model withdrawal form */
.legal-doc .legal-star { color: #ef4444; font-weight: 600; }

/* Fill-in lines for the model withdrawal form (straight solid lines) */
.legal-doc .legal-fill {
  display: inline-block;
  min-width: 260px;
  max-width: 100%;
  border-bottom: 1px solid var(--text-dim);
  margin-left: 4px;
}

/* Ordered lists (1. 2. …): show the grey number instead of a grey dot. */
.legal-doc .rules-section ol {
  list-style: decimal;
  margin: 12px 0 4px;
  padding-left: 22px;
}
.legal-doc .rules-section ol li { padding-left: 4px; }
.legal-doc .rules-section ol li::before { content: none; }
.legal-doc .rules-section ol li::marker { color: var(--text-dim); }

/* Links + inline code */
.legal-doc .rules-link {
  color: var(--orange);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 140, 26, 0.3);
  transition: border-color 0.2s;
  word-break: break-word;
}
.legal-doc .rules-link:hover { border-bottom-color: var(--orange); }
.legal-doc code {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 13px;
  color: var(--orange);
}

@media (max-width: 860px) {
  .legal-doc .rules-layout { grid-template-columns: 1fr; gap: 24px; max-width: 100%; }
  .legal-doc .rules-toc { display: none; }
  .legal-search-wrap, .legal-empty { max-width: 100%; }
}
