/* Shared styles for legal/privacy/terms pages */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #F21427;
  --primary-hover: #D4101F;
  --primary-light: #ff4d5e;
  --primary-glow: rgba(242, 20, 39, 0.10);
  --bg: #141E27;
  --bg-elevated: #1A2832;
  --bg-card: #1F2D38;
  --bg-card-hover: #263744;
  --border: #2C3B48;
  --border-light: rgba(255,255,255,0.10);
  --text: #FFFFFF;
  --text-muted: #6B7A85;
  --text-secondary: #A0ADB8;
}
[data-theme="light"] {
  --bg: #f8fafc;
  --bg-elevated: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f4f4f6;
  --border: #e2e8f0;
  --border-light: rgba(0,0,0,0.10);
  --text: #0f172a;
  --text-muted: #94a3b8;
  --text-secondary: #475569;
}
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: clip;
  line-height: 1.65;
}

/* Page bg */
.page-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.page-bg::before {
  content: ''; position: absolute; inset: 0;
  background-image: url('../img/login-bg-opt.jpg');
  background-size: cover; background-position: center;
  opacity: 0.5;
}
[data-theme="light"] .page-bg::before { opacity: 0.15; }
.page-bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,30,39,0.94) 0%, rgba(20,30,39,0.92) 40%, rgba(20,30,39,0.97) 100%);
}
[data-theme="light"] .page-bg::after {
  background: linear-gradient(180deg, rgba(248,250,252,0.92) 0%, rgba(248,250,252,0.9) 40%, rgba(248,250,252,0.98) 100%);
}
nav, .legal-hero, .legal-content, footer { position: relative; z-index: 1; }

/* Nav */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100; padding: 20px 40px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(20, 30, 39, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] nav { background: rgba(248, 250, 252, 0.88); }
.nav-logo { display: flex; align-items: center; text-decoration: none; }
.nav-logo img { height: 32px; width: auto; }
.logo-light { display: none; }
[data-theme="light"] .logo-dark { display: none; }
[data-theme="light"] .logo-light { display: block; }
.nav-links { display: flex; gap: 32px; align-items: center; flex: 1; justify-content: center; }
.nav-links a {
  color: var(--text-muted); text-decoration: none;
  font-size: 0.875rem; font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }
.nav-right { display: flex; align-items: center; gap: 12px; }
.btn-nav-cta { font-size: 0.8rem; padding: 0 20px; height: 36px; line-height: 1; }
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 24px; background: #F21427; color: #fff;
  border: none; border-radius: 10px;
  font-size: 0.875rem; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.btn-primary:hover {
  background: #D4101F; transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(242, 20, 39, 0.3);
}
.lang-switcher { position: relative; }
.lang-current {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 36px; height: 36px; padding: 0 10px;
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text); font-size: 0.7rem; font-weight: 600;
  cursor: pointer; border-radius: 8px;
  transition: all 0.15s; font-family: inherit;
}
.lang-current:hover { border-color: var(--text-muted); }
.lang-current svg { width: 10px; height: 10px; opacity: 0.5; transition: transform 0.15s; }
.lang-switcher.open .lang-current svg { transform: rotate(180deg); }
.lang-dropdown {
  display: none; position: absolute; top: 100%; right: 0; margin-top: 4px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; min-width: 120px; padding: 4px; z-index: 200;
}
.lang-switcher.open .lang-dropdown { display: block; }
.lang-option {
  display: block; width: 100%; text-align: left;
  padding: 8px 12px; background: none; border: none;
  color: var(--text); font-size: 0.8rem; cursor: pointer;
  border-radius: 4px; font-family: inherit;
}
.lang-option:hover { background: var(--bg-card-hover); }
.lang-option.active { color: var(--primary); font-weight: 600; }
.theme-toggle {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  cursor: pointer; color: var(--text);
  display: flex; align-items: center; justify-content: center;
}
.theme-toggle:hover { border-color: var(--text-muted); }
.icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* Hero */
.legal-hero {
  padding: 140px 40px 32px;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}
/* When the page has a side TOC, shift the hero so its centerline matches the content column */
.legal-hero.with-toc {
  max-width: 1180px;
  padding-left: calc(40px + 240px + 56px);
  padding-right: 40px;
}
.legal-label {
  display: inline-block;
  font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 16px;
}
.legal-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800; line-height: 1.2;
  margin-bottom: 12px;
  color: var(--text);
}
.legal-updated {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Content */
.legal-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 40px 80px;
  color: var(--text-secondary);
}
/* 2-column layout when there's a TOC */
.legal-content.with-toc {
  max-width: 1180px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 56px;
  align-items: start;
}
.legal-content.with-toc .legal-sections { min-width: 0; max-width: 760px; }
.legal-content section { margin-bottom: 36px; }
.legal-content h2 {
  font-size: 1.25rem; font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.legal-content h3 {
  font-size: 1rem; font-weight: 600;
  color: var(--text);
  margin: 20px 0 8px;
}
.legal-content p { margin-bottom: 12px; font-size: 0.9375rem; }
.legal-content ul, .legal-content ol {
  margin: 8px 0 16px 24px;
  font-size: 0.9375rem;
}
.legal-content li { margin-bottom: 6px; }
.legal-content a {
  color: var(--primary);
  text-decoration: none;
}
.legal-content a:hover { text-decoration: underline; }
.legal-content strong { color: var(--text); font-weight: 600; }
.legal-content code {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--text);
}
.legal-content .placeholder {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.85em;
  font-weight: 600;
}
.legal-content .toc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 32px;
}
.legal-content.with-toc .toc {
  position: sticky;
  top: 96px;
  margin-bottom: 0;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.legal-content .toc h3 {
  margin: 0 0 12px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border: none;
  padding: 0;
}
.legal-content .toc ol {
  margin: 0;
  padding-left: 20px;
  font-size: 0.8125rem;
}
.legal-content .toc li { margin-bottom: 6px; }
.legal-content .toc a {
  color: var(--text-secondary);
  transition: color 0.15s;
}
.legal-content .toc a:hover { color: var(--primary); }
.legal-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 16px;
  font-size: 0.875rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.legal-content th, .legal-content td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.legal-content th {
  background: var(--bg-elevated);
  color: var(--text);
  font-weight: 600;
  font-size: 0.8125rem;
}
.legal-content tr:last-child td { border-bottom: none; }

/* Footer */
footer {
  padding: 32px 40px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-logo { display: flex; align-items: center; }
.footer-logo img { height: 24px; width: auto; }
.footer-copy { font-size: 0.8125rem; color: var(--text-muted); }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-decoration: none;
}
.footer-links a:hover { color: var(--text); }

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 16px; left: 16px; right: 16px;
  max-width: 560px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  z-index: 500;
  transform: translateY(120%);
  transition: transform 0.4s cubic-bezier(.2,.7,.2,1);
}
.cookie-banner.visible { transform: translateY(0); }
.cookie-banner p {
  flex: 1; margin: 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.cookie-ok {
  flex-shrink: 0;
  padding: 8px 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.cookie-ok:hover { background: var(--primary-hover); }

/* Responsive */
@media (max-width: 1024px) {
  .legal-content.with-toc {
    grid-template-columns: 1fr;
    gap: 0;
    max-width: 760px;
  }
  .legal-content.with-toc .toc {
    position: static;
    max-height: none;
    margin-bottom: 32px;
  }
  .legal-hero.with-toc {
    max-width: 760px;
    padding: 140px 40px 32px;
  }
}
@media (max-width: 640px) {
  nav { padding: 16px 20px; }
  .nav-links { display: none; }
  .legal-hero { padding: 110px 20px 24px; }
  .legal-hero h1 { font-size: 1.6rem; }
  .legal-content { padding: 12px 20px 64px; }
  .legal-content h2 { font-size: 1.125rem; }
  footer { flex-direction: column; gap: 12px; text-align: center; }
}
@media (max-width: 480px) {
  .cookie-banner { padding: 12px; gap: 10px; }
  .cookie-banner p { font-size: 0.75rem; }
  .cookie-ok { padding: 7px 12px; font-size: 0.75rem; }
}
