/* Poster365 Legal Center — shared design system (Privacy + Terms) */
.legal-doc {
  --legal-primary: #1976D2;
  --legal-primary-dark: #1565C0;
  --legal-accent: #6366F1;
  --legal-violet: #7C3AED;
  --legal-text: #0F172A;
  --legal-text-body: #334155;
  --legal-text-muted: #64748B;
  --legal-bg: #F8FAFC;
  --legal-surface: #FFFFFF;
  --legal-border: rgba(15, 23, 42, 0.08);
  --legal-radius: 16px;
  --legal-radius-lg: 22px;
  --legal-header-h: 68px;
  --legal-font: "Inter", system-ui, -apple-system, sans-serif;
  --legal-content-max: 780px;
  --legal-sidebar-w: 260px;
  background: var(--legal-bg);
  font-family: var(--legal-font);
  color: var(--legal-text-body);
}

.legal-doc .skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--legal-primary);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 200;
  border-radius: 8px;
}
.legal-doc .skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* Reading progress */
.legal-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 120;
  background: transparent;
  pointer-events: none;
}
.legal-progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--legal-primary), var(--legal-accent));
  transition: width 0.12s linear;
  border-radius: 0 2px 2px 0;
}

/* Header */
.legal-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--legal-header-h);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--legal-border);
  transition: box-shadow 0.25s ease, background 0.25s ease;
}
.legal-header.is-scrolled {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}
.legal-header-inner {
  width: min(100% - 2rem, 1140px);
  margin-inline: auto;
  height: 100%;
  display: flex;
  align-items: center;
}
.legal-header .logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  color: var(--legal-text);
  flex-shrink: 0;
}
.legal-header .logo-img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
}
.legal-header-nav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin-inline: auto;
  padding: 0.25rem;
  background: #F1F5F9;
  border: 1px solid var(--legal-border);
  border-radius: 999px;
}
.legal-header-nav a {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--legal-text-muted);
  padding: 0.48rem 1rem;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.legal-header-nav a:hover {
  color: var(--legal-primary);
}
.legal-header-nav a.is-active {
  background: var(--legal-surface);
  color: var(--legal-primary);
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.12);
}
.legal-header-nav a:focus-visible,
.legal-back-home:focus-visible,
.legal-toc a:focus-visible,
.legal-contact-link:focus-visible,
.legal-back-top:focus-visible,
.legal-toc-toggle:focus-visible {
  outline: 2px solid var(--legal-primary);
  outline-offset: 2px;
}
.legal-back-home {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--legal-text-muted);
  padding: 0.5rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--legal-border);
  background: var(--legal-surface);
  white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.legal-back-home:hover {
  color: var(--legal-primary);
  border-color: rgba(25, 118, 210, 0.25);
}

/* Hero */
.legal-page {
  padding-bottom: 4rem;
}
.legal-hero {
  position: relative;
  padding: 2.75rem 0 2.5rem;
  overflow: hidden;
  border-bottom: 1px solid var(--legal-border);
  background: var(--legal-surface);
  animation: legalHeroIn 0.55s ease both;
}
@keyframes legalHeroIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.legal-hero-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.legal-hero-deco::before,
.legal-hero-deco::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.45;
}
.legal-hero-deco::before {
  width: 280px;
  height: 280px;
  top: -80px;
  right: 8%;
  background: rgba(25, 118, 210, 0.18);
}
.legal-hero-deco::after {
  width: 220px;
  height: 220px;
  bottom: -60px;
  left: 5%;
  background: rgba(99, 102, 241, 0.14);
}
.legal-hero-inner {
  position: relative;
  z-index: 1;
  width: min(100% - 2rem, var(--legal-content-max));
  margin-inline: auto;
}
.legal-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--legal-primary);
  background: rgba(25, 118, 210, 0.08);
  border: 1px solid rgba(25, 118, 210, 0.14);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  margin-bottom: 0.85rem;
}
.legal-hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.08;
  color: var(--legal-text);
  margin: 0 0 0.65rem;
}
.legal-hero-sub {
  font-size: clamp(1rem, 2.2vw, 1.125rem);
  line-height: 1.65;
  color: var(--legal-text-muted);
  margin: 0 0 1.35rem;
  max-width: 38rem;
}
.legal-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
}
.legal-hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.875rem;
  color: var(--legal-text-muted);
}
.legal-hero-meta strong {
  font-weight: 600;
  color: var(--legal-text);
}

/* Layout */
.legal-layout {
  width: min(100% - 2rem, 1140px);
  margin-inline: auto;
  padding-top: 2.25rem;
  display: grid;
  grid-template-columns: var(--legal-sidebar-w) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}
.legal-sidebar {
  position: sticky;
  top: calc(var(--legal-header-h) + 1.25rem);
}
.legal-toc-toggle {
  display: none;
  width: 100%;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--legal-text);
  text-align: left;
  padding: 0.85rem 1rem;
  background: var(--legal-surface);
  border: 1px solid var(--legal-border);
  border-radius: var(--legal-radius);
  cursor: pointer;
  margin-bottom: 0.65rem;
}
.legal-toc-toggle::after {
  content: "▾";
  float: right;
  color: var(--legal-text-muted);
  transition: transform 0.2s ease;
}
.legal-toc-toggle[aria-expanded="true"]::after {
  transform: rotate(180deg);
}
.legal-sidebar-card {
  background: var(--legal-surface);
  border: 1px solid var(--legal-border);
  border-radius: var(--legal-radius-lg);
  padding: 1.15rem 0.85rem;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}
.legal-sidebar-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--legal-text-muted);
  margin: 0 0 0.75rem 0.65rem;
}
.legal-toc {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  max-height: calc(100vh - var(--legal-header-h) - 4.5rem);
  overflow-y: auto;
  scrollbar-width: thin;
}
.legal-toc a {
  display: grid;
  grid-template-columns: 2rem 1fr;
  align-items: start;
  gap: 0.35rem 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--legal-text-muted);
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  border-left: 2px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.legal-toc a .toc-num {
  font-size: 0.7rem;
  font-weight: 700;
  color: #94A3B8;
  font-variant-numeric: tabular-nums;
}
.legal-toc a:hover {
  color: var(--legal-primary);
  background: rgba(25, 118, 210, 0.05);
}
.legal-toc a.is-active {
  color: var(--legal-primary);
  background: rgba(25, 118, 210, 0.07);
  border-left-color: var(--legal-primary);
  font-weight: 600;
}
.legal-toc a.is-active .toc-num {
  color: var(--legal-primary);
}

/* Article */
.legal-article {
  max-width: var(--legal-content-max);
}
.legal-intro {
  padding: 1.35rem 1.4rem;
  margin-bottom: 2rem;
  background: var(--legal-surface);
  border: 1px solid var(--legal-border);
  border-radius: var(--legal-radius-lg);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.03);
}
.legal-intro p {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--legal-text-body);
}
.legal-intro a,
.legal-section a {
  color: var(--legal-primary);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(25, 118, 210, 0.35);
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
.legal-intro a:hover,
.legal-section a:hover {
  color: var(--legal-primary-dark);
  text-decoration-color: var(--legal-primary-dark);
}

/* Sections — editorial layout */
.legal-section {
  padding: 2rem 0;
  border-bottom: 1px solid var(--legal-border);
  scroll-margin-top: calc(var(--legal-header-h) + 1.5rem);
}
.legal-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.legal-section-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--legal-border);
}
.legal-num {
  flex-shrink: 0;
  min-width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--legal-primary);
  background: rgba(25, 118, 210, 0.08);
  border: 1px solid rgba(25, 118, 210, 0.12);
  border-radius: 12px;
}
.legal-section-head h2 {
  margin: 0;
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: var(--legal-text);
  text-transform: none;
}
.legal-section h3 {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--legal-text);
  margin: 1.5rem 0 0.65rem;
}
.legal-section h3 .sub-num {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--legal-accent);
  flex-shrink: 0;
}
.legal-section p,
.legal-section li {
  font-size: 1rem;
  line-height: 1.72;
  color: var(--legal-text-body);
  margin: 0 0 1rem;
}
.legal-section p:last-child {
  margin-bottom: 0;
}
.legal-section ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}
.legal-section li {
  position: relative;
  padding-left: 1.35rem;
  margin-bottom: 0.65rem;
}
.legal-section li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--legal-primary);
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}
.legal-section li strong {
  color: var(--legal-text);
  font-weight: 600;
}

/* Highlight callouts — presentation only */
.legal-callout {
  padding: 1.15rem 1.25rem;
  border-radius: var(--legal-radius);
  border: 1px solid var(--legal-border);
  margin-top: 0.25rem;
}
.legal-callout p,
.legal-callout li {
  margin-bottom: 0.75rem;
}
.legal-callout p:last-child,
.legal-callout li:last-child {
  margin-bottom: 0;
}
.legal-callout-ai {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(124, 58, 237, 0.04));
  border-color: rgba(99, 102, 241, 0.15);
}
.legal-callout-security {
  background: linear-gradient(135deg, rgba(25, 118, 210, 0.06), rgba(59, 130, 246, 0.04));
  border-color: rgba(25, 118, 210, 0.14);
}
.legal-callout-safety {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.06), rgba(52, 211, 153, 0.04));
  border-color: rgba(16, 185, 129, 0.14);
}
.legal-callout-choices {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.06), rgba(251, 191, 36, 0.04));
  border-color: rgba(245, 158, 11, 0.16);
}
.legal-callout-legal {
  background: #F8FAFC;
  border-color: rgba(15, 23, 42, 0.1);
}
.legal-caps {
  font-size: 0.9375rem !important;
  line-height: 1.7 !important;
  color: var(--legal-text-body) !important;
}

/* Contact */
.legal-section-contact .legal-contact-wrap {
  margin-top: 0.5rem;
}
.legal-contact {
  position: relative;
  overflow: hidden;
  padding: 2rem 1.5rem;
  border-radius: var(--legal-radius-lg);
  border: 1px solid rgba(25, 118, 210, 0.14);
  background: linear-gradient(145deg, rgba(25, 118, 210, 0.06), rgba(99, 102, 241, 0.05));
  text-align: center;
}
.legal-contact::before {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  top: -60px;
  right: -40px;
  border-radius: 50%;
  background: rgba(25, 118, 210, 0.08);
  pointer-events: none;
}
.legal-contact-label {
  position: relative;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--legal-text-muted);
  margin: 0 0 0.5rem;
}
.legal-contact p {
  position: relative;
  margin: 0 0 1rem !important;
  font-size: 1rem !important;
  color: var(--legal-text-body) !important;
}
.legal-contact-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--legal-primary) !important;
  text-decoration: none !important;
  padding: 0.7rem 1.35rem;
  background: var(--legal-surface);
  border: 1px solid rgba(25, 118, 210, 0.18);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(25, 118, 210, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.legal-contact-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(25, 118, 210, 0.16);
}
.legal-note {
  margin: 1.25rem 0 0 !important;
  padding-top: 1rem;
  font-size: 0.9375rem !important;
  color: var(--legal-text-muted) !important;
  text-align: center;
}
.legal-note a {
  font-weight: 600;
}

/* Footer */
.legal-footer {
  margin-top: 1rem;
  padding: 2.5rem 0 1.75rem;
  background: var(--legal-text);
  color: rgba(255, 255, 255, 0.72);
}
.legal-footer-inner {
  width: min(100% - 2rem, 1140px);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}
.legal-footer-brand {
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  letter-spacing: -0.02em;
}
.legal-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
}
.legal-footer-nav a {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.72);
  transition: color 0.2s ease;
}
.legal-footer-nav a:hover {
  color: #fff;
}
.legal-footer-copy {
  width: 100%;
  margin: 0.75rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
}

/* Back to top */
.legal-back-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 90;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  color: var(--legal-primary);
  background: var(--legal-surface);
  border: 1px solid var(--legal-border);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.1);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease, box-shadow 0.2s ease;
}
.legal-back-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.legal-back-top:hover {
  box-shadow: 0 8px 28px rgba(25, 118, 210, 0.18);
}

/* Responsive */
@media (max-width: 960px) {
  .legal-layout {
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 1.5rem;
  }
  .legal-sidebar {
    position: static;
    margin-bottom: 1.25rem;
  }
  .legal-toc-toggle {
    display: block;
  }
  .legal-sidebar-card {
    display: none;
    border-radius: 0 0 var(--legal-radius) var(--legal-radius);
    margin-top: -0.35rem;
    border-top: none;
  }
  .legal-sidebar-card.is-open {
    display: block;
  }
  .legal-toc {
    max-height: 240px;
  }
  .legal-back-home span {
    display: none;
  }
  .legal-back-home::before {
    content: "Home";
  }
}

@media (max-width: 640px) {
  .legal-header-inner {
    gap: 0.65rem;
  }
  .legal-header-nav a {
    padding: 0.42rem 0.75rem;
    font-size: 0.78rem;
  }
  .legal-hero {
    padding: 2rem 0 1.75rem;
  }
  .legal-hero-meta {
    flex-direction: column;
    gap: 0.35rem;
  }
  .legal-section {
    padding: 1.5rem 0;
  }
  .legal-intro,
  .legal-article {
    padding-left: 0;
    padding-right: 0;
  }
  .legal-layout {
    width: min(100% - 2rem, 1140px);
  }
  .legal-back-top {
    width: 40px;
    height: 40px;
    right: 1rem;
    bottom: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .legal-hero {
    animation: none;
  }
  .legal-progress span,
  .legal-back-top,
  .legal-toc a,
  .legal-contact-link {
    transition: none;
  }
}
