/* ═══════════════════════════════════════════════════════════════════
   SWARM Legal Pages — Premium Dark Theme
   Unified styling for Terms, Privacy, Cookies pages
   ═══════════════════════════════════════════════════════════════════ */

/* ── Base / Body override for legal pages ────────────────────────── */
.legal-page {
  min-height: 100vh;
  padding-top: 100px;
  padding-bottom: 80px;
  background: #0a0a0f;
  color: rgba(255,255,255,0.8);
  font-family: 'Space Grotesk', 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Legal Header / Hero ─────────────────────────────────────────── */
.legal-header {
  text-align: center;
  margin-bottom: 40px;
  padding: 48px 32px 40px;
  background: rgba(255,255,255,0.015);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(0,229,255,0.08);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}

/* Subtle top glow accent */
.legal-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #00E5FF, #0077FF, transparent);
  border-radius: 2px;
}

.legal-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(0,229,255,0.06);
  border: 1px solid rgba(0,229,255,0.15);
  border-radius: 100px;
  color: #00E5FF;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 20px;
}

.legal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(28px, 4.5vw, 44px);
  font-weight: 800;
  background: linear-gradient(135deg, #00E5FF 0%, #0077FF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 14px;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.legal-meta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  color: rgba(255,255,255,0.35);
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.02em;
}

.separator {
  color: rgba(255,255,255,0.15);
}

/* ── Table of Contents ───────────────────────────────────────────── */
.legal-toc {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 28px 32px;
  margin-bottom: 40px;
}

.toc-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #00E5FF;
  margin: 0 0 18px;
}

.toc-list {
  display: grid;
  gap: 4px;
}

.toc-link {
  display: block;
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s ease;
  border-left: 2px solid transparent;
}

.toc-link:hover {
  background: rgba(0,229,255,0.06);
  color: #00E5FF;
  border-left-color: #00E5FF;
  padding-left: 18px;
}

/* ── Legal Content Container ─────────────────────────────────────── */
.legal-content {
  max-width: 860px;
  margin: 0 auto;
}

/* ── Legal Sections ──────────────────────────────────────────────── */
.legal-section {
  background: rgba(255,255,255,0.018);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 14px;
  padding: 36px 32px;
  margin-bottom: 24px;
  scroll-margin-top: 100px;
  transition: border-color 0.3s ease;
}

.legal-section:hover {
  border-color: rgba(0,229,255,0.1);
}

/* ── Section Titles ──────────────────────────────────────────────── */
.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 700;
  color: #00E5FF;
  margin: 0 0 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(0,229,255,0.1);
  letter-spacing: -0.01em;
}

.subsection-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  margin-top: 28px;
  margin-bottom: 14px;
}

/* ── Paragraphs ──────────────────────────────────────────────────── */
.legal-section p,
.legal-content > p {
  color: rgba(255,255,255,0.6);
  margin-bottom: 16px;
  font-size: 15px;
  line-height: 1.8;
}

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

.legal-section strong {
  color: rgba(255,255,255,0.88);
}

/* ── Lists ────────────────────────────────────────────────────────── */
.legal-list {
  list-style: none;
  padding-left: 0;
  margin: 16px 0;
}

.legal-list li {
  color: rgba(255,255,255,0.6);
  line-height: 1.8;
  padding-left: 26px;
  margin-bottom: 10px;
  position: relative;
  font-size: 15px;
}

.legal-list li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00E5FF, #0077FF);
  opacity: 0.7;
}

.legal-list li strong {
  color: rgba(255,255,255,0.88);
}

/* ── Links ────────────────────────────────────────────────────────── */
.legal-section a,
.legal-content a,
.text-link {
  color: #00E5FF;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid rgba(0,229,255,0.25);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.legal-section a:hover,
.legal-content a:hover,
.text-link:hover {
  border-bottom-color: #00E5FF;
  color: #00E5FF;
}

/* ── Info Boxes ───────────────────────────────────────────────────── */
.info-box {
  display: flex;
  gap: 16px;
  padding: 20px 24px;
  border-radius: 12px;
  margin: 24px 0;
  align-items: flex-start;
}

.info-box svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.info-box p {
  margin: 0 !important;
  line-height: 1.7;
  font-size: 14px;
}

.info-box-warning {
  background: rgba(240,185,11,0.05);
  border: 1px solid rgba(240,185,11,0.2);
}

.info-box-warning p {
  color: rgba(255,255,255,0.55);
}

.info-box-warning strong {
  color: #F0B90B;
}

.info-box-info {
  background: rgba(0,229,255,0.04);
  border: 1px solid rgba(0,229,255,0.12);
}

.info-box-info p {
  color: rgba(255,255,255,0.55);
}

.info-box-info strong {
  color: #00E5FF;
}

.info-box-success {
  background: rgba(14,203,129,0.05);
  border: 1px solid rgba(14,203,129,0.2);
}

.info-box-success p {
  color: rgba(255,255,255,0.55);
}

.info-box-success strong {
  color: #0ECB81;
}

/* ── Tables ───────────────────────────────────────────────────────── */
.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  background: rgba(255,255,255,0.015);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  overflow: hidden;
  font-size: 14px;
}

.legal-table thead {
  background: rgba(0,229,255,0.06);
}

.legal-table th {
  padding: 14px 18px;
  text-align: left;
  font-weight: 700;
  color: #00E5FF;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid rgba(0,229,255,0.1);
  font-family: 'JetBrains Mono', monospace;
}

.legal-table td {
  padding: 14px 18px;
  color: rgba(255,255,255,0.55);
  font-size: 14px;
  line-height: 1.6;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  vertical-align: top;
}

.legal-table td code {
  background: rgba(0,229,255,0.08);
  color: #00E5FF;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
}

.legal-table tbody tr:last-child td {
  border-bottom: none;
}

.legal-table tbody tr:hover {
  background: rgba(0,229,255,0.03);
}

.legal-table td strong {
  color: rgba(255,255,255,0.85);
  display: block;
  margin-bottom: 3px;
}

.legal-table td small {
  color: rgba(255,255,255,0.35);
  font-size: 12px;
}

/* ── Usage / Security / Contact Grids ────────────────────────────── */
.usage-grid,
.security-grid,
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.usage-card,
.security-card,
.contact-card {
  padding: 24px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.usage-card:hover,
.security-card:hover,
.contact-card:hover {
  border-color: rgba(0,229,255,0.2);
  box-shadow: 0 0 24px rgba(0,229,255,0.08);
  transform: translateY(-2px);
}

.usage-icon,
.security-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.security-card {
  text-align: center;
}

.security-icon {
  font-size: 3rem;
}

.contact-card {
  text-align: center;
}

.contact-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.usage-card h4,
.security-card h4,
.contact-card h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  margin-bottom: 8px;
}

.usage-card p,
.security-card p,
.contact-card p {
  font-size: 14px;
  color: rgba(255,255,255,0.45);
  margin: 0;
  line-height: 1.6;
}

/* ── Badges (yes/no) ─────────────────────────────────────────────── */
.badge-yes {
  display: inline-block;
  padding: 3px 12px;
  background: rgba(14,203,129,0.12);
  border: 1px solid rgba(14,203,129,0.3);
  border-radius: 6px;
  color: #0ECB81;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-no {
  display: inline-block;
  padding: 3px 12px;
  background: rgba(255,75,75,0.08);
  border: 1px solid rgba(255,75,75,0.25);
  border-radius: 6px;
  color: #FF4B4B;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── CCPA Rights Grid ────────────────────────────────────────────── */
.ccpa-rights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.ccpa-right-card {
  padding: 24px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.ccpa-right-card:hover {
  border-color: rgba(0,229,255,0.2);
  box-shadow: 0 0 24px rgba(0,229,255,0.08);
  transform: translateY(-2px);
}

.ccpa-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  text-align: center;
  display: block;
}

.ccpa-right-card h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  margin-bottom: 12px;
  text-align: center;
}

.ccpa-right-card p {
  font-size: 14px;
  color: rgba(255,255,255,0.45);
  margin-bottom: 12px;
  line-height: 1.6;
}

.ccpa-right-card .legal-list {
  margin-top: 12px;
}

.ccpa-right-card .legal-list li {
  font-size: 14px;
  padding-left: 22px;
  margin-bottom: 8px;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .legal-page {
    padding-top: 80px;
  }

  .legal-header {
    padding: 32px 20px 28px;
    margin-bottom: 28px;
  }

  .legal-toc {
    padding: 20px;
  }

  .legal-section {
    padding: 24px 20px;
    margin-bottom: 16px;
  }

  .legal-table {
    font-size: 12px;
  }

  .legal-table th,
  .legal-table td {
    padding: 10px 12px;
  }

  .info-box {
    flex-direction: column;
    gap: 10px;
    padding: 16px 18px;
  }

  .ccpa-rights-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1024px) {
  .legal-toc {
    position: static;
  }

  .toc-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Smooth scroll-to-section highlight animation ────────────────── */
.legal-section:target {
  border-color: rgba(0,229,255,0.25);
  box-shadow: 0 0 32px rgba(0,229,255,0.06);
}

/* ── Selection color ─────────────────────────────────────────────── */
.legal-page ::selection {
  background: rgba(0,229,255,0.2);
  color: #fff;
}

.legal-page ::-moz-selection {
  background: rgba(0,229,255,0.2);
  color: #fff;
}
