/* ---- Legal pages (Privacy Policy, Terms, Security) ---- */
.legal-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  isolation: isolate;
  width: 100%;
  max-width: 1512px;
  margin: 0 auto;
  padding: 80px var(--gutter) 70px;
  background: #161E34;
  /* The glow below hangs 100px past the right edge. Without clipping it here
     (the same way .final-cta clips its own glow) it widens the initial
     containing block, so on a 390px phone the page lays out 490px wide: the
     extra 100px is invisible at rest but is real, pannable, empty page as soon
     as the user pinch-zooms. */
  overflow: hidden;
}

.legal-hero-gradient {
  position: absolute;
  z-index: 1;
  width: 500px;
  height: 500px;
  right: -100px;
  top: -180px;
  background: radial-gradient(70.71% 70.71% at 50% 50%, rgba(240, 158, 45, 0.2) 0%, rgba(240, 158, 45, 0) 65%);
  border-radius: 250px;
  pointer-events: none;
}

.legal-hero-container {
  position: relative;
  z-index: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0 28px;
  gap: 15.2px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.legal-hero-container .tag-dark {
  padding: 5.5px 13px 5.7px;
  background: rgba(240, 158, 45, 0.15);
  font-weight: 600;
  font-size: 12px;
  line-height: 19px;
  letter-spacing: 1.68px;
}

.legal-hero-heading {
  padding-top: 2.8px;
  font-weight: 800;
  font-size: 58px;
  line-height: 61px;
  letter-spacing: -1.16px;
  color: #FFFFFF;
}

.legal-hero-date {
  align-self: stretch;
  font-weight: 400;
  font-size: 15px;
  color: #AAB3C8;
}

.legal-layout {
  display: flex;
  align-items: flex-start;
  gap: 60px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 70px 28px 100px;
}

.legal-sidebar {
  position: sticky;
  top: 100px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 260px;
  flex-shrink: 0;
  gap: 16px;
}

.legal-back {
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 9.5px 0 9.9px;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  line-height: 22px;
  color: var(--color-dark-text);
  -webkit-tap-highlight-color: transparent;
  transition: color 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

/* The arrow keeps its own colour rather than inheriting the link's, so at rest
   it stays the lighter nav grey under the near-black label. Both ends still
   land on accent together. */
.legal-back-arrow {
  flex-shrink: 0;
  color: var(--color-nav-text);
  transition:
    color 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.24s cubic-bezier(0.33, 0.8, 0.35, 1);
}

/* Hover feedback is opt-in for real pointers only, so a tap never leaves a
   sticky :hover state behind. */
@media (hover: hover) and (pointer: fine) {
  .legal-back:hover {
      color: var(--color-accent);
      /* Snap in, ease back out, matching the nav and footer rows. */
      transition-duration: 0.14s;
    }

  /* Only the arrow travels. The label holding still is what turns the move into
       the gap stretching -- the arrow reading as leading the way back -- instead
       of the whole lockup sliding off the sidebar's left rail. 3px is enough to
       register at 16px and small enough that the rail still reads as straight. */
  .legal-back:hover .legal-back-arrow {
      color: var(--color-accent);
      transform: translateX(-3px);
      transition-duration: 0.14s, 0.18s;
    }

}

/* Colour only, no nudge: the link has zero horizontal padding, so an arrow
   pushed 3px left sits outside the border box and cuts through the ring. */
.legal-back:focus-visible {
  color: var(--color-accent);
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.legal-back:focus-visible .legal-back-arrow {
  color: var(--color-accent);
}

/* Outside the hover query on purpose: on touch the press is the only feedback
   there is, so it has to carry the whole confirmation on its own. */
.legal-back:active {
  color: var(--color-accent);
  transition-duration: 0.07s;
}

.legal-back:active .legal-back-arrow {
  color: var(--color-accent);
  transform: translateX(-3px);
  transition-duration: 0.07s;
}

/* Drop the travel, keep the colour: accent alone still confirms both states. */
@media (prefers-reduced-motion: reduce) {
  .legal-back,
    .legal-back:hover,
    .legal-back:active {
      transition: color 0.2s ease;
    }

  .legal-back-arrow,
    .legal-back:hover .legal-back-arrow,
    .legal-back:active .legal-back-arrow {
      transform: none;
      transition: color 0.2s ease;
    }

}

.legal-sidebar-title {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  align-self: stretch;
  padding: 8px 0 0;
  font-weight: 700;
  font-size: 11px;
  line-height: 18px;
  letter-spacing: 1.54px;
  text-transform: uppercase;
  color: #838A9E;
}

.legal-toc {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  align-self: stretch;
  gap: 2px;
}

.legal-toc-spacer {
  display: none;
}

.legal-toc-sentinel {
  height: 1px;
}

.legal-toc-link {
  box-sizing: border-box;
  align-self: stretch;
  padding: 7.25px 12px 7.95px;
  font-weight: 500;
  font-size: 14.5px;
  line-height: 23px;
  color: var(--color-nav-text);
  border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.18s ease, color 0.18s ease;
}

/* Hover feedback is opt-in for real pointers only, so a tap on a touch
   device never leaves a sticky :hover state behind. */
@media (hover: hover) and (pointer: fine) {
  .legal-toc-link:hover {
      background-color: #F4F6FA;
      color: var(--color-dark-text);
    }

  /* The active pill must not be overridden by hover -- it stays lit for as
       long as its section is the current one. */
  .legal-toc-link.legal-toc-active:hover {
      background-color: #FCEBCF;
      color: #C67F16;
    }

}

.legal-toc-link.legal-toc-active {
  background-color: #FCEBCF;
  color: #C67F16;
}

.legal-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 60px;
}

.legal-section {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  align-self: stretch;
  padding: 16px 0 0;
  gap: 15.3px;
}

section[id].legal-section {
  scroll-margin-top: 100px;
}

/* scripts.js focuses the section after an anchor jump (tabindex="-1", purely
   for screen-reader/keyboard users landing in the right place) -- without
   this the browser's raw default outline shows instead, which on iOS Safari
   is a heavy blue box around the whole section on every tap of a TOC link. */
section[id].legal-section:focus {
  outline: none;
}

section[id].legal-section:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 6px;
  border-radius: 4px;
}

#data-we-collect {
  gap: 9.2px;
}

#data-sharing {
  gap: 9.3px;
}

#childrens-privacy {
  gap: 17.44px;
}

#contact-us {
  gap: 17.3px;
}

#the-service {
  gap: 9.3px;
}

.legal-section h2 {
  box-sizing: border-box;
  align-self: stretch;
  padding: 0 0 14px;
  font-weight: 800;
  font-size: 30px;
  line-height: 32px;
  letter-spacing: -0.6px;
  color: var(--color-dark-text);
  border-bottom: 1px solid var(--color-border);
}

.legal-section h3 {
  box-sizing: border-box;
  align-self: stretch;
  padding: 18.8px 0 0;
  font-weight: 700;
  font-size: 18px;
  line-height: 19px;
  letter-spacing: -0.36px;
  color: var(--color-dark-text);
}

.legal-section p {
  align-self: stretch;
  font-weight: 400;
  font-size: 16px;
  line-height: 27px;
  color: var(--color-nav-text);
}

.legal-section p:first-of-type {
  padding-top: 2.145px;
}

.legal-callout {
  box-sizing: border-box;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 24.7px 22px 18px;
  background: #F3F5FB;
  border-left: 3px solid #F09E2D;
  border-radius: 0 14px 14px 0;
}

.legal-callout p {
  align-self: stretch;
  margin: 0;
  color: var(--color-dark-text);
  font-weight: 400;
  font-size: 15px;
  line-height: 26px;
}

.legal-callout p strong {
  font-weight: 700;
}

.legal-defs {
  box-sizing: border-box;
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  align-self: stretch;
  padding: 0 0 0 22px;
  gap: 7.2px;
}

.legal-defs li {
  box-sizing: border-box;
  align-self: stretch;
  isolation: isolate;
  font-size: 16px;
  line-height: 26px;
  color: var(--color-nav-text);
}

.legal-defs strong {
  color: var(--color-dark-text);
  font-weight: 700;
}

.legal-cookie-pills {
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  align-self: stretch;
  padding: 0.6px 0 0;
  gap: 8px;
}

.legal-cookie-pill {
  box-sizing: border-box;
  padding: 6px 14px;
  background: #F3F5FB;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-weight: 600;
  font-size: 13.5px;
  line-height: 22px;
  color: var(--color-nav-text);
}

.legal-contact-card {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  align-self: stretch;
  padding: 30.7px 28px 28px;
  gap: 8px;
  background: #161E34;
  border-radius: 14px;
}

.legal-contact-card h4 {
  align-self: stretch;
  font-weight: 800;
  font-size: 18px;
  line-height: 19px;
  letter-spacing: -0.36px;
  color: #FFFFFF;
}

.legal-contact-card p {
  align-self: stretch;
  margin: 0;
  padding-bottom: 5.75px;
  font-weight: 400;
  font-size: 15px;
  line-height: 26px;
  color: #8892AA;
}

.legal-contact-card a {
  font-weight: 700;
  font-size: 16px;
  line-height: 26px;
  color: var(--color-accent);
}

.legal-commitment-cards {
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: stretch;
  align-self: stretch;
  padding: 6.7px 0 0;
  gap: 16px;
}

.legal-commitment-card {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px;
  gap: 6px;
  flex: 1 1 0;
  background: #F3F5FB;
  border: 1px solid #E4E8F1;
  border-radius: 14px;
}

.legal-commitment-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  background: #161E34;
  border-radius: 12px;
  flex-shrink: 0;
}

.legal-commitment-card h4 {
  padding: 8px 0 0;
  font-weight: 700;
  font-size: 15px;
  line-height: 16px;
  letter-spacing: -0.3px;
  text-align: center;
  color: var(--color-dark-text);
}

.legal-commitment-card p {
  max-width: 218px;
  margin: 0 auto;
  font-weight: 400;
  font-size: 13.5px;
  line-height: 20px;
  text-align: center;
  color: var(--color-nav-text);
}

@media (min-width: 641px) and (max-width: 1023px) {
  /* Legal pages: the sidebar stays sticky (the docked-bar behaviour is a
       phone-only mode), it just stops eating the content column. */
  .legal-layout {
      gap: 40px;
    }

  .legal-sidebar {
      width: 220px;
    }

}

@media (max-width: 640px) {
  /* Legal pages */
  .legal-hero {
      padding: 48px 20px 40px;
    }

  .legal-hero-heading {
      font-size: 32px;
      line-height: 34px;
      letter-spacing: -0.64px;
    }

  .legal-layout {
      flex-direction: column;
      gap: 32px;
      padding: 40px 20px 64px;
    }

  .legal-sidebar {
      position: static;
      width: 100%;
      gap: 16px;
    }

  /* The in-flow bar is styled with exactly the same box as the docked bar
       (same padding, same full-bleed width, same 1px bottom edge). Docking
       therefore changes no geometry at all -- only the surface fades in --
       so there is no jump, no reflow and no measurement race. */
  .legal-toc {
      flex-direction: row;
      flex-wrap: nowrap;
      align-items: center;
      overflow-x: auto;
      overscroll-behavior-x: contain;
      gap: 4px;
      width: calc(100% + 40px);
      margin: 0 -20px;
      padding: 10px 20px;
      background: #FFFFFF;
      border-bottom: 1px solid transparent;
      scroll-behavior: smooth;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
      /* No will-change here: the bar is already composited as a scroll container,
         so it bought no extra layer, and permanently promoting a position:fixed
         element leaves it rasterised at the pre-pinch scale for the length of a
         zoom gesture. */
      transition:
        border-color 0.24s ease,
        box-shadow 0.3s ease,
        transform 0.34s cubic-bezier(0.32, 0.72, 0, 1),
        opacity 0.2s ease;
    }

  .legal-toc.legal-toc-stuck {
      position: fixed;
      top: var(--legal-header-h, 72px);
      left: 0;
      right: 0;
      width: auto;
      margin: 0;
      z-index: 90;
      border-bottom-color: var(--color-border);
      box-shadow: 0 10px 20px -16px rgba(22, 30, 52, 0.55);
    }

  .legal-toc.legal-toc-stuck.legal-toc-hidden {
      transform: translateY(-115%);
      opacity: 0;
      pointer-events: none;
    }

  /* Height is written by JS from the bar's own measured height. */
  .legal-toc-spacer.legal-toc-spacer-active {
      display: block;
      width: 100%;
    }

  .legal-toc::-webkit-scrollbar {
      display: none;
    }

  .legal-toc-link {
      flex-shrink: 0;
      white-space: nowrap;
    }

  section[id].legal-section {
      scroll-margin-top: calc(var(--legal-header-h, 72px) + var(--legal-toc-h, 59px));
    }

  /* Not part of the mobile design: the focus outline added for keyboard/AT
     users after a TOC jump (see the base section[id].legal-section:focus
     rule) is desktop-only. Touch users on mobile never see it anyway since
     tapping doesn't trigger :focus-visible in most browsers, but Safari iOS
     is an exception -- this rule is what actually suppresses it there. */
  section[id].legal-section:focus-visible {
      outline: none;
    }

  .legal-section h2 {
      font-size: 24px;
    }

  .legal-commitment-cards {
      flex-direction: column;
      gap: 12px;
    }

  .legal-commitment-card {
      flex: 1 1 auto;
      width: 100%;
    }

  @media (prefers-reduced-motion: reduce) {
    .legal-toc {
          scroll-behavior: auto;
          transition: none;
        }

  }

}

