/* ========================================
   LEGAL PAGE (public) — /termos/

   The page is loaded on top of landing_dist.css, so it inherits the landing
   page's design tokens (--primary teal, --border, --card, the shadows and the
   gradients) instead of restating them. Only the layout and the document
   typography live here. Everything is expressed through those tokens: change
   the palette on the landing page and this page follows.
   ======================================== */

.legal-page {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.65;
}

/* ---------- Brand lockup (same mark as the landing header) ---------- */

.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.legal-logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
}

.legal-logo-mark svg {
  width: 1rem;
  height: 1rem;
  color: hsl(var(--primary-foreground));
}

.legal-brand-name {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: hsl(var(--foreground));
}

.legal-brand-name span {
  color: hsl(var(--primary));
}

.legal-brand-sm .legal-logo-mark {
  width: 1.75rem;
  height: 1.75rem;
  box-shadow: none;
}

.legal-brand-sm .legal-logo-mark svg {
  width: 0.875rem;
  height: 0.875rem;
}

.legal-brand-sm .legal-brand-name {
  font-size: 1rem;
}

/* ---------- Topbar ---------- */

.legal-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: hsl(var(--card) / 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid hsl(var(--border));
}

.legal-topbar-inner {
  max-width: 1140px;
  margin: 0 auto;
  height: 4rem;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.legal-topbar-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.legal-topbar-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  transition: color 0.2s ease;
}

.legal-topbar-nav a:hover {
  color: hsl(var(--foreground));
}

/* ---------- Page ---------- */

.legal-main {
  max-width: 1140px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.legal-title {
  margin-bottom: 1.75rem;
  font-family: 'Sora', system-ui, sans-serif;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: hsl(var(--foreground));
}

.legal-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 992px) {
  .legal-layout {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  }

  /* The summary and the table of contents follow the reader down a long
     document; on narrow screens they fall back into normal flow. The column is
     taller than some viewports, so it scrolls on its own once stuck - without
     that, the last card would be unreachable. */
  .legal-aside {
    position: sticky;
    top: 5.5rem;
    max-height: calc(100vh - 7rem);
    overflow-y: auto;
  }
}

.legal-column,
.legal-aside {
  display: grid;
  gap: 1.25rem;
}

/* ---------- Cards ---------- */

.legal-card {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  overflow: hidden;
}

.legal-card-head {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid hsl(var(--border));
  background: var(--gradient-card);
}

.legal-card-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  font-family: 'Sora', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: hsl(var(--foreground));
}

.legal-card-title i {
  color: hsl(var(--primary));
  font-size: 1.15rem;
}

.legal-card-body {
  padding: 1.25rem 1.5rem;
  font-size: 0.9375rem;
  color: hsl(var(--foreground) / 0.85);
}

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

.legal-card-body p {
  margin: 0 0 0.85rem;
}

.legal-card-body a {
  color: hsl(var(--primary));
  text-decoration: none;
}

.legal-card-body a:hover {
  text-decoration: underline;
}

/* ---------- Document typography ---------- */

.terms-lead {
  font-size: 1rem;
  color: hsl(var(--foreground));
}

.terms-updated {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
}

.terms-subtitle {
  margin: 1.25rem 0 0.5rem;
  font-family: 'Sora', system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.terms-subtitle:first-child {
  margin-top: 0;
}

.terms-notes,
.terms-facts,
.terms-toc {
  margin: 0 0 0.85rem;
  padding: 0;
  list-style: none;
}

.terms-notes li,
.terms-facts li {
  position: relative;
  margin-bottom: 0.55rem;
  padding-left: 1.15rem;
}

/* A teal dot instead of a bullet: the only decoration on the page, and it
   comes from the same token as everything else. */
.terms-notes li::before,
.terms-facts li::before {
  content: '';
  position: absolute;
  top: 0.6rem;
  left: 0;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: hsl(var(--primary));
}

.terms-facts li {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.terms-hint {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

/* ---------- Callouts ---------- */

.terms-consent,
.terms-warning {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border-radius: calc(var(--radius) - 0.25rem);
  font-size: 0.9375rem;
}

.terms-consent {
  border: 1px solid hsl(var(--primary) / 0.25);
  background: hsl(var(--primary-light));
  color: hsl(222 39% 18%);
}

.terms-consent i {
  color: hsl(var(--primary));
  font-size: 1.15rem;
}

.terms-warning {
  border: 1px solid hsl(38 80% 70%);
  background: hsl(42 90% 96%);
  color: hsl(32 55% 26%);
}

.terms-warning i {
  color: hsl(35 85% 45%);
  font-size: 1.15rem;
}

/* The one control in the body text: it changes state on the page rather than
   navigating, so it is a button - styled as a link because that is what it
   reads as inside a sentence. */

.terms-consent-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: hsl(var(--primary));
  text-decoration: underline;
  cursor: pointer;
}

.terms-consent-link:hover {
  text-decoration: none;
}

.terms-consent-link:focus-visible {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 2px;
}

/* ---------- Table of contents ---------- */

.terms-toc li {
  margin-bottom: 0.4rem;
}

.terms-toc a {
  display: block;
  padding: 0.35rem 0.5rem;
  border-radius: calc(var(--radius) - 0.35rem);
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  transition:
    color 0.2s ease,
    background-color 0.2s ease;
}

.terms-toc a:hover {
  background: hsl(var(--muted));
  color: hsl(var(--primary));
}

/* ---------- Footer ---------- */

.legal-footer {
  border-top: 1px solid hsl(var(--border));
  background: hsl(var(--card));
}

.legal-footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

@media (min-width: 768px) {
  .legal-footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.legal-footer-contact,
.legal-footer-copy {
  margin: 0;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.legal-footer-contact a {
  color: hsl(var(--primary));
  text-decoration: none;
}

.legal-footer-contact a:hover {
  text-decoration: underline;
}
