/* ============================================
   Picmori — Legal Pages (Privacy Policy, Terms)
   Matches "Candy Glass" design system
   ============================================ */

/* --- Page Layout --- */
.legal-page {
  position: relative;
  z-index: 1;
  padding-top: 120px;
  padding-bottom: 80px;
  min-height: 100vh;
}

.legal-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Header --- */
.legal-header {
  text-align: center;
  margin-bottom: 48px;
}

.legal-title {
  font-family: 'Plus Jakarta Sans', 'Nunito', sans-serif;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-primary);
  margin-top: 16px;
  margin-bottom: 16px;
}

.legal-effective {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* --- Table of Contents --- */
.legal-toc {
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 48px;
}

.legal-toc h3 {
  font-family: 'Plus Jakarta Sans', 'Nunito', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.legal-toc ol {
  list-style: none;
  counter-reset: toc-counter;
  padding: 0;
  columns: 2;
  column-gap: 24px;
}

.legal-toc li {
  counter-increment: toc-counter;
  margin-bottom: 8px;
  break-inside: avoid;
}

.legal-toc li::before {
  content: counter(toc-counter) ".";
  display: inline-block;
  width: 24px;
  font-weight: 700;
  color: var(--purple);
  font-size: 0.9rem;
}

.legal-toc a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.legal-toc a:hover {
  color: var(--purple);
}

@media (max-width: 600px) {
  .legal-toc ol {
    columns: 1;
  }
}

/* --- Body Content --- */
.legal-body {
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius);
  padding: 48px 48px 56px;
}

@media (max-width: 768px) {
  .legal-body {
    padding: 32px 24px 40px;
  }
}

.legal-body section {
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(168, 85, 247, 0.08);
}

.legal-body section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

/* --- Headings --- */
.legal-body h2 {
  font-family: 'Plus Jakarta Sans', 'Nunito', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 20px;
  scroll-margin-top: 100px;
}

.legal-body h3 {
  font-family: 'Nunito', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 28px;
  margin-bottom: 12px;
}

.legal-body h4 {
  font-family: 'Nunito', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

/* --- Text --- */
.legal-body p {
  font-size: 0.975rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

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

.legal-body a {
  color: var(--purple);
  font-weight: 600;
  transition: color 0.2s ease;
}

.legal-body a:hover {
  color: var(--pink);
}

/* --- Lists --- */
.legal-body ul,
.legal-body ol {
  margin: 12px 0 16px 0;
  padding-left: 24px;
}

.legal-body li {
  font-size: 0.975rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.legal-body li strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* --- Highlight Box --- */
.legal-highlight {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.08), rgba(236, 72, 153, 0.06));
  border-left: 4px solid var(--purple);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 20px 24px;
  margin: 24px 0;
}

.legal-highlight strong {
  color: var(--purple-dark);
  display: block;
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.legal-highlight p {
  margin-bottom: 0;
}

.legal-highlight.warning {
  background: linear-gradient(135deg, rgba(255, 93, 115, 0.08), rgba(255, 200, 87, 0.06));
  border-left-color: var(--danger);
}

.legal-highlight.warning strong {
  color: var(--danger);
}

/* --- Table --- */
.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.925rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.legal-table thead th {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(236, 72, 153, 0.07));
  color: var(--text-primary);
  font-weight: 700;
  text-align: left;
  padding: 14px 18px;
  font-size: 0.9rem;
}

.legal-table tbody td {
  padding: 14px 18px;
  color: var(--text-secondary);
  line-height: 1.6;
  border-bottom: 1px solid rgba(168, 85, 247, 0.06);
}

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

.legal-table tbody tr:hover {
  background: rgba(168, 85, 247, 0.03);
}

/* --- Third-Party Cards --- */
.legal-card {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(168, 85, 247, 0.1);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin: 12px 0;
  transition: border-color 0.2s ease;
}

.legal-card:hover {
  border-color: rgba(168, 85, 247, 0.25);
}

.legal-card h4 {
  margin-bottom: 6px;
}

.legal-card p {
  margin-bottom: 8px;
  font-size: 0.925rem;
}

.legal-card a {
  font-size: 0.875rem;
}

/* --- Rights Grid --- */
.legal-rights-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 20px 0;
}

@media (max-width: 600px) {
  .legal-rights-grid {
    grid-template-columns: 1fr;
  }
}

.legal-right {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(168, 85, 247, 0.1);
  border-radius: var(--radius-sm);
  padding: 20px;
}

.legal-right h4 {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.legal-right p {
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 0;
}

/* --- Contact Box --- */
.legal-contact {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.08), rgba(236, 72, 153, 0.06));
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin-top: 16px;
}

.legal-contact p {
  margin-bottom: 0;
  color: var(--text-primary);
}

.legal-contact a {
  color: var(--purple);
}

/* --- Footer active link --- */
.footer-links-group a.active {
  color: var(--purple);
  font-weight: 700;
}

/* --- Smooth scroll target offset --- */
.legal-body section[id] {
  scroll-margin-top: 100px;
}
