/* ============================================================
   Buy Drive Auto — Legal Stylesheet (privacy & terms)
   Light theme · cream canvas · teal accent
   ============================================================ */

.legal-page {
  background-color: #F7F5F0;
  color: #1A1A1A;
}

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

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

body {
  font-size: 16px;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.75;
  color: #1A1A1A;
  background-color: #F7F5F0;
  overflow-x: hidden;
}

a {
  color: #0F766E;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ---------- Legal header (solid gradient, never a section) ---------- */
.legal-header {
  background: linear-gradient(135deg, #0B5D52 0%, #0F766E 48%, #123B4F 100%);
  color: #FFFFFF;
  padding: 72px 24px 48px;
  text-align: center;
}

.legal-header .header-inner {
  max-width: 800px;
  margin: 0 auto;
}

.legal-header .back-link {
  display: inline-block;
  color: #D6E9E4;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 20px;
  border: 1px solid #D6E9E4;
  border-radius: 999px;
  padding: 6px 18px;
}

.legal-header .back-link:hover {
  background-color: #FFFFFF;
  color: #0B5D52;
  text-decoration: none;
}

.legal-header h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  color: #FFFFFF;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.legal-header .legal-meta {
  margin-top: 16px;
  color: #EAF4F1;
  font-size: 0.95rem;
}

/* ---------- Legal content ---------- */
.legal-content {
  padding: 56px 0 72px;
}

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

/* Scope isolation — never let homepage section styling leak in */
.legal-page .legal-content section {
  background-color: transparent !important;
}

.legal-page .legal-content h1,
.legal-page .legal-content h2,
.legal-page .legal-content h3,
.legal-page .legal-content p,
.legal-page .legal-content li {
  color: #1A1A1A;
}

/* Table of contents */
.legal-toc {
  background-color: #FFFFFF;
  border: 1px solid #E4DFD4;
  border-radius: 16px;
  padding: 28px 30px;
  margin-bottom: 48px;
}

.legal-toc h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #0F766E;
  margin-bottom: 16px;
  font-weight: 700;
}

.legal-toc ol {
  list-style: none;
  counter-reset: toc;
}

.legal-toc li {
  counter-increment: toc;
  margin-bottom: 10px;
  border-bottom: 1px solid #F0ECE4;
  padding-bottom: 10px;
}

.legal-toc li:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.legal-toc a {
  color: #1A1A1A;
  font-weight: 500;
  display: flex;
  gap: 12px;
}

.legal-toc a::before {
  content: counter(toc, decimal-leading-zero);
  color: #0F766E;
  font-weight: 700;
  font-size: 0.85rem;
}

.legal-toc a:hover {
  color: #0F766E;
}

/* Sections */
.legal-content section {
  margin-bottom: 48px;
  scroll-margin-top: 40px;
}

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

.legal-content h2 {
  font-size: 1.6rem;
  color: #1A1A1A;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #D6E9E4;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.legal-content h3 {
  font-size: 1.15rem;
  color: #0B5D52;
  margin: 22px 0 10px;
  font-weight: 700;
}

.legal-content p {
  color: #3A4044;
  margin-bottom: 16px;
}

.legal-content ul {
  margin: 0 0 18px 22px;
  color: #3A4044;
}

.legal-content li {
  margin-bottom: 8px;
}

.legal-content strong {
  color: #1A1A1A;
}

/* ---------- Legal footer ---------- */
.legal-footer {
  background-color: #093F38;
  color: #C8DCD6;
  padding: 40px 24px;
  text-align: center;
}

.legal-footer .footer-inner {
  max-width: 800px;
  margin: 0 auto;
}

.legal-footer p {
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.legal-footer .home-link {
  display: inline-block;
  background-color: #0F766E;
  color: #FFFFFF;
  font-weight: 700;
  border-radius: 999px;
  padding: 10px 24px;
  margin-bottom: 16px;
}

.legal-footer .home-link:hover {
  background-color: #0B5D52;
  text-decoration: none;
}

.legal-footer .legal-nav {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  margin-bottom: 16px;
}

.legal-footer .legal-nav a {
  color: #D6E9E4;
}

@media (max-width: 640px) {
  .legal-header {
    padding: 56px 24px 40px;
  }

  .legal-toc {
    padding: 22px 20px;
  }

  .legal-content h2 {
    font-size: 1.35rem;
  }
}
