/* Styling for the public legal pages served beside the app (/privacy-policy, /terms, ...).
   Reuses the landing page's colour tokens from auth-shell.css so the pages read as part of TifoXR
   rather than as a bare document dump. Long-form reading, so: a measured column, generous line height,
   and headings that stay legible on a phone. */

.legal-body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(1100px 700px at 12% -10%, rgba(110, 247, 77, 0.10), transparent 60%),
              linear-gradient(160deg, var(--tifo-bg-2) 0%, var(--tifo-bg) 62%);
  color: var(--tifo-text);
  font-family: var(--tifo-font);
  -webkit-text-size-adjust: 100%;
}

.legal-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--tifo-border);
}

.legal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--tifo-text);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.legal-brand img { display: block; border-radius: 6px; }

.legal-main {
  flex: 1;
  width: 100%;
  /* Padding inside the width: without it a phone got 100% plus the padding and every page ran 36px off screen. */
  box-sizing: border-box;
  max-width: 868px;      /* 820px of text plus the side padding - full-width legal text is punishing to read */
  margin: 0 auto;
  padding: 40px 24px 64px;
  line-height: 1.7;
  font-size: 1rem;
}

.legal-main h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  line-height: 1.25;
  margin: 0 0 8px;
}

.legal-main h2 {
  font-size: clamp(1.1rem, 2.6vw, 1.35rem);
  margin: 36px 0 10px;
  color: var(--tifo-accent);
}

.legal-main h3 {
  font-size: 1.05rem;
  margin: 24px 0 8px;
  color: var(--tifo-text);
}

.legal-main p { margin: 0 0 14px; color: var(--tifo-text); }
.legal-main ul { margin: 0 0 16px; padding-left: 22px; }
.legal-main li { margin-bottom: 6px; }

.legal-main a {
  color: var(--tifo-accent);
  overflow-wrap: break-word;   /* a full address like the DPO page's is wider than a phone and has no space to break at */
}

.legal-updated {
  color: var(--tifo-muted);
  font-size: 0.9rem;
  margin-bottom: 28px !important;
}

/* Policy tables (the cookie inventory). A plain grid here; on a phone each row becomes a card (see the media query),
   because five columns of long text in a 360px column either overflow the page or wrap one word per line. */
.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 20px;
  font-size: 0.92rem;
  line-height: 1.5;
}

.legal-table th,
.legal-table td {
  border: 1px solid var(--tifo-border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;   /* names like __Secure-1PSIDTS have nowhere else to break */
}

.legal-table th {
  background: var(--tifo-card);
  color: var(--tifo-muted);
  font-weight: 600;
}

.legal-table td:first-child { font-weight: 600; }

/* Unmistakable on screen: a page that is not ready must not look finished. */
.legal-placeholder {
  border: 1px solid var(--tifo-danger);
  border-radius: 10px;
  padding: 16px 18px;
  color: var(--tifo-text);
  background: rgba(255, 82, 64, 0.10);
}

.legal-footer {
  border-top: 1px solid var(--tifo-border);
  padding: 22px 24px 34px;
  color: var(--tifo-muted);
  font-size: 0.85rem;
  text-align: center;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: center;
  margin-bottom: 12px;
}

.legal-links a {
  color: var(--tifo-muted);
  text-decoration: none;
  /* Comfortably tappable on a phone without turning the footer into a wall of buttons. */
  padding: 6px 2px;
}

.legal-links a:hover, .legal-links a:focus-visible {
  color: var(--tifo-accent);
  text-decoration: underline;
}

@media (max-width: 560px) {
  .legal-header { padding: 14px 16px; }
  .legal-main { padding: 28px 18px 52px; }
  .legal-brand span { display: none; }   /* the logos still identify us; the word costs a phone too much */

  /* Each row becomes a card titled by its first cell; every other value sits under its column name. The header
     row stays in the document, visually hidden, so screen readers still announce the columns. */
  .legal-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .legal-table, .legal-table tbody, .legal-table tr, .legal-table td { display: block; }
  .legal-table tr {
    border: 1px solid var(--tifo-border);
    border-radius: 10px;
    background: var(--tifo-card);
    padding: 6px 14px;
    margin-bottom: 12px;
  }
  .legal-table td { border: none; padding: 6px 0; }
  .legal-table td::before {
    content: attr(data-label);
    display: block;
    color: var(--tifo-muted);
    font-size: 0.78rem;
    font-weight: 600;
  }
  .legal-table td:first-child { font-size: 1rem; }
  .legal-table td:first-child::before { display: none; }
}
