/*!
 * Lína — css/legal.css
 * Copyright © 2025–2026 Hyperfokal LLC. All rights reserved.
 * Proprietary and confidential. Unauthorized copying, modification,
 * distribution, or use of this file, via any medium, is prohibited.
 * Not licensed for use in training machine-learning or AI models.
 */
/* Terms, Privacy and Cookie policies: the reader, the "updated" prompt and
   the sign-up box (round 75) */

.legal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(14, 13, 19, 0.72);
  backdrop-filter: blur(3px);
}
/* Above every other window, below toasts; the reader opens over the prompt */
.legal-gate-overlay { z-index: 99000; background: rgba(14, 13, 19, 0.86); }
.legal-reader-overlay { z-index: 99100; }

.legal-meta { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }

/* ---------- Reader ---------- */
.legal-reader {
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}
.legal-reader-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
}
.legal-reader-title { font-size: 18px; font-weight: 600; color: var(--text-primary); }
.legal-older {
  margin: 12px 22px 0;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  background: rgba(209, 139, 60, 0.10);
  border: 1px solid rgba(209, 139, 60, 0.35);
}
.legal-body {
  padding: 8px 22px 22px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
}
.legal-body h2, .legal-body h3, .legal-body h4, .legal-body h5 { margin: 22px 0 8px; line-height: 1.3; color: var(--text-primary); }
.legal-body h2 { font-size: 18px; }
.legal-body h3 { font-size: 16px; }
.legal-body h4, .legal-body h5 { font-size: 14px; }
.legal-body p { margin: 0 0 10px; }
.legal-body ul { margin: 0 0 12px; padding-left: 22px; }
.legal-body li { margin: 3px 0; }
.legal-body hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.legal-body a, .legal-older a, .legal-check a, .legal-gate-summary a { color: var(--accent); }
.legal-reader-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 22px;
  border-top: 1px solid var(--border);
}

/* ---------- The "updated" prompt ---------- */
.legal-gate {
  width: min(600px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
  padding: 24px 26px 22px;
}
.legal-gate-brand { display: flex; align-items: center; gap: 8px; font-family: "Staatliches", var(--font-ui); font-size: 22px; letter-spacing: 1px; color: var(--text-primary); }
.legal-gate-logo { width: 26px; height: 26px; }
.legal-gate-title { margin: 16px 0 6px; font-size: 20px; font-weight: 600; color: var(--text-primary); line-height: 1.3; }
.legal-gate-intro { margin: 0 0 16px; color: var(--text-secondary); font-size: 14px; }
.legal-gate-docs { display: grid; gap: 10px; margin-bottom: 16px; }
.legal-gate-doc { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: rgba(255, 255, 255, 0.02); }
.legal-gate-doc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.legal-gate-doc-title { font-weight: 600; color: var(--text-primary); }
.legal-gate-summary { margin-top: 10px; font-size: 13px; line-height: 1.5; color: var(--text-primary); }
.legal-gate-summary p { margin: 0 0 6px; }
.legal-gate-summary ul { margin: 0 0 6px; padding-left: 20px; }
.legal-gate-summary-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); font-weight: 600; margin-bottom: 4px; }
.legal-gate-error { margin: 10px 0 0; padding: 8px 12px; border-radius: 6px; font-size: 13px; color: #ffb4a8; background: rgba(229, 115, 115, 0.12); border: 1px solid rgba(229, 115, 115, 0.35); }
.legal-gate-error[hidden] { display: none; }
.legal-gate-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ---------- The agreement box (sign-up and the prompt) ---------- */
.legal-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-primary);
  cursor: pointer;
}
.legal-check input { margin-top: 2px; width: 16px; height: 16px; flex: none; accent-color: var(--accent); cursor: pointer; }
.auth-terms { margin: 4px 0 12px; }

/* ---------- Sidebar footer links ---------- */
.sidebar-legal-links { margin-top: 4px; }
.sidebar-legal-links a { color: inherit; text-decoration: none; }
.sidebar-legal-links a:hover { color: var(--text-primary); text-decoration: underline; }

@media (max-width: 600px) {
  .legal-overlay { padding: 0; align-items: stretch; }
  .legal-reader, .legal-gate { max-height: none; height: 100%; border-radius: 0; width: 100%; }
}
