/* ============================================================
   Nailian — Legal pages stylesheet (privacy + terms)
   Loaded ONLY on /privacy and /terms-of-service
   ============================================================ */

:root {
  --bg: #F7F5F0;
  --bg-alt: #EFECE3;
  --card: #FFFFFF;
  --ink: #1A1A1A;
  --ink-soft: #33383F;
  --muted: #5A6070;
  --line: #E4DFD3;
  --accent: #2B5CE6;
  --accent-deep: #16348F;
  --accent-soft: #E8EEFF;
  --hero: #122F8F;
  --hero-2: #1B4BD8;
  --white: #FFFFFF;
  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

/* The legal body background must be defined here — legal pages
   do NOT load style.css, so this is the only source of background. */
.legal-page {
  background-color: #F7F5F0;
  color: #1A1A1A;
  font-size: 16px;
  font-family: var(--font-body);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Scope isolation — guarantee homepage section styling can never
   paint dark backgrounds over legal text. Scoped to content only. */
.legal-page .legal-content section {
  background-color: transparent !important;
}

a {
  color: var(--accent-deep);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Legal header (element, never a section) ---------- */

.legal-header {
  background: linear-gradient(160deg, var(--hero) 0%, var(--hero-2) 100%);
  padding: 72px 0 64px;
  color: var(--white);
}

.legal-header .container {
  max-width: 1180px;
}

.legal-brand {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 34px;
}

.legal-brand:hover {
  color: var(--accent-soft);
  text-decoration: none;
}

.legal-header h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  color: var(--white);
  margin-bottom: 16px;
}

.legal-meta {
  color: #C9D6FF;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

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

.toc {
  background-color: var(--bg-alt);
  border-bottom: 1px solid var(--line);
  padding: 32px 0;
}

.toc-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

.toc-title {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

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

.toc-list a {
  color: var(--ink-soft);
  font-size: 0.92rem;
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 4px 0;
}

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

.toc-num {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.8rem;
}

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

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

/* Any max-width container must also center itself and carry
   horizontal padding so the text column never hugs the edge. */
.legal-content .container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

.legal-content section {
  margin-bottom: 54px;
  scroll-margin-top: 24px;
}

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

.legal-content h2 {
  font-size: 1.65rem;
  color: var(--ink);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.legal-content h3 {
  font-size: 1.15rem;
  color: var(--ink-soft);
  margin: 24px 0 12px;
}

.legal-content p {
  color: var(--ink-soft);
  margin-bottom: 16px;
  font-size: 1rem;
}

.legal-content ul {
  margin: 0 0 18px 22px;
  color: var(--ink-soft);
}

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

.legal-content strong {
  color: var(--ink);
  font-weight: 600;
}

.legal-content a {
  font-weight: 500;
}

.section-number {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.legal-note {
  background-color: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 18px 20px;
  color: var(--ink-soft);
  margin: 20px 0;
}

.legal-note p {
  margin-bottom: 0;
}

/* ---------- Footer ---------- */

.legal-footer {
  background-color: #1A1A1A;
  color: #B9BEC9;
  padding: 40px 0;
}

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

.legal-footer p {
  font-size: 0.9rem;
  color: #8A909E;
  margin-bottom: 14px;
}

.legal-footer a {
  color: var(--white);
  font-weight: 600;
  margin: 0 12px;
}

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

.back-home {
  display: inline-block;
  margin-top: 6px;
  padding: 10px 22px;
  border: 1px solid #3A3F4A;
  border-radius: 6px;
  color: var(--white);
  font-weight: 600;
}

.back-home:hover {
  border-color: var(--white);
  text-decoration: none;
}

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

@media (max-width: 640px) {
  .toc-list {
    grid-template-columns: 1fr;
  }

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