.legal-page {
  min-height: 100vh;
  background: #f8fafc;
  color: #0a1628;
  padding: 2rem 1rem 4rem;
}

html.dark .legal-page {
  background: #050d1a;
  color: #e2e8f0;
}

.legal-page-header {
  max-width: 48rem;
  margin: 0 auto 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #b8960c;
  transition: color 0.2s ease;
}

.legal-back:hover {
  color: #d4af37;
}

.legal-back svg {
  width: 1.125rem;
  height: 1.125rem;
}

.legal-content {
  max-width: 48rem;
  margin: 0 auto;
  background: #fff;
  border: 1px solid rgba(15, 52, 96, 0.08);
  border-radius: 1rem;
  padding: 2rem 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
}

html.dark .legal-content {
  background: #0a1628;
  border-color: rgba(255, 255, 255, 0.08);
}

.legal-content h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #0a1628;
}

html.dark .legal-content h1 {
  color: #f8fafc;
}

.legal-updated {
  font-size: 0.8125rem;
  color: #64748b;
  margin-bottom: 2rem;
}

.legal-content h2 {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 1.75rem 0 0.75rem;
  color: #0f3460;
}

html.dark .legal-content h2 {
  color: #f4c430;
}

.legal-content p,
.legal-content li {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: #475569;
  margin-bottom: 0.75rem;
}

html.dark .legal-content p,
html.dark .legal-content li {
  color: #94a3b8;
}

.legal-content ul,
.legal-content ol {
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}

.legal-content a {
  color: #b8960c;
  text-decoration: underline;
}

.legal-content a:hover {
  color: #d4af37;
}

/* Modal (landing page) */
.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.legal-modal.open {
  opacity: 1;
  visibility: visible;
}

.legal-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 13, 26, 0.75);
  backdrop-filter: blur(4px);
}

.legal-modal-panel {
  position: relative;
  width: min(100%, 42rem);
  max-height: min(88vh, 720px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 1rem;
  border: 1px solid rgba(212, 175, 55, 0.2);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

html.dark .legal-modal-panel {
  background: #0a1628;
}

.legal-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(15, 52, 96, 0.1);
  flex-shrink: 0;
}

html.dark .legal-modal-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.legal-modal-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #0a1628;
}

html.dark .legal-modal-title {
  color: #f8fafc;
}

.legal-modal-close {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  transition: background 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.legal-modal-close:hover {
  background: rgba(212, 175, 55, 0.15);
  color: #b8960c;
}

.legal-modal-close svg {
  width: 1.25rem;
  height: 1.25rem;
}

.legal-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.legal-modal-body h1 {
  display: none;
}

.legal-modal-body .legal-updated {
  margin-top: 0;
}

.legal-modal-loading {
  text-align: center;
  color: #64748b;
  padding: 2rem;
}

body.legal-modal-open {
  overflow: hidden;
}

@media (min-width: 640px) {
  .legal-content {
    padding: 2.5rem 2.5rem;
  }

  .legal-modal-body {
    padding: 1.75rem 2rem 2rem;
  }
}
