/* ============================================================
   EME ENGINEERING LIMITED — legal pages stylesheet
   Loaded by privacy.html and terms-of-service.html only.
   Dark theme to match the homepage body.
   ============================================================ */

:root {
  --bg: #0A0E14;
  --bg-elev: #0F1620;
  --surface: #141D2A;
  --border: #233246;
  --border-soft: #1C2836;
  --text: #E9EDF2;
  --muted: #9AA7B8;
  --muted-2: #7C8A9C;
  --accent: #34E09B;
  --accent-strong: #1FC98A;
  --accent-ink: #062318;
  --accent-2: #F472B6;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

/* The legal body background is defined here, not inherited from style.css,
   because legal pages load ONLY this stylesheet. */
.legal-page {
  background-color: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Scope isolation: never let homepage section styling paint over legal text. */
.legal-page .legal-content section {
  background-color: transparent !important;
}

/* ---------------- Legal header (a <header> element) ---------------- */

.legal-header {
  background: linear-gradient(135deg, #10231E 0%, #0D1820 100%);
  border-bottom: 1px solid var(--border);
  padding: 64px 24px 52px;
  text-align: center;
}

.legal-header .container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

.legal-header .legal-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.legal-header h1 {
  color: var(--text);
  font-size: 40px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}

.legal-header .legal-updated {
  color: var(--muted);
  font-size: 14px;
}

.legal-header a {
  color: var(--accent);
}

/* ---------------- Legal content ---------------- */

.legal-content {
  padding: 64px 0 48px;
}

.legal-content .container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

.legal-content section {
  margin-bottom: 40px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--border-soft);
}

.legal-content section:last-of-type {
  border-bottom: none;
}

.legal-content h2 {
  color: var(--text);
  font-size: 26px;
  line-height: 1.25;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.3px;
}

.legal-content h3 {
  color: var(--text);
  font-size: 19px;
  font-weight: 700;
  margin: 24px 0 10px;
}

.legal-content p {
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 16px;
}

.legal-content ul {
  list-style: disc;
  padding-left: 24px;
  margin-bottom: 16px;
}

.legal-content li {
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 8px;
}

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

.legal-content a {
  color: var(--accent);
  text-decoration: underline;
}

/* ---------------- Table of contents ---------------- */

.toc {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px 28px;
  margin-bottom: 44px;
}

.toc h2 {
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.toc ol {
  list-style: none;
  counter-reset: toc;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
}

.toc li {
  counter-increment: toc;
  margin-bottom: 0;
}

.toc a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.toc a::before {
  content: counter(toc, decimal-leading-zero);
  color: var(--accent);
  font-weight: 700;
  margin-right: 8px;
}

.toc a:hover {
  color: var(--accent);
}

/* ---------------- Back to top ---------------- */

.back-top {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent);
  font-size: 14px;
  text-decoration: none;
}

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

/* ---------------- Legal footer ---------------- */

.legal-footer {
  background-color: var(--bg-elev);
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  text-align: center;
}

.legal-footer .container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

.legal-footer p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 10px;
}

.legal-footer a {
  color: var(--accent);
  text-decoration: none;
  margin: 0 10px;
  font-size: 14px;
}

.legal-footer a:hover {
  color: var(--accent-strong);
}

/* ---------------- Responsive ---------------- */

@media (max-width: 720px) {
  .legal-header h1 {
    font-size: 30px;
  }

  .toc ol {
    grid-template-columns: 1fr;
  }

  .legal-content h2 {
    font-size: 22px;
  }
}
