/* ============================================================================
   TopManager — public legal pages (privacy policy, terms of service)
   View: Views/Home/LegalDocument.cshtml; texts: App_Data/LandingPage/Legal/*.html.
   Loaded AFTER own.public.landing.page.css: the page is a .tm-landing[data-tm-theme]
   too, so it takes the visitor's landing theme (the --tm-* tokens) and the hero's
   background (.tm-hero__blob / .tm-hero__grid, with their animation and their
   ui-effects-lite rules in own.ui.effects.scss) - here fixed behind the text.
   Everything below is scoped under .tm-legal.
   ============================================================================ */
/* ---------- Background: the landing hero's blobs + grid, fixed ---------- */
.tm-legal__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: radial-gradient(1200px 600px at 80% -10%, var(--tm-gradient-soft), transparent 60%), var(--tm-bg);
}

.tm-legal__bg .tm-hero__blob--3 {
  top: 52%;
  bottom: auto;
}

.tm-legal__bg .tm-hero__grid {
  -webkit-mask-image: radial-gradient(circle at 50% 20%, #000 0%, transparent 70%);
  mask-image: radial-gradient(circle at 50% 20%, #000 0%, transparent 70%);
}

/* the scroller lies over the background (the landing's own scroller paints a background of its own) */
.tm-legal .tm-legal__scroll {
  z-index: 1;
  background: transparent;
}

/* ---------- Header ---------- */
.tm-legal__header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--tm-navbar-bg-scrolled);
  border-bottom: 1px solid var(--tm-border);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
}

.tm-legal__bar {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.tm-legal__brand {
  display: inline-flex;
  align-items: center;
}

.tm-legal__logo {
  height: 26px;
  width: auto;
  display: block;
}

/* the logo is dark artwork: white on the dark themes, like the landing's footer logo */
.tm-landing[data-tm-theme=midnight] .tm-legal__logo,
.tm-landing[data-tm-theme=slate] .tm-legal__logo,
.tm-landing[data-tm-theme=grape] .tm-legal__logo,
.tm-landing[data-tm-theme=forest] .tm-legal__logo,
.tm-landing[data-tm-theme=carbon] .tm-legal__logo,
.tm-landing[data-tm-theme=neon] .tm-legal__logo,
.tm-landing[data-tm-theme=ember] .tm-legal__logo {
  filter: brightness(0) invert(1);
}

.tm-legal__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.tm-legal .tm-legal__nav-link {
  padding: 0.35rem 0.85rem;
  border-radius: var(--tm-radius-pill);
  color: var(--tm-text-soft);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.tm-legal .tm-legal__nav-link:hover,
.tm-legal .tm-legal__nav-link:focus-visible {
  color: var(--tm-accent-strong);
  background: var(--tm-gradient-soft);
  text-decoration: none;
}

.tm-legal .tm-legal__nav-link.is-current {
  color: var(--tm-on-accent);
  background: var(--tm-grad-btn);
  box-shadow: 0 8px 18px -10px var(--tm-glow);
}

.tm-legal .tm-legal__lang {
  border: 1px solid var(--tm-border-strong);
}

/* ---------- Document: a frosted card over the background ---------- */
.tm-legal__main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 1rem 3rem;
}

.tm-legal__document {
  position: relative;
  padding: 3rem 3.25rem;
  border: 1px solid var(--tm-glass-border);
  border-radius: var(--tm-radius-lg);
  background: color-mix(in srgb, var(--tm-surface) 84%, transparent);
  -webkit-backdrop-filter: saturate(150%) blur(22px);
  backdrop-filter: saturate(150%) blur(22px);
  box-shadow: var(--tm-shadow);
  color: var(--tm-text);
  line-height: 1.7;
  font-size: 1rem;
  overflow-wrap: anywhere;
  cursor: auto; /* the landing shows the arrow everywhere; a legal text is read and copied */
}

/* a thin accent line along the top of the card */
.tm-legal__document::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 2.5rem;
  right: 2.5rem;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--tm-gradient);
}

.tm-legal__document h1 {
  margin: 0 0 0.4rem;
  font-family: var(--tm-font-display);
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--tm-accent-strong);
  background: var(--tm-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tm-legal__document h2 {
  margin: 2.4rem 0 0.8rem;
  padding-top: 1.3rem;
  border-top: 1px solid var(--tm-border);
  font-family: var(--tm-font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--tm-text);
  scroll-margin-top: 5rem;
}

.tm-legal__document h3 {
  margin: 1.5rem 0 0.5rem;
  font-family: var(--tm-font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--tm-text);
}

.tm-legal__document p,
.tm-legal__document ul,
.tm-legal__document ol {
  margin: 0 0 0.95rem;
  color: var(--tm-text-soft);
}

.tm-legal__document strong {
  color: var(--tm-text);
}

.tm-legal__document li {
  margin-bottom: 0.4rem;
}

.tm-legal__document li::marker {
  color: var(--tm-accent);
}

.tm-legal__document a {
  color: var(--tm-accent-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tm-legal__document .legal-meta {
  display: inline-block;
  margin-bottom: 1.4rem;
  padding: 0.25rem 0.8rem;
  border-radius: var(--tm-radius-pill);
  background: var(--tm-gradient-soft);
  color: var(--tm-text-soft);
  font-size: 0.88rem;
  font-weight: 600;
}

.tm-legal__document .legal-note {
  padding: 1rem 1.2rem;
  border: 1px solid var(--tm-border);
  border-left: 4px solid var(--tm-accent);
  border-radius: var(--tm-radius);
  background: var(--tm-gradient-soft);
  color: var(--tm-text);
}

.tm-legal__document table {
  width: 100%;
  margin: 0 0 1.1rem;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--tm-border);
  border-radius: var(--tm-radius);
  overflow: hidden;
  font-size: 0.95rem;
}

.tm-legal__document th,
.tm-legal__document td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--tm-border);
  text-align: left;
  vertical-align: top;
  color: var(--tm-text-soft);
}

.tm-legal__document tr:last-child td {
  border-bottom: 0;
}

.tm-legal__document th {
  background: var(--tm-gradient-soft);
  color: var(--tm-text);
  font-weight: 700;
}

.tm-legal__document code {
  padding: 0.05em 0.35em;
  border-radius: 6px;
  background: var(--tm-surface-2);
  color: var(--tm-text);
  font-size: 0.86em;
  word-break: break-all;
}

/* ---------- Footer ---------- */
.tm-legal__footer {
  padding: 0.5rem 1rem 2.5rem;
  text-align: center;
  color: var(--tm-muted);
  font-size: 0.9rem;
}

.tm-legal .tm-legal__footer a {
  color: var(--tm-text-soft);
}

.tm-legal__copy {
  margin-top: 0.5rem;
}

/* ---------- Motion / small screens ---------- */
@media (prefers-reduced-motion: reduce) {
  .tm-legal__bg .tm-hero__blob {
    animation: none;
  }
  .tm-legal__scroll {
    scroll-behavior: auto;
  }
}
@media (max-width: 640px) {
  .tm-legal__main {
    padding-top: 1.25rem;
  }
  .tm-legal__document {
    padding: 1.75rem 1.15rem;
  }
  .tm-legal__document::before {
    left: 1.25rem;
    right: 1.25rem;
  }
  .tm-legal__document h1 {
    font-size: 1.8rem;
  }
  .tm-legal__document table,
  .tm-legal__document thead,
  .tm-legal__document tbody,
  .tm-legal__document tr,
  .tm-legal__document th,
  .tm-legal__document td {
    display: block;
  }
}
