/* ═══════════════════════════════════════════════════════════════
   LUSONUSA — Standalone styles for legal pages and 404
   Self-contained: no dependency on style.css, no web fonts loaded.
   Tokens mirror style.css :root.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg-dark:       #0B0D12;
  --bg-dark-alt:   #10131A;
  --bg-card:       rgba(255, 255, 255, 0.04);
  --accent-luso:   #3B82F6;
  --accent-nusa:   #E11D48;
  --text-main:     #F8FAFC;
  --text-body:     #CBD5E1;
  --text-muted:    #94A3B8;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(255, 255, 255, 0.14);
  --font-display: 'Cinzel', 'Trajan Pro', 'Times New Roman', Georgia, serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --radius-md: 12px;
  --radius-pill: 100px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  background: var(--bg-dark);
  color: var(--text-body);
  line-height: 1.7;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: #93C5FD; text-underline-offset: 3px; }
a:hover { color: var(--text-main); }
:focus-visible { outline: 2px solid var(--accent-luso); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute; left: 1rem; top: -100px;
  background: var(--text-main); color: var(--bg-dark);
  padding: .5rem 1rem; border-radius: 6px; z-index: 10; text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── Header ────────────────────────────────────────────────── */
.legal-header {
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(11, 13, 18, 0.92);
  position: sticky; top: 0; z-index: 5;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.legal-header-inner {
  max-width: 1080px; margin: 0 auto; padding: .85rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--text-main); }
.brand img { width: 32px; height: 32px; }
.brand-word { font-family: var(--font-display); font-weight: 700; letter-spacing: .12em; font-size: 1.05rem; }
.brand-word .l { color: var(--accent-luso); }
.brand-word .n { color: var(--accent-nusa); }
.legal-nav { display: flex; gap: 1.25rem; flex-wrap: wrap; font-size: .9rem; }
.legal-nav a { color: var(--text-muted); text-decoration: none; }
.legal-nav a:hover, .legal-nav a[aria-current="page"] { color: var(--text-main); }

/* ── Main document ─────────────────────────────────────────── */
main { flex: 1; width: 100%; }
.legal-doc { max-width: 780px; margin: 0 auto; padding: 3rem 1.25rem 4rem; }
.eyebrow {
  display: inline-block; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: .75rem;
}
.legal-doc h1 {
  font-family: var(--font-display); color: var(--text-main);
  font-size: clamp(1.9rem, 4.5vw, 2.6rem); line-height: 1.2; letter-spacing: .02em;
}
.bridge-bar { display: flex; width: 120px; height: 3px; margin: 1.25rem 0 1.5rem; }
.bridge-bar span { flex: 1; background: var(--accent-luso); }
.bridge-bar span + span { background: var(--accent-nusa); }
.meta { font-size: .9rem; color: var(--text-muted); }
.lead { font-size: 1.08rem; color: var(--text-main); margin-top: 1.25rem; }

.legal-doc h2 {
  font-family: var(--font-display); color: var(--text-main);
  font-size: 1.35rem; line-height: 1.3; margin: 2.75rem 0 .85rem; padding-top: .5rem; letter-spacing: .02em;
  scroll-margin-top: 80px;
}
.legal-doc h3 { color: var(--text-main); font-size: 1.05rem; margin: 1.6rem 0 .5rem; font-weight: 600; }
.legal-doc p, .legal-doc ul, .legal-doc ol { margin-bottom: 1rem; }
.legal-doc ul, .legal-doc ol { padding-left: 1.35rem; }
.legal-doc li { margin-bottom: .4rem; }
.legal-doc li::marker { color: var(--text-muted); }
.legal-doc strong { color: var(--text-main); font-weight: 600; }

.toc {
  margin: 2rem 0 0; padding: 1.25rem 1.5rem;
  background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
}
.toc p { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); margin-bottom: .5rem; }
.toc ol { margin: 0; columns: 2; column-gap: 2rem; font-size: .93rem; }
.toc a { color: var(--text-body); text-decoration: none; }
.toc a:hover { color: var(--text-main); text-decoration: underline; }

.callout {
  border: 1px solid var(--border-active); border-left: 3px solid var(--accent-luso);
  background: var(--bg-card); border-radius: var(--radius-md);
  padding: 1rem 1.25rem; margin: 1.25rem 0;
}
.callout.nusa { border-left-color: var(--accent-nusa); }
.callout p:last-child { margin-bottom: 0; }

.table-wrap { overflow-x: auto; margin: 1rem 0 1.25rem; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 520px; }
th, td { text-align: left; vertical-align: top; padding: .7rem .9rem; border-bottom: 1px solid var(--border-subtle); }
th { color: var(--text-main); font-weight: 600; background: rgba(255, 255, 255, 0.03); }
tr:last-child td { border-bottom: 0; }

.summary { margin-top: 2.75rem; padding: 1.25rem 1.5rem; border-radius: var(--radius-md); background: var(--bg-dark-alt); border: 1px solid var(--border-subtle); }
.summary h2 { margin-top: 0; }

/* ── Footer ────────────────────────────────────────────────── */
.legal-footer { border-top: 1px solid var(--border-subtle); background: var(--bg-dark-alt); font-size: .88rem; color: var(--text-muted); }
.legal-footer-inner {
  max-width: 1080px; margin: 0 auto; padding: 1.75rem 1.25rem;
  display: flex; flex-wrap: wrap; gap: .75rem 2rem; justify-content: space-between; align-items: center;
}
.legal-footer nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.legal-footer a { color: var(--text-muted); }
.legal-footer a:hover { color: var(--text-main); }

/* ── Buttons (404) ─────────────────────────────────────────── */
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; margin-top: 2rem; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 44px;
  padding: .7rem 1.35rem; border-radius: var(--radius-pill);
  font-weight: 600; font-size: .95rem; text-decoration: none;
  border: 1px solid var(--border-active); color: var(--text-main); background: var(--bg-card);
  transition: background .2s, border-color .2s;
}
.btn:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.25); color: var(--text-main); }
.btn-primary { background: var(--accent-luso); border-color: var(--accent-luso); }
.btn-primary:hover { background: #2563EB; border-color: #2563EB; }
.btn-wa { background: #128C3E; border-color: #128C3E; }
.btn-wa:hover { background: #0F7A35; border-color: #0F7A35; }

.notfound { max-width: 640px; margin: 0 auto; padding: 5rem 1.25rem 4rem; text-align: center; }
.notfound .code {
  font-family: var(--font-display); font-weight: 700; line-height: 1;
  font-size: clamp(5rem, 22vw, 9rem); letter-spacing: .05em;
}
.notfound .code .l { color: var(--accent-luso); }
.notfound .code .n { color: var(--accent-nusa); }
.notfound h1 { font-family: var(--font-display); color: var(--text-main); font-size: clamp(1.5rem, 4vw, 2rem); line-height: 1.25; margin-top: 1rem; }
.notfound .bridge-bar { margin: 1.25rem auto 1.5rem; }
.notfound p { color: var(--text-body); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 640px) {
  .legal-header-inner { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .legal-header { position: static; }
  .legal-doc { padding-top: 2rem; }
  .toc ol { columns: 1; }
  table { min-width: 0; font-size: .84rem; }
  th, td { padding: .6rem .55rem; overflow-wrap: break-word; hyphens: auto; }
  td code { overflow-wrap: anywhere; }
  .legal-footer-inner { flex-direction: column; align-items: flex-start; }
}

@media print {
  body { background: #fff; color: #000; }
  .legal-header, .legal-footer, .toc, .skip-link { display: none; }
  .legal-doc h1, .legal-doc h2, .legal-doc h3, .legal-doc strong { color: #000; }
  a { color: #000; }
}

/* Reveal-on-click button for the operator's NIF */
.reveal-btn {
  font: inherit; font-size: .9em; cursor: pointer;
  padding: .15rem .6rem; border-radius: 999px;
  background: rgba(255, 255, 255, 0.06); color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.reveal-btn:hover { background: rgba(255, 255, 255, 0.12); }
.reveal-btn:focus-visible { outline: 2px solid var(--accent-luso); outline-offset: 2px; }
.revealed-value { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
