/* ============================================================
   Terms & Conditions – FINAL, FIXED & SAFE
============================================================ */

/* ------------------------------------------------------------
   GLOBAL SAFETY OVERRIDES
------------------------------------------------------------ */

html {
  scroll-behavior: smooth;
}

html,
body {
  height: auto !important;
  overflow-y: auto !important;
  overflow-x: hidden;
  background: #ffffff !important;
}

body.home-dark-preview.includes-loaded {
  background: #ffffff !important;
}

body.home-dark-preview .subnav__link {
  color: #ffffff !important;
}

body.home-dark-preview .subnav__link:hover,
body.home-dark-preview .subnav__link:focus {
  color: #ffffff !important;
}

body.home-dark-preview .subnav__link.is-active,
body.home-dark-preview .subnav__link[aria-current="page"] {
  color: rgb(47, 127, 69) !important;
}

/* ------------------------------------------------------------
   Accessibility
------------------------------------------------------------ */

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  background: #ffffff;
  color: #111827;
  padding: 8px 12px;
  border-radius: 6px;
  z-index: 10000;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* ------------------------------------------------------------
   Page Wrapper
------------------------------------------------------------ */

main.terms-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 20px;

  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

/* Force left alignment (override marketing pages) */
main.terms-page,
main.terms-page * {
  text-align: left !important;
}

/* ------------------------------------------------------------
   Intro / Meta
------------------------------------------------------------ */

.notice {
  background: #f8f9fb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 12px 0;
}

.small {
  font-size: 0.95rem;
  color: #4b5563;
}

/* ------------------------------------------------------------
   Layout
------------------------------------------------------------ */

.terms-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}

@media (max-width: 980px) {
  .terms-layout {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------
   Cards
------------------------------------------------------------ */

.card {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff;
  overflow: visible;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.06);
}

.card__head {
  padding: 12px 14px;
  border-bottom: 1px solid #eef0f3;
  background: #fafbfc;
}

.card__title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.card__body {
  padding: 14px 16px;
}

/* ------------------------------------------------------------
   Sticky Table of Contents (LEFT COLUMN) — NO NUMBERS
------------------------------------------------------------ */

.toc-card {
  position: sticky;
  top: 120px;
  align-self: start;
  height: calc(100vh - 140px);
  overflow: visible;
}

.toc-card .card__body {
  max-height: calc(100vh - 190px); /* header + padding allowance */
  overflow-y: auto;
}


.toc {
  margin: 0;
  padding-left: 0;
  list-style: none;        /* removes numbers/bullets */
  max-height: 100%;
  overflow-y: auto;
}

.toc li {
  margin: 6px 0;
  line-height: 1.4;
}

.toc a {
  color: #0b0e3f;
  text-decoration: none;
  display: block;
}

.toc a:hover {
  text-decoration: underline;
}


/* ------------------------------------------------------------
   Terms Document Content
------------------------------------------------------------ */

.tc-doc {
  padding: 0;
}

/* Each Article */
.tc-article {
  padding: 20px 0;
  border-bottom: 1px solid #eef0f3;

  /* Anchor offset for fixed header */
  scroll-margin-top: 120px;
}

.tc-article:last-child {
  border-bottom: none;
}

/* Article headings */
.tc-article h2 {
  margin: 6px 0 12px;
  font-size: 18px;
  line-height: 1.25;
  color: #0b0e3f;
}

/* ------------------------------------------------------------
   Clauses
------------------------------------------------------------ */

.tc-clause {
  margin: 18px 0 6px;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 600;
  color: #0b0e3f;
  display: flex;
  align-items: center;
}

.tc-clause__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 46px;
  padding: 4px 10px;
  margin-right: 8px;

  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.04);

  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.2px;
  color: #0b0e3f;
}

/* Paragraph text */
.tc-doc p {
  margin: 8px 0;
  color: #111827;
  line-height: 1.55;
  font-size: 14.5px;
}

/* ------------------------------------------------------------
   Definitions (Article 1)
------------------------------------------------------------ */

.tc-defs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;

  margin: 14px 0 6px;
  padding: 14px;

  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.02);
}

.tc-defs dt {
  font-weight: 700;
  margin-top: 6px;
  color: #111827;
}

.tc-defs dd {
  margin: 4px 0 0;
  color: #374151;
  line-height: 1.55;
  font-size: 14px;
}

/* ------------------------------------------------------------
   Print Optimisation
------------------------------------------------------------ */

@media print {
  html,
  body {
    overflow: visible !important;
  }

  .terms-layout {
    grid-template-columns: 1fr;
  }

  .toc-card {
    display: none;
  }

  .card {
    box-shadow: none;
    border: none;
  }

  main.terms-page {
    padding: 0;
  }
}
/* ------------------------------------------------------------
   TOC Section Dividers
------------------------------------------------------------ */

.toc-divider {
  margin: 14px 0 8px;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
  list-style: none;
}

.toc-divider span {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #6b7280;
}
/* ============================================================
   ✅ Sticky TOC + Right-panel scrolling (TOC always visible)
============================================================ */

/* 1) Make the whole layout fill the viewport height */
.terms-layout {
  min-height: calc(100vh - 64px); /* adjust if you have a taller header */
}

/* 2) Lock the grid to the viewport so only the right pane scrolls */
@media (min-width: 981px) {
  main.terms-page {
    height: calc(100vh - 64px);  /* adjust header offset if needed */
    overflow: hidden !important; /* prevent page scrolling */
  }

  .terms-layout {
    height: 100%;
    overflow: hidden;            /* contain scrolling to the right column */
  }

  /* 3) Left column (TOC) stays visible */
  .toc-card {
    position: sticky;
    top: 120px;                  /* your header offset */
    height: calc(100vh - 140px); /* visible height under header */
    overflow: hidden;            /* keep TOC body scrolling only */
  }

  .toc-card .card__body {
    height: calc(100vh - 190px); /* header + padding allowance */
    overflow-y: auto;
  }

  /* 4) Right column becomes the scroll container */
  .tc-doc.card {
    height: calc(100vh - 140px); /* match TOC height so they align */
    overflow-y: auto;
    overflow-x: hidden;
  }
}

/* 5) Mobile: revert to normal page scrolling */
@media (max-width: 980px) {
  main.terms-page {
    height: auto !important;
    overflow: visible !important;
  }

  .tc-doc.card {
    height: auto !important;
    overflow: visible !important;
  }
}
/* ============================================
   Temporary access lock (Terms page)
============================================ */
.tc-lock {
  position: fixed;
  inset: 0;
  background: #0b0e3f;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  font-family: inherit;
}

.tc-lock__box {
  background: #ffffff;
  color: #111111;
  padding: 2rem;
  border-radius: 12px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.tc-lock__box h2 {
  margin-top: 0;
}

.tc-lock input {
  width: 100%;
  padding: 0.6rem;
  margin-top: 0.75rem;
  font-size: 1rem;
}

.tc-lock button {
  margin-top: 1rem;
  padding: 0.6rem 1rem;
  width: 100%;
  cursor: pointer;
}
/* ------------------------------------------------------------
   Lists inside Terms (smaller, supporting text)
------------------------------------------------------------ */

.tc-doc ul,
.tc-doc ol {
  margin: 8px 0 10px 18px;
  padding-left: 16px;
}

.tc-doc li {
  font-size: 13.5px;     /* slightly smaller than paragraph text */
  line-height: 1.5;
  color: #374151;        /* softer than main paragraph text */
  margin: 6px 0;
}
