/* Legal pages (/imprint, /privacy, /terms, /cookies, /widerruf), the § 312k
   cancellation page (/kuendigen) and the 404 page. Loads after site.css
   (tokens, nav, footer, buttons). Standard (ui-ux-pro-max, 2026-11-18):
   homepage tokens only, no new direction; one left-aligned 68ch prose column
   (65-75 characters per line) at line-height 1.7; the title block (h1, binding
   notice, date, intro) is set apart by space, not a rule; flat surfaces
   (tone steps, no shadow); wide tables scroll inside their own box;
   form fields have visible labels, errors under the field, 16px text, 48px
   height and a 3:1 border. Legal wording lives in the HTML and locales and is
   not touched here. */

/* ── Nav: Home, sign in, native language select (legal-init.js fills it) ── */
.lang-pick { position: relative; flex-shrink: 0; }
.lang-pick::after { content: ''; position: absolute; top: 50%; right: 10px; width: 6px; height: 6px; margin-top: -5px; border: solid var(--body); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); pointer-events: none; }
#langSelect { min-height: 40px; padding: 0 26px 0 10px; appearance: none; -webkit-appearance: none; background: transparent; border: 1px solid var(--line); border-radius: var(--r-sm); font: inherit; font-size: var(--fs-small); color: var(--ink); cursor: pointer; }
#langSelect:hover { border-color: var(--lavender); background: var(--white); }

/* ── Prose column ── */
.legal-content {
  box-sizing: content-box; max-width: 68ch; margin: 0 auto;
  padding: calc(var(--nav-h) + var(--s8)) var(--s5) var(--s9);
  font-size: var(--fs-body); line-height: 1.7; color: var(--ink);
  overflow-wrap: break-word;
}
.legal-content h1 { margin-bottom: var(--s4); font-size: clamp(2rem, 1.55rem + 1.4vw, 2.75rem); font-weight: 650; letter-spacing: -0.025em; line-height: 1.1; color: var(--ink); text-wrap: balance; hyphens: manual; }
.legal-content h2 { margin: var(--s7) 0 var(--s3); font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; color: var(--ink); text-wrap: balance; scroll-margin-top: calc(var(--nav-h) + var(--s4)); }
.legal-content p, .legal-content ul { margin-bottom: var(--s3); }
.legal-content ul { padding-left: 1.25em; }
.legal-content li { margin-bottom: var(--s2); padding-left: var(--s1); }
.legal-content strong { font-weight: 600; color: var(--ink); }
.legal-content a { color: var(--violet); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.legal-content a:hover { color: var(--violet-hover); }

/* Title block: binding-translation notice and date in small type, then the intro. */
.legal-content .updated, .legal-content .legal-updated { margin-bottom: var(--s1); font-size: var(--fs-small); line-height: 1.5; color: var(--body); }
/* The first paragraph after the meta lines starts the document, not the meta. */
.legal-content :is(.updated, .legal-updated) + :not(.updated, .legal-updated, .intro) { margin-top: var(--s6); }
.legal-content .intro { margin: var(--s5) 0 var(--s8); font-size: var(--fs-lead); line-height: 1.6; color: var(--ink); }

/* Shown by legal-init.js while the owner details in legal-config.js are empty. */
.legal-content .legal-details-notice { margin-bottom: var(--s6); padding: var(--s3) var(--s4); background: var(--soon-bg); border: 2px solid var(--soon); border-radius: var(--r-md); font-weight: 600; line-height: 1.5; color: var(--soon); }
.legal-content .legal-details-notice[hidden] { display: none; }

.legal-content .contact-email { display: inline-block; padding: 4px 10px; background: var(--paper-2); border-radius: var(--r-sm); font-weight: 500; color: var(--ink); }

/* Muster-Widerrufsformular: a form to copy, so it reads as a separate sheet. */
.legal-content .widerruf-form { margin: var(--s4) 0 var(--s5); padding: var(--s5); background: var(--paper-2); border-radius: var(--r-md); color: var(--ink); }

/* ── Cookie table: scrolls inside its box, never widens the page ── */
.legal-content .table-scroll { margin: var(--s4) 0 var(--s6); overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); }
.legal-content table { width: 100%; min-width: 36rem; border-collapse: collapse; font-size: var(--fs-small); line-height: 1.5; }
.legal-content th, .legal-content td { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: normal; hyphens: manual; }
.legal-content th { background: var(--paper-2); font-weight: 600; color: var(--ink); }
.legal-content tr:last-child td { border-bottom: 0; }

/* ── § 312k cancellation form (kuendigen.js toggles [hidden] only) ── */
.legal-content form { margin-top: var(--s5); }
.legal-content form p { margin-bottom: var(--s4); }
.legal-content label, .legal-content legend { font-weight: 500; color: var(--ink); }
/* Label on its own line above its field; the markup's <br> would add an empty line. */
.legal-content form label[for] { display: block; margin-bottom: var(--s2); }
.legal-content form p > br { display: none; }
.legal-content .en { display: block; font-size: var(--fs-small); font-weight: 400; color: var(--body); }
.legal-content input[type="email"], .legal-content input[type="text"], .legal-content input[type="date"], .legal-content textarea {
  width: 100%; max-width: 28rem; min-height: 48px; padding: 10px 14px;
  background: var(--white); border: 1px solid var(--body); border-radius: var(--r-sm);
  font: inherit; font-size: 16px; color: var(--ink);
}
.legal-content input[type="date"] { width: auto; }
.legal-content input:focus-visible, .legal-content textarea:focus-visible { outline: 2px solid var(--violet); outline-offset: 1px; border-color: var(--violet); }
.legal-content [aria-invalid="true"] { border-color: var(--danger); }
.legal-content fieldset { margin: var(--s4) 0; padding: 0; border: 0; }
.legal-content legend { margin-bottom: var(--s2); }
.legal-content label:has(> input[type="radio"]) { position: relative; display: block; min-height: 44px; padding: 2px 0 0 32px; font-weight: 400; cursor: pointer; }
.legal-content input[type="radio"] { position: absolute; top: 5px; left: 0; width: 20px; height: 20px; margin: 0; accent-color: var(--violet); }
#turnstileContainer { min-height: 65px; margin: var(--s3) 0; }
.legal-content .field-error, #cancelStatus { white-space: pre-line; } /* German line, then English line */
.legal-content .field-error { margin-top: calc(var(--s2) * -1); font-weight: 500; color: var(--danger); }
.legal-content .field-error[hidden] { display: none; }
#cancelStatus:not(:empty) { margin-top: var(--s5); padding: var(--s4); background: var(--paper-2); border-radius: var(--r-md); color: var(--ink); }
.legal-content .btn:disabled { opacity: .5; cursor: default; }
.legal-content .btn:disabled:active { transform: none; }

/* ── 404 ── */
.err { max-width: 30rem; margin: calc(var(--nav-h) + var(--s9)) auto var(--s9); padding: var(--s7) var(--s6); background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); text-align: center; }
.err .code { margin-bottom: var(--s2); font-size: var(--fs-small); font-weight: 600; color: var(--violet); }
.err h1 { margin-bottom: var(--s3); font-size: clamp(1.75rem, 1.4rem + 1vw, 2.25rem); font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; color: var(--ink); text-wrap: balance; }
.err p { margin: 0 auto var(--s5); max-width: 34ch; color: var(--body); }
.err .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s3); }
.err .actions .btn { flex: 1 1 11rem; }

@media (max-width: 768px) {
  /* Long German compounds would leave ragged gaps in a phone-width column. */
  .legal-content { padding-top: var(--s6); padding-inline: var(--s4); hyphens: auto; }
  .legal-content :is(a, .contact-email) { hyphens: manual; }
  .err { margin: var(--s6) var(--s4) var(--s8); padding: var(--s6) var(--s5); }
  #langSelect { font-size: 16px; } /* iOS zooms into controls under 16px */
}
