/* ============================================================
   legal.css — shared styles for privacy.html and terms.html
   Matches the Factusesión landing design system (factusesion-com).

   Brand tokens extracted from src/index.css:
     --accent:       #0065A9 (primary blue)
     --accent-2:     #28AE97 (teal)
     --accent-2-soft:#50E6CD (soft teal)
     --dark:         #18162B (near-black)
     --text-main:    #18162B
     --text-muted:   #5b6478
     --bg-soft:      #f6f8fb
     --border-soft:  #ECEEF3
   Fonts: Inter (UI), Outfit (display), Poppins (accents) — same as landing.
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Outfit:wght@300;400;500;600;700;800&family=Poppins:wght@600;700&display=swap');

/* ── CSS custom properties (brand tokens) ── */
:root {
  --accent:        #0065A9;
  --accent-hover:  #004f87;
  --accent-2:      #28AE97;
  --accent-2-soft: #50E6CD;
  --dark:          #18162B;
  --text-main:     #18162B;
  --text-muted:    #5b6478;
  --bg-soft:       #f6f8fb;
  --card-bg:       #ffffff;
  --border-soft:   #ECEEF3;
  --shadow-soft:   0 1px 2px rgba(24,22,43,0.04), 0 8px 24px rgba(24,22,43,0.05);
  --radius-md:     16px;
  --radius-sm:     10px;
  --transition:    all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

/* ── Minimal reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base document ── */
html { font-size: 16px; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-soft);
  color: var(--text-main);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   HEADER
   ============================================================ */
.legal-header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  z-index: 100;
}

.legal-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 48px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* Logo link — same visual treatment as .c6-logo in landing */
.legal-logo {
  display: inline-flex;
  align-items: center;
  height: 22px;
  text-decoration: none;
  flex-shrink: 0;
}

.legal-logo img {
  height: 100%;
  width: auto;
  display: block;
}

/* "Back to home" text link */
.legal-back {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.25s ease;
}

.legal-back:hover { color: var(--accent); }

.legal-back-arrow {
  display: inline-block;
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.25s ease;
}

.legal-back:hover .legal-back-arrow { transform: translateX(-3px); }

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
.legal-main {
  flex: 1;
  padding: 56px 24px 80px;
}

/* Centered reading column — 720px max for comfortable line length */
.legal-content {
  max-width: 720px;
  margin: 0 auto;
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 56px 64px;
  box-shadow: var(--shadow-soft);
}

/* ── Document title (H1) ── */
.legal-content h1 {
  font-family: 'Outfit', 'Inter', system-ui, sans-serif;
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -1px;
  color: var(--text-main);
  margin-bottom: 8px;
}

/* Last-updated caption below H1 */
.legal-last-updated {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 40px;
  display: block;
}

/* ── Section headings ── */
.legal-content h2 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.3px;
  color: var(--text-main);
  margin: 40px 0 12px;
  padding-top: 8px;
  /* Subtle left accent line */
  border-left: 3px solid var(--accent);
  padding-left: 14px;
}

/* First H2 right after the intro gets less top margin */
.legal-content h1 + p + h2,
.legal-content .legal-last-updated + div + h2,
.legal-content .legal-last-updated + h2 {
  margin-top: 24px;
}

.legal-content h3 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.2px;
  color: var(--text-main);
  margin: 24px 0 8px;
}

/* ── Body text ── */
.legal-content p {
  font-size: 0.96rem;
  line-height: 1.75;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ── Lists ── */
.legal-content ul,
.legal-content ol {
  padding-left: 24px;
  margin-bottom: 16px;
}

.legal-content li {
  font-size: 0.96rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.legal-content li strong {
  color: var(--text-main);
}

/* ── Emphasis ── */
.legal-content strong {
  font-weight: 700;
  color: var(--text-main);
}

/* ── Inline code (for OAuth scope strings) ── */
.legal-content code {
  font-family: 'Menlo', 'Consolas', 'Liberation Mono', monospace;
  font-size: 0.82rem;
  background: rgba(0, 101, 169, 0.07);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 5px;
  letter-spacing: 0;
  word-break: break-all;
}

/* ── Links ── */
.legal-content a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid rgba(0, 101, 169, 0.25);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.legal-content a:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}

/* ── Notice / callout block (the "under review" banner) ── */
.legal-notice {
  background: rgba(0, 101, 169, 0.05);
  border-left: 3px solid var(--accent);
  padding: 14px 18px;
  margin-bottom: 32px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.legal-notice strong { color: var(--text-main); }

/* ── Divider between major sections ── */
.legal-content h2 + p::first-line { /* intentionally empty — h2 border handles separation */ }

/* ============================================================
   FOOTER
   ============================================================ */
.legal-footer {
  background: var(--dark);
  color: rgba(255, 255, 255, 0.6);
  padding: 32px 48px;
  margin-top: auto;
}

.legal-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.legal-footer-copy {
  font-size: 0.84rem;
  line-height: 1.5;
}

.legal-footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.legal-footer-links a {
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: color 0.25s ease;
}

.legal-footer-links a:hover { color: #ffffff; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  .legal-header-inner { padding: 0 24px; }
  .legal-content { padding: 40px 32px; }
  .legal-content h1 { font-size: 1.9rem; letter-spacing: -0.6px; }
  .legal-footer { padding: 28px 24px; }
  .legal-footer-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .legal-footer-links { gap: 16px; }
}

@media (max-width: 560px) {
  .legal-main { padding: 24px 12px 56px; }
  .legal-content { padding: 28px 20px; border-radius: 12px; }
  .legal-content h1 { font-size: 1.6rem; }
  .legal-content h2 { font-size: 1.05rem; }
  .legal-header-inner { padding: 0 16px; }
  .legal-footer { padding: 24px 16px; }
}

/* ── Accessibility: focus visible for keyboard navigation ── */
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ── Reduce motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
