/* GNP-926 (architecture §112.2): the legal pages. Same colour tokens and fonts as the
   app, so they follow light / dark mode the same way (data-theme on <html>). */
@import url('../styles/variables.css');
@import url('../styles/themes/dark.css');

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.6;
}

.legal {
  max-width: 70ch;
  margin: 0 auto;
  padding: var(--space-6) var(--space-4) var(--space-12);
}

.legal__top {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  font-size: var(--text-sm);
}

.legal__brand {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  letter-spacing: 0.02em;
  color: var(--text-primary);
  text-decoration: none;
}

.legal nav a,
.legal__top a { color: var(--accent); }

/* GNP-981: English · Español, under the page links. */
.legal__lang {
  margin: calc(-1 * var(--space-4)) 0 var(--space-6);
  text-align: right;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.legal-draft {
  margin: 0 0 var(--space-6);
  padding: var(--space-3) var(--space-4);
  border: 2px dashed var(--color-red);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  font-weight: 600;
}

.legal h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-2xl);
  line-height: 1.1;
  margin: 0 0 var(--space-2);
}

.legal h2 {
  font-size: var(--text-lg);
  margin: var(--space-8) 0 var(--space-2);
}

.legal__updated {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin: 0 0 var(--space-6);
}

.legal a { color: var(--accent); overflow-wrap: anywhere; }

.legal .rule {
  padding: var(--space-3) var(--space-4);
  border-left: 4px solid var(--accent);
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  font-weight: 600;
}

/* Tables scroll inside their own box on a phone; the page itself never scrolls sideways. */
.legal__table {
  overflow-x: auto;
  margin: var(--space-3) 0;
}

.legal table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  background: var(--bg-surface);
}

.legal th,
.legal td {
  text-align: left;
  vertical-align: top;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
}

.legal code {
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

.legal__footer {
  margin-top: var(--space-10);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}
