/* Legal page styles — terms.html, privacy.html, cookies.html */
:root {
  --primary: #1E3A8A;
  --primary-dark: #1D2C51;
  --primary-light: #E6F1FF;
  --foreground: #1f2937;
  --muted: #6b7280;
  --background: #fcfcfc;
  --card: #ffffff;
  --border: #e5e7eb;
  --secondary: #f3f4f6;
  --green: #059669;
  --green-light: #D1FAE5;
  --amber: #d97706;
  --amber-light: #FEF3C7;
}

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

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.top-bar {
  height: 4px;
  background: linear-gradient(90deg, var(--primary-dark), #2563EB);
}

/* ─── Legal Hero ─────────────────────────────────────────────────────────── */
.legal-hero {
  background: linear-gradient(155deg, #0f1e42 0%, var(--primary) 55%, #1a4199 100%);
  padding: 64px 24px 56px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.legal-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 110%, rgba(37,99,235,0.2) 0%, transparent 65%);
  pointer-events: none;
}

.legal-hero .container {
  position: relative;
  z-index: 1;
}

.legal-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.85);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 5px 13px;
  border-radius: 5px;
  margin-bottom: 18px;
}

.legal-hero h1 {
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  line-height: 1.15;
}

.legal-hero-meta {
  font-size: 13.5px;
  color: rgba(255,255,255,0.52);
}

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.legal-layout {
  padding: 56px 24px 80px;
  background: var(--background);
}

.legal-layout .container {
  max-width: 1080px;
  margin: 0 auto;
}

.legal-inner {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 52px;
  align-items: start;
}

/* ─── TOC Sidebar ────────────────────────────────────────────────────────── */
.legal-toc {
  position: sticky;
  top: 88px;
}

.legal-toc-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.legal-toc-list {
  list-style: none;
  border-left: 2px solid var(--border);
  padding-left: 14px;
  margin-bottom: 24px;
}

.legal-toc-list li {
  margin-bottom: 8px;
  counter-increment: none;
}

.legal-toc-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  display: block;
  line-height: 1.4;
  transition: color 0.15s;
}

.legal-toc-link:hover,
.legal-toc-link.active {
  color: var(--primary);
}

.legal-toc-related {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.legal-toc-rel-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.legal-toc-rel-link {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
  margin-bottom: 7px;
  transition: opacity 0.15s;
}

.legal-toc-rel-link:hover {
  opacity: 0.75;
  text-decoration: underline;
}

/* ─── Main Content ───────────────────────────────────────────────────────── */
.legal-content {
  min-width: 0;
}

/* Intro box */
.legal-intro-box {
  background: var(--primary-light);
  border: 1px solid rgba(30,58,138,0.14);
  border-radius: 5px;
  padding: 16px 20px;
  margin-bottom: 40px;
  font-size: 14.5px;
  color: var(--primary-dark);
  line-height: 1.7;
}

/* Section blocks */
.legal-section {
  margin-bottom: 44px;
  scroll-margin-top: 96px;
}

.legal-section:last-child {
  margin-bottom: 0;
}

.legal-section h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--foreground);
  letter-spacing: -0.01em;
  margin-bottom: 12px;
  line-height: 1.3;
}

.legal-section h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--foreground);
  margin-top: 18px;
  margin-bottom: 8px;
}

.legal-section p {
  font-size: 14.5px;
  color: #374151;
  line-height: 1.75;
  margin-bottom: 12px;
}

.legal-section p:last-child {
  margin-bottom: 0;
}

/* Lists */
.legal-list {
  padding-left: 22px;
  margin-bottom: 14px;
}

.legal-list li {
  font-size: 14.5px;
  color: #374151;
  line-height: 1.7;
  margin-bottom: 6px;
}

/* Inline links */
.legal-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.legal-link:hover {
  text-decoration: underline;
}

/* Callout boxes */
.legal-callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border-radius: 5px;
  padding: 14px 16px;
  margin: 16px 0 14px;
  font-size: 14px;
  line-height: 1.65;
}

.legal-callout svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

.legal-callout p {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
}

.legal-callout-warning {
  background: var(--amber-light);
  border: 1px solid rgba(217,119,6,0.25);
  color: #92400e;
}

.legal-callout-warning svg {
  stroke: var(--amber);
}

.legal-callout-info {
  background: var(--primary-light);
  border: 1px solid rgba(30,58,138,0.15);
  color: var(--primary-dark);
}

.legal-callout-info svg {
  stroke: var(--primary);
}

/* Contact block */
.legal-contact-block {
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 16px 18px;
  font-size: 14.5px;
  color: #374151;
  line-height: 1.8;
  margin-top: 12px;
}

.legal-contact-block strong {
  font-weight: 700;
  color: var(--foreground);
}

/* ─── Tables ─────────────────────────────────────────────────────────────── */
.legal-table-wrap {
  overflow-x: auto;
  margin: 16px 0 14px;
  border-radius: 5px;
  border: 1px solid var(--border);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.legal-table th {
  background: var(--secondary);
  font-weight: 700;
  color: var(--foreground);
  padding: 11px 14px;
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.legal-table td {
  padding: 10px 14px;
  color: #374151;
  line-height: 1.6;
  border-bottom: 1px solid var(--border);
}

.legal-table tr:last-child td {
  border-bottom: none;
}

.legal-table tr:hover td {
  background: #fafafa;
}

/* ─── Cookie Categories ──────────────────────────────────────────────────── */
.cookie-category {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 18px 20px;
  margin-bottom: 14px;
}

.cookie-cat-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}

.cookie-cat-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 2px;
}

.cookie-cat-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.cookie-cat-necessary  { background: var(--green); }
.cookie-cat-functional { background: var(--primary); }
.cookie-cat-analytics  { background: var(--amber); }

.cookie-cat-sub {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
}

/* ─── Related Policies (bottom) ──────────────────────────────────────────── */
.legal-related {
  border-top: 1px solid var(--border);
  padding-top: 36px;
  margin-top: 48px;
}

.legal-related-title {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

.legal-related-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.legal-related-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--foreground);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.legal-related-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 10px rgba(30,58,138,0.08);
}

.legal-related-card svg {
  width: 16px;
  height: 16px;
  stroke: var(--primary);
  stroke-width: 1.75;
  flex-shrink: 0;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .legal-inner {
    grid-template-columns: 1fr;
  }
  .legal-toc {
    position: static;
    display: none;
  }
}

@media (max-width: 600px) {
  .legal-hero { padding: 52px 20px 48px; }
  .legal-hero .container { padding-left: 0; padding-right: 0; }
  .legal-layout { padding: 32px 20px 60px; }
  .legal-layout .container { padding-left: 0; padding-right: 0; }
  .legal-intro-box { padding: 14px 16px; margin-bottom: 28px; }
  .legal-section { margin-bottom: 32px; }
  .legal-related { padding-top: 24px; margin-top: 32px; }
  .legal-related-cards { gap: 8px; }
  .legal-related-card { padding: 8px 12px; font-size: 13px; }
}
