/* === Rechts-/Bestätigungsseiten (Impressum, Datenschutz, Danke) ===
   Teilt das Design-System mit styles.css: Teal-Signal (--accent) auf
   kühlem Near-Black, weicher Verlauf (kein Raster), runde Ecken.
   Hintergrund (.backdrop) + Safe-Area-Kappe (.topcap) kommen – wie bei
   index.html – als echte <div>-Kinder von <body> (in styles.css definiert);
   diese Datei stylt nur die Inhaltsstruktur (Karten, Header, Typografie). */

/* --- Layout-Rahmen ---
   Hintergrund (.backdrop) + Safe-Area-Kappe (.topcap) kommen jetzt – wie bei
   index.html – als echte <div>-Kinder von <body> (in styles.css definiert).
   KEIN overflow-x: clip hier: das machte das <main> zum Scroll-Container, wodurch
   die fixe Kappe am Gerät nicht zuverlässig griff. Der Body clippt bereits global. */
.legal-page,
.thank-you-page {
  position: relative;
  min-height: 100vh;
  padding:
    calc(env(safe-area-inset-top, 0px) + 30px)
    max(20px, env(safe-area-inset-right))
    calc(env(safe-area-inset-bottom, 0px) + 30px)
    max(20px, env(safe-area-inset-left));
}

.thank-you-page {
  display: grid;
  place-items: center;
}

/* --- Impressum / Datenschutz --- */
.legal-header,
.legal-card {
  position: relative;
  z-index: 1;
}

.legal-header {
  width: min(100%, 920px);
  margin: 0 auto 20px;
  padding-top: clamp(12px, 4vw, 40px);
}

.legal-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.legal-kicker::before {
  content: "//";
}

.legal-title {
  margin: 0;
  max-width: 880px;
  font-family: var(--font-display);
  color: var(--ink-strong);
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
  font-weight: 700;
  overflow-wrap: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.legal-subtitle {
  max-width: 720px;
  margin-top: 20px;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.14rem);
  line-height: 1.7;
}

.legal-card {
  width: min(100%, 920px);
  margin: 0 auto;
  padding: clamp(22px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--bg-1);
}

.legal-grid {
  display: grid;
  gap: 0;
}

/* Spec-Sheet-Stil: Sektionen durch Haarlinien getrennt, ohne eigene Box */
.legal-section {
  padding: 26px 0;
  border-top: 1px solid var(--line);
}
.legal-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.legal-section h2 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  color: var(--ink-strong);
  font-size: 1.2rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 600;
}
.legal-section h3 {
  margin: 20px 0 8px;
  font-family: var(--font-mono);
  color: var(--ink-strong);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legal-section p,
.legal-section li {
  color: var(--muted);
  line-height: 1.75;
}
.legal-section p { margin: 0; }
.legal-section p + p { margin-top: 14px; }

.legal-section ul {
  margin: 12px 0 0 4px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.legal-section ul li {
  display: flex;
  gap: 10px;
}
.legal-section ul li::before {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  margin-top: 9px;
  border-radius: 999px;
  background: var(--accent);
}

.legal-section strong { color: var(--ink-strong); }

.legal-link {
  color: var(--accent-text);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
  word-break: break-word;
}
.legal-link:hover { color: var(--ink-strong); }

.legal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.legal-note {
  margin-top: 22px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  line-height: 1.6;
}

/* --- Danke-Seite --- */
.thank-you-card {
  position: relative;
  z-index: 1;
  width: min(100%, 760px);
  padding: clamp(28px, 5vw, 52px);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--bg-1);
}

.thank-you-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  border: 1px solid var(--accent-line);
  border-radius: var(--r1);
  color: var(--accent-text);
}
.thank-you-icon svg { width: 28px; height: 28px; }

.thank-you-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.thank-you-kicker::before { content: "//"; }

.thank-you-title {
  max-width: 720px;
  margin: 0;
  font-family: var(--font-display);
  color: var(--ink-strong);
  font-size: clamp(2.3rem, 6vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
  font-weight: 700;
  overflow-wrap: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.thank-you-text {
  max-width: 640px;
  margin-top: 22px;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.5vw, 1.18rem);
  line-height: 1.75;
}

.thank-you-next {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 34px;
  border: 1px solid var(--line);
  border-radius: var(--r2);
  overflow: hidden;
  counter-reset: step;
}
.next-card {
  padding: 18px;
  border-right: 1px solid var(--line);
}
.next-card:last-child { border-right: 0; }
.next-card strong {
  display: block;
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: 0.98rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.next-card span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.thank-you-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.thank-you-footer {
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  line-height: 1.6;
}

/* --- Mobile --- */
@media (max-width: 680px) {
  .legal-title { font-size: clamp(2.1rem, 9vw, 3rem); }
  .thank-you-page { place-items: start center; }
  .thank-you-next { grid-template-columns: 1fr; }
  .next-card { border-right: 0; border-bottom: 1px solid var(--line); }
  .next-card:last-child { border-bottom: 0; }
  .legal-actions,
  .thank-you-actions { flex-direction: column; }
  .legal-actions .btn,
  .thank-you-actions .btn { width: 100%; }
}
