/* ========================================
   Legal Pages — Shared Styles
   ======================================== */

.legal {
  padding: 120px 0 80px;
}

.legal__container {
  max-width: 780px;
}

.legal__title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.legal__updated {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.legal__intro {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border-glass);
}

/* Sections */
.legal__section {
  margin-bottom: 40px;
}

.legal__section h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-glass);
}

.legal__section h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--green-400);
  margin-top: 20px;
  margin-bottom: 10px;
}

.legal__section p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 12px;
}

.legal__section ul {
  margin-bottom: 16px;
  padding-left: 20px;
}

.legal__section li {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 8px;
  list-style: disc;
}

.legal__section li ul {
  margin-top: 8px;
  margin-bottom: 8px;
}

.legal__section a {
  color: var(--green-400);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition-fast);
}

.legal__section a:hover {
  color: var(--green-500);
}

.legal__section strong {
  color: var(--text-primary);
}

/* Highlight box for important disclaimers */
.legal__highlight {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-left: 3px solid var(--green-400);
  border-radius: 8px;
  padding: 20px 24px;
  margin: 16px 0;
}

.legal__highlight p {
  margin-bottom: 10px;
}

.legal__highlight p:last-child {
  margin-bottom: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .legal {
    padding: 100px 0 60px;
  }

  .legal__title {
    font-size: 1.75rem;
  }

  .legal__section h2 {
    font-size: 1.15rem;
  }
}

/* ========================================
   Modal Overlay
   ======================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}

.modal__dialog {
  position: relative;
  width: min(92vw, 720px);
  max-height: 85vh;
  background: var(--bg-secondary, #1a1d2e);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  transform: translateY(24px);
  transition: transform 0.3s ease;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.modal.open .modal__dialog {
  transform: translateY(0);
}

.modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--border-glass);
  flex-shrink: 0;
}

.modal__title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.modal__updated {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.modal__close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.75rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s ease;
}

.modal__close:hover {
  color: var(--text-primary);
}

.modal__body {
  overflow-y: auto;
  padding: 24px 28px 32px;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

/* Tighter spacing inside modals */
.modal__body .legal__section {
  margin-bottom: 28px;
}

.modal__body .legal__section h2 {
  font-size: 1.15rem;
}

.modal__body .legal__intro {
  margin-bottom: 24px;
  padding-bottom: 24px;
}

/* Custom scrollbar for modal body */
.modal__body::-webkit-scrollbar {
  width: 6px;
}

.modal__body::-webkit-scrollbar-track {
  background: transparent;
}

.modal__body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.modal__body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Mobile modal fills more of the screen */
@media (max-width: 768px) {
  .modal__dialog {
    width: 96vw;
    max-height: 90vh;
    border-radius: 12px;
  }

  .modal__header {
    padding: 18px 20px 12px;
  }

  .modal__body {
    padding: 18px 20px 24px;
  }

  .modal__title {
    font-size: 1.25rem;
  }
}