/* =========================================================
   JH FamilySync — Legal Pages
   Konsistent mit Landing-Brand
   ========================================================= */

:root {
  --primary: #6C8EF5;
  --primary-dark: #5277E3;
  --accent: #FF8AB1;
  --text: #1A1B2E;
  --sub: #5B5C7A;
  --surface: #FFFFFF;
  --bg: #F5F6FA;
  --line: rgba(26, 27, 46, 0.08);
  --radius: 16px;
  --shadow-sm: 0 2px 8px rgba(26, 27, 46, 0.06);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'Onest', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }

a {
  color: var(--primary-dark);
  text-decoration: none;
  transition: color .2s;
}
a:hover { color: var(--primary); text-decoration: underline; }

h1, h2, h3 {
  margin: 0 0 .5em;
  color: var(--text);
  letter-spacing: -0.02em;
  font-weight: 800;
  line-height: 1.2;
}

p { margin: 0 0 1em; color: var(--text); }

strong { font-weight: 700; }

code {
  font-family: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, Consolas, monospace;
  font-size: .88em;
  background: rgba(108, 142, 245, .10);
  color: var(--primary-dark);
  padding: 1px 6px;
  border-radius: 6px;
  word-break: break-word;
}

/* ---------- Header ---------- */
.legal-header {
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}

.legal-header__inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.legal-brand:hover { color: var(--text); text-decoration: none; }

.legal-brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  box-shadow: 0 4px 12px rgba(108, 142, 245, .25);
}

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s, border-color .2s, transform .2s;
}
.legal-back:hover {
  background: rgba(108, 142, 245, .08);
  border-color: rgba(108, 142, 245, .32);
  color: var(--text);
  text-decoration: none;
  transform: translateY(-1px);
}

/* ---------- Main ---------- */
.legal-main {
  padding: 40px 20px 64px;
}

.legal-article {
  max-width: 760px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 48px 40px;
  box-shadow: var(--shadow-sm);
}

.legal-article h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin-bottom: 8px;
  letter-spacing: -0.025em;
}

.legal-article > h1 + .legal-section {
  margin-top: 24px;
}

.legal-section {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.legal-section:first-of-type {
  margin-top: 8px;
  padding-top: 0;
  border-top: none;
}

.legal-section h2 {
  font-size: 1.25rem;
  margin-bottom: 14px;
  color: var(--text);
}

.legal-section h3 {
  font-size: 1.05rem;
  margin-top: 24px;
  margin-bottom: 8px;
  color: var(--text);
}

.legal-section p {
  color: var(--text);
  font-size: .98rem;
  line-height: 1.7;
}

.legal-address {
  font-style: normal;
  background: var(--bg);
  border-radius: 12px;
  padding: 18px 22px;
  line-height: 1.7;
  color: var(--text);
  font-size: .98rem;
  border-left: 4px solid var(--primary);
}

.legal-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.legal-list li {
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: .98rem;
}
.legal-list li:last-child { border-bottom: none; }

/* ---------- Footer ---------- */
.legal-footer {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 20px 48px;
  text-align: center;
  color: var(--sub);
}

.legal-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.legal-footer img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  opacity: .8;
}

.legal-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  font-size: .9rem;
}

.legal-footer nav a {
  color: var(--sub);
}
.legal-footer nav a:hover { color: var(--primary); }

.legal-footer small {
  font-size: .85rem;
  color: var(--sub);
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .legal-article {
    padding: 32px 22px;
    border-radius: 20px;
  }
  .legal-main { padding: 24px 14px 48px; }
  .legal-header__inner { padding: 0 14px; height: 60px; }
  .legal-back { padding: 8px 14px; font-size: .85rem; }
  .legal-brand img { width: 32px; height: 32px; }
}

/* ---------- Print ---------- */
@media print {
  body { background: #fff; }
  .legal-header, .legal-footer { display: none; }
  .legal-article { border: none; box-shadow: none; padding: 0; }
}

/* ---------- Language Switcher (legal-header) ----------
   Globe-Icon + Rosé-Active, identisch zu Landing-Switcher.
   Spezifität via .legal-header weil sonst .legal-back / generic
   anchor-Styles gewinnen würden. */
.legal-header .lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 6px 3px 10px;
  border: 1px solid var(--line-strong, rgba(26, 27, 46, 0.18));
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.legal-header .lang-switcher__globe {
  color: var(--accent-dark, #C73E72);
  margin-right: 4px;
  flex-shrink: 0;
  opacity: 0.85;
}
.legal-header .lang-switcher__btn {
  display: inline-block !important;
  padding: 5px 10px !important;
  margin: 0 !important;
  border-radius: 999px !important;
  font-family: var(--font-body, "Onest", "Inter", sans-serif);
  font-size: 11px !important;
  font-weight: 800 !important;
  color: var(--sub, #5B5C7A) !important;
  background: transparent !important;
  text-decoration: none !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase;
  line-height: 1 !important;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.legal-header .lang-switcher__btn:hover,
.legal-header .lang-switcher__btn:focus-visible {
  color: var(--accent-dark, #C73E72) !important;
  background: rgba(199, 62, 114, 0.08) !important;
}
.legal-header .lang-switcher__btn--active {
  background: var(--accent-dark, #C73E72) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(199, 62, 114, 0.28), inset 0 -1px 0 rgba(0, 0, 0, 0.08);
}
.legal-header .lang-switcher__btn--active:hover {
  background: var(--accent-dark, #C73E72) !important;
  color: #fff !important;
}

/* Auf engen Screens: legal-back ausblenden, Switcher hat Vorrang */
@media (max-width: 520px) {
  .legal-header .lang-switcher__btn { padding: 4px 8px !important; font-size: 10px !important; }
  .legal-header .legal-back { font-size: 13px; }
}

/* ---------- Global prefers-reduced-motion (WCAG 2.1 AA) ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  /* Specifically disable the floating blob animations */
  .floating-shape, .hero-decorations, .sparkle,
  .back-to-top__inner, .cookie-banner__icon {
    animation: none !important;
  }
  /* Static visibility instead of fade-in reveal */
  .reveal, [class*="reveal"] {
    opacity: 1 !important;
    transform: none !important;
  }
}
