/* =====================================================
   CPROAT — LEGAL PAGES STYLESHEET
   legal.css
   ===================================================== */

/* ---- Google Font import ---- */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&display=swap');

/* ---- Design tokens ---- */
:root {
  --green:        #16a34a;
  --green-light:  #22c55e;
  --green-pale:   #f0fdf4;
  --green-border: rgba(22, 163, 74, 0.25);

  --text:         #0f172a;
  --text-muted:   #64748b;
  --text-dim:     #94a3b8;

  --bg:           #f8fafc;
  --bg-white:     #ffffff;
  --border:       #e2e8f0;
  --border-strong:#cbd5e1;

  --radius:       12px;
  --radius-sm:    8px;

  --shadow-sm:    0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:    0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
}

a {
  text-decoration: none;
  color: var(--green);
  transition: color .18s ease, opacity .18s ease;
}
a:hover { color: var(--green-light); }

/* =====================================================
   TOP NAVIGATION BAR
   ===================================================== */

.legal-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.legal-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.legal-logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.legal-logo svg { flex-shrink: 0; }
.legal-logo:hover { color: var(--green); }

.legal-nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.legal-nav-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}
.legal-nav-link:hover { color: var(--green); }

.legal-nav-badge {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
  white-space: nowrap;
}

/* =====================================================
   PAGE HERO HEADER
   ===================================================== */

.legal-hero {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  padding: 52px 24px 44px;
  text-align: center;
}

.legal-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green);
  background: var(--green-pale);
  border: 1px solid var(--green-border);
  border-radius: 20px;
  padding: 4px 12px;
  margin-bottom: 20px;
}

.legal-hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 12px;
}

.legal-hero-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
.legal-hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* =====================================================
   MAIN LAYOUT
   ===================================================== */

.legal-body {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  align-items: start;
}

/* =====================================================
   SIDEBAR TABLE OF CONTENTS
   ===================================================== */

.legal-toc {
  position: sticky;
  top: 80px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.legal-toc-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.legal-toc ol {
  list-style: none;
  counter-reset: toc-counter;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.legal-toc li {
  counter-increment: toc-counter;
}

.legal-toc a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-muted);
  padding: 5px 8px;
  border-radius: 6px;
  line-height: 1.4;
  transition: all .15s ease;
}
.legal-toc a::before {
  content: counter(toc-counter);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-dim);
  min-width: 16px;
  flex-shrink: 0;
}
.legal-toc a:hover {
  color: var(--green);
  background: var(--green-pale);
}
.legal-toc a.active {
  color: var(--green);
  font-weight: 600;
  background: var(--green-pale);
}

/* =====================================================
   LEGAL CONTENT
   ===================================================== */

.legal-content {
  min-width: 0;
}

/* Jump links (inline, shown on mobile instead of sidebar) */
.legal-jumps {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
  padding: 16px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.legal-jumps a {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  white-space: nowrap;
  transition: all .15s ease;
}
.legal-jumps a:hover {
  color: var(--green);
  border-color: var(--green-border);
  background: var(--green-pale);
}

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

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

/* Section heading with green left border */
.legal-section h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.3;
  padding-left: 16px;
  border-left: 3px solid var(--green);
  margin-bottom: 20px;
  scroll-margin-top: 88px;
}

.legal-section h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  margin-top: 24px;
}

.legal-section h3:first-child { margin-top: 0; }

.legal-section p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.75;
}
.legal-section p:last-child { margin-bottom: 0; }

.legal-section p strong {
  color: var(--text);
  font-weight: 600;
}

/* Lists */
.legal-section ul,
.legal-section ol {
  margin: 0 0 16px 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.legal-section ul { list-style: disc; }
.legal-section ol { list-style: decimal; }

.legal-section li {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.65;
  padding-left: 4px;
}
.legal-section li strong { color: var(--text); font-weight: 600; }
.legal-section li:last-child { margin-bottom: 0; }

/* Info / highlight boxes */
.legal-box {
  background: var(--green-pale);
  border: 1px solid var(--green-border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.65;
}
.legal-box strong { color: var(--green); }
.legal-box p { color: var(--text); margin-bottom: 8px; }
.legal-box p:last-child { margin-bottom: 0; }

.legal-box-neutral {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
}
.legal-box-neutral p { color: var(--text-muted); margin-bottom: 8px; }
.legal-box-neutral p:last-child { margin-bottom: 0; }

.legal-box-warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 0.9rem;
  color: #92400e;
  line-height: 1.65;
}

/* Contact card */
.legal-contact-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-top: 20px;
  box-shadow: var(--shadow-sm);
}
.legal-contact-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--green-pale);
  border: 1px solid var(--green-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.legal-contact-card-body h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.legal-contact-card-body p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}
.legal-contact-card-body a {
  color: var(--green);
  font-weight: 500;
}

/* Data table */
.legal-table-wrap {
  overflow-x: auto;
  margin: 20px 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  background: var(--bg-white);
}
.legal-table th {
  background: var(--bg);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.legal-table td {
  padding: 11px 14px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.55;
}
.legal-table tr:last-child td { border-bottom: none; }
.legal-table td strong { color: var(--text); font-weight: 600; }
.legal-table tr:hover td { background: var(--bg); }

/* Divider */
.legal-divider {
  height: 1px;
  background: var(--border);
  margin: 40px 0;
}

/* =====================================================
   FOOTER
   ===================================================== */

.legal-footer {
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  padding: 40px 24px;
}

.legal-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.legal-footer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.legal-footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
.legal-footer-brand:hover { color: var(--green); }

.legal-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
}
.legal-footer-links a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}
.legal-footer-links a:hover { color: var(--green); }
.legal-footer-links a.active {
  color: var(--green);
  font-weight: 600;
}

.legal-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.legal-footer-copy {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.legal-footer-country {
  font-size: 0.82rem;
  color: var(--text-dim);
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 820px) {
  .legal-body {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 32px 20px 64px;
  }

  .legal-toc {
    display: none;
  }

  .legal-jumps {
    display: flex;
  }

  .legal-hero {
    padding: 36px 20px 32px;
  }

  .legal-footer-top {
    flex-direction: column;
    gap: 16px;
  }

  .legal-footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .legal-nav-right { gap: 12px; }
  .legal-nav-badge { display: none; }
  .legal-hero h1 { font-size: 1.5rem; }
  .legal-section h2 { font-size: 1.1rem; }
}
