/* Legal pages — native app + web */

.legal-page {
  background: var(--cream-light, #FDFBF7);
  color: var(--cacao, #4A3728);
  line-height: 1.65;
  font-family: var(--font-body, 'Inter', sans-serif);
}

.legal-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
}

.legal-header {
  margin-bottom: 1.5rem;
  text-align: left;
}

.legal-header h1 {
  font-family: var(--font-heading, 'Playfair Display', serif);
  color: var(--forest, #2C5E3B);
  font-size: 1.65rem;
  margin: 0 0 0.35rem;
  line-height: 1.25;
}

.legal-header p {
  color: var(--cacao-light, #7A6A5A);
  font-size: 0.82rem;
  margin: 0;
}

.legal-content h2 {
  font-family: var(--font-heading, 'Playfair Display', serif);
  color: var(--forest, #2C5E3B);
  margin: 1.75rem 0 0.65rem;
  font-size: 1.15rem;
  line-height: 1.3;
}

.legal-content h3 {
  color: var(--cacao, #4A3728);
  margin: 1.25rem 0 0.4rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.legal-content p,
.legal-content li {
  margin-bottom: 0.85rem;
  font-size: 0.88rem;
}

.legal-content ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.legal-content a {
  color: var(--matcha, #7E9F3D);
  text-decoration: none;
  font-weight: 500;
}

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--cacao-light, #7A6A5A);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* Native shell */
html.capacitor-native .legal-page .footer,
html.capacitor-native .legal-page .legal-back {
  display: none !important;
}

html.capacitor-native .legal-page .legal-container {
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

html.capacitor-native .legal-page .app-legal-top {
  display: flex;
}

.app-legal-top {
  display: none;
}

/* Dark mode */
html.capacitor-native.theme-dark .legal-page {
  background: var(--dm-bg, #0e1210);
  color: var(--dm-text, #e8ebe6);
}

html.capacitor-native.theme-dark .legal-header h1,
html.capacitor-native.theme-dark .legal-content h2 {
  color: var(--forest, #6db87a);
}

html.capacitor-native.theme-dark .legal-header p,
html.capacitor-native.theme-dark .legal-content p,
html.capacitor-native.theme-dark .legal-content li,
html.capacitor-native.theme-dark .legal-content h3 {
  color: var(--dm-text-muted, #9aab9e);
}

html.capacitor-native.theme-dark .legal-content a {
  color: var(--matcha-light, #a8cc62);
}

@media (min-width: 640px) {
  .legal-container {
    padding: 2rem 1.5rem 3rem;
  }
  .legal-header h1 {
    font-size: 2rem;
  }
}