/* Shared styling for the legal pages (Impressum, Datenschutz, AGB), plus the cookie
   notice and footer used on every page. Deliberately self-contained: no webfonts, no
   third-party requests, so these pages can be served before any consent interaction
   has taken place. Colors come from theme.css. */

.legal-shell {
  display: block;
  width: min(880px, 92vw);
  margin: 0 auto;
  padding: 32px 0 80px;
}

.legal-shell h1 {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 600;
  margin: 0 0 6px;
}

.legal-updated {
  color: var(--text2);
  font-size: 0.85rem;
  margin: 0 0 28px;
}

.legal-section {
  margin: 0 0 20px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  background: var(--bg2);
}

.legal-section h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 10px;
}

.legal-section h3 {
  font-size: 0.98rem;
  font-weight: 600;
  margin: 16px 0 6px;
}

.legal-section p,
.legal-section li {
  line-height: 1.62;
  color: var(--text2);
  margin: 0 0 10px;
}

.legal-section ul,
.legal-section ol {
  margin: 0 0 12px;
  padding-left: 22px;
}

.legal-section a {
  color: var(--blue);
}

.legal-key {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr;
  gap: 6px 18px;
  margin: 0 0 12px;
}

.legal-key dt {
  color: var(--text2);
  font-size: 0.86rem;
}

.legal-key dd {
  margin: 0;
  color: var(--text);
}

@media (max-width: 620px) {
  .legal-key { grid-template-columns: 1fr; gap: 2px; }
  .legal-key dd { margin-bottom: 10px; }
}

/* ── Language switch ───────────────────────────────────────────────────────
   English is the default view because the whole service is English. The German
   version is the legally authoritative one and stays one click away.

   Note the direction of these rules: without JavaScript neither language is
   hidden, so the legal texts stay fully readable with scripting disabled. Only
   once legal-lang.js has set .lang-en / .lang-de on <html> does one version
   collapse - and the switch itself only appears in that same case. */
html.lang-en [data-lang="de"],
html.lang-de [data-lang="en"] {
  display: none;
}

.legal-lang {
  display: none;
  gap: 4px;
  margin: 0 0 20px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--bg2);
  width: max-content;
}

html.lang-en .legal-lang,
html.lang-de .legal-lang {
  display: inline-flex;
}

.legal-lang-btn {
  border: none;
  border-radius: var(--radius);
  padding: 6px 14px;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  background: transparent;
  color: var(--text2);
}

.legal-lang-btn:hover { color: var(--text); }

.legal-lang-btn.is-active {
  background: rgba(70, 166, 255, 0.15);
  color: var(--blue);
}

.legal-lang-btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

/* Placeholders the operator still has to fill in before going live. */
.legal-todo {
  display: inline-block;
  padding: 1px 7px;
  border-radius: var(--radius);
  background: rgba(255, 202, 103, 0.15);
  border: 1px dashed var(--yellow);
  color: var(--yellow);
  font-size: 0.85em;
}

.legal-note {
  border-left: 3px solid var(--blue);
  padding: 10px 14px;
  margin: 14px 0;
  background: rgba(70, 166, 255, 0.08);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 14px;
  font-size: 0.9rem;
}

.legal-table th,
.legal-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.legal-table th {
  color: var(--text2);
  font-weight: 600;
}

.legal-table-wrap { overflow-x: auto; }

/* ── Cookie notice ─────────────────────────────────────────────────────────
   This is an information banner, not a consent gate. The service only sets
   strictly necessary cookies (session + OAuth CSRF token), which are exempt
   from consent under section 165(3) TKG 2021. Asking for consent we do not
   need would be misleading, so the banner only informs and dismisses. */
.cookie-notice {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(720px, calc(100% - 24px));
  z-index: 9999;
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-radius: var(--radius-panel);
  border: 1px solid var(--border);
  background: var(--bg2);
  box-shadow: 0 16px 44px rgba(1, 4, 9, 0.45);
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.5;
}

.cookie-notice[hidden] { display: none; }
.cookie-notice p { margin: 0; flex: 1 1 320px; }
.cookie-notice a { color: var(--blue); }

/* Same look as the primary button in the dashboard and site.css. */
.cookie-notice button {
  flex: 0 0 auto;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  color: #06101e;
  background: var(--accent-gradient);
}

.cookie-notice button:hover {
  background: linear-gradient(135deg, #59b0ff, #72e7c0);
}

.cookie-notice button:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* Global footer with the mandatory legal links. */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 48px;
  padding: 26px 20px 34px;
  text-align: center;
  color: var(--text2);
  font-size: 0.85rem;
}

.site-footer nav {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.site-footer a {
  color: var(--text2);
  text-decoration: none;
}

.site-footer a:hover { color: var(--text); text-decoration: underline; }
.site-footer p { margin: 0 auto; max-width: 560px; line-height: 1.55; }
