/* Legal Documents Styling - Terms of Service & Privacy Policy */

.legal-document {
  font-family: var(--font-family-sans, 'Inter', system-ui, sans-serif);
  color: var(--text-color, #E5E7EB);
  background: linear-gradient(180deg, #2A2A2A 0%, #222222 100%);
  border-radius: var(--ct-radius, 2px);
  padding: 2rem;
  max-width: 900px;
  margin: 0 auto;
}

/* Header Styling */
.legal-header {
  text-align: center;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 1.5rem;
}

.legal-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--ct-accent, #5B4FC4);
  margin-bottom: 0.5rem;
}

.legal-meta {
  font-size: 0.875rem;
  color: #94A3B8;
  margin-bottom: 1rem;
}

.legal-intro {
  font-size: 1rem;
  color: #CBD5E1;
  line-height: 1.6;
  max-width: 700px;
  margin: 0 auto;
}

/* Table of Contents */
.legal-toc {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--ct-radius, 2px);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.legal-toc h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #F1F5F9;
  margin-bottom: 0.75rem;
}

.legal-toc ol {
  columns: 2;
  column-gap: 2rem;
  list-style-type: decimal;
  padding-left: 1.25rem;
  margin: 0;
}

@media (max-width: 640px) {
  .legal-toc ol {
    columns: 1;
  }
}

.legal-toc li {
  font-size: 0.875rem;
  margin-bottom: 0.375rem;
  break-inside: avoid;
}

.legal-toc a {
  color: var(--ct-accent, #5B4FC4);
  text-decoration: none;
  transition: color 0.2s ease;
}

.legal-toc a:hover {
  color: #7B6FD4;
  text-decoration: underline;
}

/* Content Area */
.legal-content {
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 0.5rem;
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
.legal-content::-webkit-scrollbar {
  width: 8px;
}

.legal-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 2px;
}

.legal-content::-webkit-scrollbar-thumb {
  background: #404040;
  border-radius: 2px;
}

.legal-content::-webkit-scrollbar-thumb:hover {
  background: #555555;
}

/* Section Styling */
.legal-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.legal-section:last-of-type {
  border-bottom: none;
}

.legal-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #F1F5F9;
  margin-bottom: 1rem;
  padding-left: 0.5rem;
  border-left: 3px solid var(--ct-accent, #5B4FC4);
}

.legal-text {
  color: #CBD5E1;
  font-size: 0.9375rem;
  line-height: 1.75;
}

.legal-text p {
  margin-bottom: 1rem;
  white-space: pre-wrap;
}

.legal-text p:last-child {
  margin-bottom: 0;
}

/* Important/Warning Text (caps in content) */
.legal-text p:has(strong:first-child) {
  background: rgba(91, 79, 196, 0.1);
  border-left: 3px solid var(--ct-accent, #5B4FC4);
  padding: 1rem;
  border-radius: var(--ct-radius, 2px);
  margin: 1rem 0;
}

/* Acknowledgment Box */
.legal-acknowledgment {
  background: rgba(91, 79, 196, 0.1);
  border: 1px solid rgba(91, 79, 196, 0.25);
  border-radius: var(--ct-radius, 2px);
  padding: 1.5rem;
  margin-top: 2rem;
  text-align: center;
}

.legal-acknowledgment p {
  color: #F1F5F9;
  font-size: 0.9375rem;
  line-height: 1.6;
  margin: 0;
}

/* Action Buttons */
.legal-actions {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.scroll-notice {
  text-align: center;
  color: #FBBF24;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.legal-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.legal-buttons .btn {
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--ct-radius, 2px);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.legal-buttons .btn-primary {
  background: var(--ct-accent, #5B4FC4);
  color: white;
}

.legal-buttons .btn-primary:hover:not(:disabled) {
  filter: brightness(1.15);
  box-shadow: 0 4px 16px rgba(91, 79, 196, 0.35);
}

.legal-buttons .btn-primary:disabled {
  background: #404040;
  color: #888;
  cursor: not-allowed;
}

.legal-buttons .btn-secondary {
  background: transparent;
  color: #999;
  border: 1px solid #404040;
}

.legal-buttons .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #F1F5F9;
  border-color: #555;
}

/* Modal Overlay for Legal Docs */
.legal-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

.legal-modal {
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.legal-modal .legal-content {
  max-height: calc(90vh - 250px);
}

/* Responsive */
@media (max-width: 768px) {
  .legal-document {
    padding: 1.25rem;
    border-radius: var(--ct-radius, 2px);
  }

  .legal-header h1 {
    font-size: 1.5rem;
  }

  .legal-section h2 {
    font-size: 1.125rem;
  }

  .legal-text {
    font-size: 0.875rem;
  }

  .legal-buttons {
    flex-direction: column;
  }

  .legal-buttons .btn {
    width: 100%;
  }

  .legal-content {
    max-height: 50vh;
  }
}

/* Print Styles */
@media print {
  .legal-document {
    background: white;
    color: black;
    max-width: 100%;
    padding: 0;
  }

  .legal-header h1 {
    background: none;
    -webkit-text-fill-color: #1e293b;
    color: #1e293b;
  }

  .legal-content {
    max-height: none;
    overflow: visible;
  }

  .legal-actions {
    display: none;
  }

  .legal-section {
    page-break-inside: avoid;
  }
}
