:root {
  color-scheme: light;
  --accent: #0262a7;
  --accent-dark: #064b7a;
  --accent-soft: #e8f3fb;
  --border: #cfe2ef;
  --text: #17202a;
  --muted: #5f6f7a;
  --danger: #9f1239;
  --surface: #ffffff;
  --background: #f5f8fa;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.topbar-inner {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.brand {
  margin: 0;
  color: var(--accent-dark);
  font-size: 16px;
  font-weight: 800;
}

.back-link {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.back-link::before {
  content: "‹";
  margin-right: 6px;
}

h1 {
  margin: 4px 0 0;
  font-size: 28px;
  line-height: 1.2;
}

.page-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.page-link {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--accent-dark);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.page-link.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.legal-switcher {
  width: min(100%, 620px);
  margin: 0 auto 4px;
  display: grid;
  grid-template-columns: max-content minmax(220px, 1fr);
  gap: 8px;
  justify-content: center;
}

.legal-switch-button,
.portal-select {
  min-width: 0;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--accent-dark);
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.15;
  padding: 6px 12px;
  text-align: center;
}

.legal-switch-button {
  width: max-content;
  max-width: 100%;
}

.portal-select {
  width: 100%;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 18px) 19px, calc(100% - 12px) 19px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 30px;
  text-align-last: center;
}

.legal-switch-button.active,
.portal-select.active {
  border-color: var(--accent);
  background-color: var(--accent);
  color: #ffffff;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.content {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 20px 24px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.status.error {
  color: var(--danger);
}

.status a {
  color: var(--accent-dark);
  font-weight: 700;
}

.legal-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 50px rgb(21 45 68 / 0.08);
  padding: 28px;
}

.imprint-content {
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
}

.legal-document {
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
}

.legal-document h2 {
  margin: 28px 0 10px;
  color: var(--text);
  font-size: 19px;
  line-height: 1.25;
}

.legal-document h2:first-child {
  margin-top: 0;
}

.legal-document p {
  margin: 0 0 16px;
}

.legal-document ul {
  margin: 0 0 16px;
  padding-left: 20px;
}

.page-link:active,
.legal-switch-button:active,
.back-link:active,
.button:active {
  transform: translateY(1px);
}

.imprint-content:empty::before {
  content: "Impressum wird geladen.";
  color: var(--muted);
}

.privacy-content p,
.imprint-content p {
  margin: 0 0 16px;
}

.privacy-content p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.pdf-viewer {
  width: 100%;
  min-height: 70vh;
  display: block;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--background);
}

.pdf-viewer + .button {
  margin-top: 16px;
  align-self: center;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  padding: 0 16px;
  text-decoration: none;
}

@media (max-width: 720px) {
  .topbar-inner {
    padding: 16px;
  }

  .content {
    padding: 16px;
  }

  h1 {
    font-size: 24px;
  }

  .legal-switcher {
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  }

  .legal-switch-button {
    width: 100%;
  }

  .legal-card {
    padding: 20px;
  }

  .pdf-viewer {
    min-height: 68vh;
  }
}

@media (min-width: 721px) {
  .topbar-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .page-links {
    width: 320px;
  }
}
