/**
 * Profit Alerts — Legal pages (Privacy / Terms)
 * Premium 2-column layout: sticky sidebar TOC + main content.
 * v20260531
 */

/* ── Reading progress bar ────────────────────────────────────────────────── */

.pa-legal-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--lr-primary);
  z-index: 200;
  transition: width 0.1s linear;
}

/* ── Page shell ──────────────────────────────────────────────────────────── */

.pa-legal-shell {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Hero ────────────────────────────────────────────────────────────────── */

.pa-legal-hero {
  padding: 4rem 0 3rem;
  text-align: center;
  position: relative;
}

.pa-legal-hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 1px;
  background: var(--lr-border);
}

.pa-legal-hero__back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--lr-fg-muted);
  text-decoration: none;
  margin-bottom: 1.75rem;
  transition: color 0.18s;
}

.pa-legal-hero__back:hover { color: var(--lr-primary); }

.pa-legal-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lr-primary);
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.22);
  border-radius: 99px;
  padding: 0.25rem 0.85rem;
  margin-bottom: 1.25rem;
}

.pa-legal-hero__title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.035em;
  color: var(--lr-fg);
  margin: 0 0 1rem;
}

.pa-legal-hero__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.pa-legal-hero__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--lr-fg-subtle);
}

.pa-legal-hero__meta-item svg {
  flex-shrink: 0;
  opacity: 0.55;
}

/* ── Body layout: sidebar + content ─────────────────────────────────────── */

.pa-legal-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 4rem;
  padding: 3rem 0 6rem;
  align-items: start;
}

/* ── Sidebar TOC ─────────────────────────────────────────────────────────── */

.pa-legal-toc {
  position: sticky;
  top: 5.5rem;
  max-height: calc(100vh - 7rem);
  overflow-y: auto;
  scrollbar-width: none;
}

.pa-legal-toc::-webkit-scrollbar { display: none; }

.pa-legal-toc__label {
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lr-fg-subtle);
  margin: 0 0 0.85rem;
  padding-left: 0.65rem;
}

.pa-legal-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.pa-legal-toc__item a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--lr-fg-subtle);
  text-decoration: none;
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  transition: color 0.18s, background 0.18s;
  line-height: 1.4;
}

.pa-legal-toc__item a:hover {
  color: var(--lr-fg-muted);
  background: rgba(255,255,255,0.04);
}

.pa-legal-toc__item a::before {
  content: attr(data-num);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--lr-fg-subtle);
  opacity: 0.5;
  min-width: 1.2rem;
  flex-shrink: 0;
}

.pa-legal-toc__item.is-active a {
  color: var(--lr-primary);
  background: rgba(6, 182, 212, 0.08);
  font-weight: 600;
}

.pa-legal-toc__item.is-active a::before {
  color: var(--lr-primary);
  opacity: 1;
}

/* ── Content ─────────────────────────────────────────────────────────────── */

.pa-legal-content {
  min-width: 0;
}

/* ── Section ─────────────────────────────────────────────────────────────── */

.pa-legal-section {
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--lr-border-subtle);
  scroll-margin-top: 5.5rem;
}

.pa-legal-section:last-child {
  border-bottom: none;
}

.pa-legal-section__header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.pa-legal-section__num {
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1;
  color: var(--lr-fg);
  opacity: 0.07;
  letter-spacing: -0.04em;
  flex-shrink: 0;
  min-width: 2.8rem;
  user-select: none;
}

.pa-legal-section__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--lr-fg);
  margin: 0;
  letter-spacing: -0.015em;
}

.pa-legal-section p {
  font-size: 0.9rem;
  color: var(--lr-fg-muted);
  line-height: 1.8;
  margin: 0 0 0.85rem;
}

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

.pa-legal-section ul {
  margin: 0.5rem 0 1rem;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.pa-legal-section li {
  font-size: 0.88rem;
  color: var(--lr-fg-muted);
  line-height: 1.7;
  display: flex;
  gap: 0.65rem;
  align-items: baseline;
}

.pa-legal-section li::before {
  content: "—";
  color: var(--lr-fg-subtle);
  font-size: 0.78rem;
  flex-shrink: 0;
  margin-top: 0.05em;
}

/* ── Table ───────────────────────────────────────────────────────────────── */

.pa-legal-table-wrap {
  overflow-x: auto;
  margin: 1rem 0 1.25rem;
  border-radius: 10px;
  border: 1px solid var(--lr-border);
}

.pa-legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
  min-width: 480px;
}

.pa-legal-table thead tr {
  background: var(--lr-bg-subtle);
}

.pa-legal-table th {
  text-align: left;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lr-fg-muted);
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--lr-border);
}

.pa-legal-table td {
  padding: 0.75rem 1rem;
  color: var(--lr-fg-muted);
  border-bottom: 1px solid var(--lr-border-subtle);
  vertical-align: top;
  line-height: 1.6;
}

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

.pa-legal-table td strong { color: var(--lr-fg); font-weight: 600; }

/* ── Callout boxes — full borders, no side-stripe ────────────────────────── */

.pa-legal-callout {
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin: 1.1rem 0;
  font-size: 0.87rem;
  line-height: 1.75;
  color: var(--lr-fg-muted);
}

.pa-legal-callout--info {
  background: rgba(6, 182, 212, 0.05);
  border: 1px solid rgba(6, 182, 212, 0.18);
}

.pa-legal-callout--warn {
  background: rgba(245, 158, 11, 0.05);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.pa-legal-callout--warn strong {
  color: #f59e0b;
}

.pa-legal-callout--info strong {
  color: var(--lr-primary);
}

/* ── Badge ───────────────────────────────────────────────────────────────── */

.pa-legal-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.18rem 0.55rem;
  border-radius: 4px;
  vertical-align: middle;
}

.pa-legal-badge--required {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.pa-legal-badge--optional {
  background: rgba(107, 114, 128, 0.1);
  color: var(--lr-fg-subtle);
  border: 1px solid rgba(107, 114, 128, 0.2);
}

/* ── Contact card ────────────────────────────────────────────────────────── */

.pa-legal-contact {
  background: var(--lr-bg-elevated);
  border: 1px solid var(--lr-card-border);
  border-radius: 14px;
  padding: 2rem;
  text-align: center;
  margin-top: 1.5rem;
  position: relative;
  overflow: hidden;
}

.pa-legal-contact::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(6,182,212,0.06), transparent 70%);
  pointer-events: none;
}

.pa-legal-contact__icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--lr-primary);
  margin-bottom: 1rem;
}

.pa-legal-contact h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--lr-fg);
  margin: 0 0 0.4rem;
}

.pa-legal-contact p {
  font-size: 0.85rem;
  color: var(--lr-fg-muted);
  margin: 0 0 1rem;
}

.pa-legal-contact a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--lr-primary);
  text-decoration: none;
  padding: 0.5rem 1.25rem;
  border: 1px solid rgba(6,182,212,0.3);
  border-radius: 8px;
  background: rgba(6,182,212,0.06);
  transition: background 0.18s, border-color 0.18s;
}

.pa-legal-contact a:hover {
  background: rgba(6,182,212,0.12);
  border-color: rgba(6,182,212,0.5);
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

.pa-legal-footer {
  border-top: 1px solid var(--lr-border-subtle);
  padding: 1.75rem 0;
  text-align: center;
}

.pa-legal-footer p {
  font-size: 0.75rem;
  color: var(--lr-fg-subtle);
  margin: 0;
}

.pa-legal-footer a {
  color: var(--lr-fg-muted);
  text-decoration: none;
  margin: 0 0.6rem;
  transition: color 0.15s;
}

.pa-legal-footer a:hover { color: var(--lr-primary); }

/* ── Mobile: single column ───────────────────────────────────────────────── */

@media (max-width: 860px) {
  .pa-legal-body {
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 2rem;
  }

  .pa-legal-toc {
    position: static;
    max-height: none;
    background: var(--lr-bg-elevated);
    border: 1px solid var(--lr-border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
  }

  .pa-legal-toc__list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.1rem 0.5rem;
  }

  .pa-legal-hero { padding: 2.5rem 0 2rem; }
  .pa-legal-hero__title { font-size: 1.85rem; }
}

@media (max-width: 500px) {
  .pa-legal-toc__list { grid-template-columns: 1fr; }
  .pa-legal-shell { padding: 0 1rem; }
  .pa-legal-section__num { font-size: 1.75rem; }
}

/* ════════════════════════════════════════════════════════════════════════
   PRO POLISH — v20260611
   ════════════════════════════════════════════════════════════════════════ */

/* ── Reading progress: aurora gradient + glow ── */
.pa-legal-progress {
  height: 3px;
  background: linear-gradient(90deg, #0ea5e9, #8b5cf6);
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.5);
  border-radius: 0 2px 2px 0;
}

/* ── Section: number warms up as you read it ── */
.pa-legal-section { transition: border-color 0.25s; }

.pa-legal-section:hover .pa-legal-section__num,
.pa-legal-section:target .pa-legal-section__num {
  opacity: 0.35;
  color: #0ea5e9;
  transition: opacity 0.3s, color 0.3s;
}

.pa-legal-section__num { transition: opacity 0.3s, color 0.3s; }

/* ── Contact card lift ── */
.pa-legal-contact {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s, box-shadow 0.25s;
}

.pa-legal-contact:hover {
  transform: translateY(-3px);
  border-color: rgba(14, 165, 233, 0.3);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.3), 0 0 28px rgba(14, 165, 233, 0.08);
}

/* ── Mobile TOC: sticky horizontal chip bar (replaces boxed grid) ── */
@media (max-width: 860px) {
  .pa-legal-toc {
    position: sticky;
    top: 4rem;
    z-index: 40;
    background: rgba(6, 9, 18, 0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0;
    padding: 0.6rem 0;
    margin: 0 -1.5rem 1.75rem;
    max-height: none;
    overflow: visible;
  }

  .pa-legal-toc__label { display: none; }

  .pa-legal-toc__list {
    display: flex;
    grid-template-columns: none;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.4rem;
    padding: 0 1.5rem;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .pa-legal-toc__list::-webkit-scrollbar { display: none; }

  .pa-legal-toc__item { flex-shrink: 0; }

  .pa-legal-toc__item a {
    white-space: nowrap;
    font-size: 0.75rem;
    padding: 0.35rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
  }

  .pa-legal-toc__item.is-active a {
    border-color: rgba(14, 165, 233, 0.45);
    background: rgba(14, 165, 233, 0.1);
  }
}

@media (max-width: 500px) {
  .pa-legal-toc { margin: 0 -1rem 1.5rem; }
  .pa-legal-toc__list { padding: 0 1rem; grid-template-columns: none; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .pa-legal-contact,
  .pa-legal-contact:hover { transform: none; transition: none; }
  .pa-legal-progress { transition: none; }
}
