/* ============================================================
   GRID LAYOUT — using div#legal-main to avoid style.css conflicts
   ============================================================ */
div#legal-main {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  max-width: 1040px;
  margin: 0 auto;
  padding: 48px 48px 100px;
  align-items: start;
  box-sizing: border-box;
}

div#legal-main .legal-toc {
  position: sticky;
  top: 28px;
  background: #fff;
  border-radius: 16px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  border: 1px solid #efefef;
  align-self: start;
  /* Prevent style.css from collapsing it */
  width: 100%;
  min-width: 0;
}

div#legal-main .legal-body {
  min-width: 0;
}

@media (max-width: 860px) {
  div#legal-main {
    grid-template-columns: 1fr;
    padding: 24px 20px 80px;
    gap: 16px;
  }
  div#legal-main .legal-toc {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    padding: 12px;
  }
}

/* ============================================================
   HEADSTART PH — legal.css
   Styled to match the learn.css dashboard system
   Typography: Poppins (headings) + Inter (body)
   Accents: #f97316 orange, #00c67a green
   ============================================================ */

/* ── BACK BUTTON ── */
.legal-back {
  position: fixed;
  top: 18px;
  left: 20px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #fff;
  border: 1.5px solid #e8e8e8;
  border-radius: 100px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  text-decoration: none;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1);
}
.legal-back:hover {
  border-color: #f97316;
  color: #f97316;
  transform: translateX(-2px);
  box-shadow: 0 4px 16px rgba(249,115,22,0.15);
}
.legal-back svg { flex-shrink: 0; }

/* ── RESET style.css CONFLICTS ── */
body {
  background: #f4f6f8 !important;
  font-family: 'Inter', sans-serif;
  display: block !important;   /* override style.css flex */
}

/* layout handled by div#legal-main */

/* ── HERO ── */
.legal-hero {
  background: #fff;
  border-bottom: 1px solid #efefef;
  padding: 80px 48px 48px;
  position: relative;
  overflow: hidden;
}

.legal-hero-glow {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(249,115,22,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.legal-hero-inner {
  max-width: 860px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.legal-hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #f97316;
  background: rgba(249,115,22,0.08);
  border: 1px solid rgba(249,115,22,0.18);
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 18px;
}

.legal-hero-title {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 800;
  color: #111;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 12px;
}

.legal-hero-sub {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: #888;
  line-height: 1.7;
  max-width: 480px;
  margin: 0 0 24px;
}

.legal-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.legal-meta-badge {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #888;
  background: #f4f4f4;
  padding: 5px 12px;
  border-radius: 100px;
  border: 1px solid #efefef;
}

/* ── LAYOUT — grid is now on div#legal-main, see top of file ── */
.legal-container { /* kept for any other usage */ }

/* ── TABLE OF CONTENTS ── */
/* .legal-toc layout is handled by div#legal-main .legal-toc above */
.legal-toc { /* style-only properties below */ }

.legal-toc-label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #bbb !important;
  background: transparent !important;
  padding: 0 8px;
  margin-bottom: 6px;
}

.legal-toc a {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #888;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 0.15s;
  line-height: 1.4;
  border-left: 2px solid transparent;
}
.legal-toc a:hover {
  color: #111;
  background: #f5f5f5;
  border-left-color: #f97316;
  padding-left: 12px;
}

/* ── BODY ── */
.legal-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Intro callout */
.legal-intro {
  background: #fff;
  border-radius: 20px;
  padding: 24px 28px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.8;
  color: #666;
  border-left: 3px solid #f97316;
  margin-bottom: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.legal-intro strong { color: #111; font-weight: 600; }

/* ── SECTION CARDS ── */
.legal-body section {
  background: #fff;
  border-radius: 20px;
  padding: 28px 32px;
  margin-bottom: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  border: 1px solid #f0f0f0;
  transition: box-shadow 0.2s;
}
.legal-body section:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.07);
}

.legal-body h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 17px;
  font-weight: 800;
  color: #111;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  /* hard reset any inherited gradient from style.css */
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  -webkit-text-fill-color: #111 !important;
}

.legal-num {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: #f97316;
  background: rgba(249,115,22,0.08);
  border: 1px solid rgba(249,115,22,0.18);
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.legal-body p {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.8;
  color: #666;
  margin-bottom: 12px;
  font-weight: 400 !important;
}
.legal-body p:last-child { margin-bottom: 0; }
.legal-body p strong { color: #111; font-weight: 600; }

/* ── LIST ITEMS AS CARDS ── */
.legal-body ul {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legal-body ul li {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  line-height: 1.7;
  color: #666;
  background: #f9f9f9;
  border: 1px solid #f0f0f0;
  border-radius: 12px;
  padding: 12px 16px 12px 40px;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
}
.legal-body ul li:hover {
  background: #fff;
  border-color: rgba(249,115,22,0.2);
}
.legal-body ul li::before {
  content: '→';
  position: absolute;
  left: 14px;
  top: 12px;
  color: #f97316;
  font-weight: 700;
  font-size: 12px;
}
.legal-body ul li strong { color: #111; font-weight: 600; }

/* ── WARNING CALLOUT (TOS) ── */
.legal-callout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(249,115,22,0.05);
  border: 1.5px solid rgba(249,115,22,0.2);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 18px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #c2410c;
  line-height: 1.5;
}
.legal-callout::before {
  content: '⚠️';
  flex-shrink: 0;
  font-size: 14px;
  margin-top: 1px;
}

/* ── RIGHTS GRID ── */
.legal-rights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.legal-right-card {
  background: #f9f9f9;
  border: 1px solid #f0f0f0;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1);
}
.legal-right-card:hover {
  background: #fff;
  border-color: rgba(0,198,122,0.25);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}

.legal-right-icon {
  font-size: 20px;
  margin-bottom: 2px;
  line-height: 1;
}
.legal-right-card strong {
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #111;
}
.legal-right-card p {
  font-size: 11px !important;
  color: #999;
  line-height: 1.5;
  margin: 0 !important;
}

/* ── CONTACT BUTTON ── */
.legal-contact-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  background: #111;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  border-radius: 100px;
  text-decoration: none;
  margin: 12px 0 16px;
  transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}
.legal-contact-link:hover {
  background: #333;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

.legal-also-see {
  font-size: 13px !important;
  color: #aaa !important;
}
.legal-also-see a {
  color: #f97316;
  text-decoration: none;
  font-weight: 600;
}
.legal-also-see a:hover { text-decoration: underline; }

/* ── FOOTER ── */
.legal-footer {
  background: #fff;
  border-top: 1px solid #f0f0f0;
  padding: 22px 48px;
}

.legal-footer-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.legal-footer-logo {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 15px;
  color: #111;
  letter-spacing: -0.01em;
}
.legal-footer-logo span { color: #00c67a; }

.legal-footer-copy {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: #aaa;
}

.legal-footer-links {
  display: flex;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.legal-footer-links a {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #aaa;
  text-decoration: none;
  transition: color 0.15s;
}
.legal-footer-links a:hover { color: #111; }
.legal-footer-links a.active { color: #f97316; }

/* ── RESPONSIVE ── */
@media (max-width: 860px) {
  .legal-container {
    grid-template-columns: 1fr;
    padding: 24px 20px 80px;
    gap: 16px;
  }
  .legal-toc {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    padding: 12px;
  }
  .legal-toc-label { width: 100%; margin-bottom: 4px; }
  .legal-toc a { font-size: 11px; padding: 5px 8px; }
  .legal-hero { padding: 72px 20px 36px; }
  .legal-body section { padding: 20px; }
  .legal-footer { padding: 18px 20px; }
  .legal-footer-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .legal-back { top: 12px; left: 12px; }
}

@media (max-width: 480px) {
  .legal-rights-grid { grid-template-columns: 1fr 1fr; }
  .legal-hero-title { font-size: 28px; }
}