/* ===========================================================================
   legal.css — the Terms of Service and Privacy Policy pages.

   Self-contained on purpose: these two pages are public, they are read by
   people who have never seen the product, and they must not change shape
   because something moved in style.css. Only global.css (the design tokens)
   is loaded alongside this file.

   Approved in previews/preview_legal_pages_v3.html. Every .lg-* rule below is
   the same rule that preview carries.
   =========================================================================== */

:root {
  --lg-ink: #12202B;
  --lg-body: #42505C;
  --lg-muted: #7A8592;
  --lg-line: #E4E9EC;
  --lg-bg: #F6F8F9;
  --lg-amber-bg: #FFF4E5;
  --lg-amber-line: #E8A400;
  --lg-amber-ink: #8A5A00;
}

* { box-sizing: border-box }

body {
  margin: 0;
  background: var(--lg-bg);
  color: var(--lg-body);
  font-family: var(--font-b);
  font-size: var(--t-4);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.lg-wrap { max-width: 1080px; margin: 0 auto; padding: 28px 24px 70px }

/* ---- under development: what a visitor gets instead of the document ----- */
/* The text is withheld server-side, so there is nothing here to reveal with a
   stylesheet off, a reader mode, or view-source. */
.lg-gate { padding: 74px 44px 78px; text-align: center; max-width: 560px; margin: 0 auto }
.lg-gate__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 16px;
  background: var(--lg-amber-bg); color: var(--lg-amber-ink); margin-bottom: 20px;
}
.lg-gate h1 {
  font-family: var(--font-h); font-size: var(--t-8); font-weight: 700;
  color: var(--lg-ink); margin: 0 0 12px; letter-spacing: -.4px; text-wrap: balance;
}
.lg-gate .lg-ver { margin-bottom: 22px }
.lg-gate__lead { font-size: var(--t-5); color: var(--lg-ink); margin: 0 0 8px; text-wrap: balance }
.lg-gate__body { margin: 0 auto 20px; max-width: 46ch; text-wrap: pretty }
.lg-gate__foot {
  font-family: var(--font-h); font-size: var(--t-2); font-weight: 600;
  letter-spacing: .04em; color: var(--lg-muted); margin: 0 0 26px;
}
.lg-gate__back {
  display: inline-flex; align-items: center; border-radius: 100px;
  background: var(--primary-color, #04696F); color: #fff; text-decoration: none;
  font-family: var(--font-h); font-size: var(--t-3); font-weight: 600;
  padding: 10px 24px;
}
.lg-gate__back:hover { background: var(--secondary-color, #035459) }
.lg-gate__back:focus-visible { outline: 2px solid var(--primary-color, #04696F); outline-offset: 2px }

/* ---- the page ----------------------------------------------------------- */
.lg-page {
  background: #fff; border-radius: 18px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(18, 32, 43, .06);
}
.lg-top {
  display: flex; align-items: center; justify-content: space-between; gap: 14px 20px;
  flex-wrap: wrap; padding: 20px 44px; border-bottom: 1px solid var(--lg-line);
}
.lg-brand { display: inline-flex; align-items: center; text-decoration: none }
.lg-brand .lg-logomark { display: block }
.lg-top nav { display: flex; gap: 14px 22px; font-size: var(--t-3); align-items: center; flex-wrap: wrap }
/* The child combinator matters: the language toggle's links are also inside
   this nav, and `.lg-top nav a.on` (0-2-2) would outrank `.lg-lang a.on`
   (0-2-1) and paint the active language teal on a teal pill — invisible. */
.lg-top nav > a { color: var(--lg-muted); text-decoration: none }
.lg-top nav > a:hover { color: var(--primary-color, #04696F) }
.lg-top nav > a.on { color: var(--primary-color, #04696F); font-weight: 600 }

.lg-hero { padding: 44px 44px 26px; border-bottom: 1px solid var(--lg-line) }
.lg-hero h1 {
  font-family: var(--font-h); font-size: 34px; font-weight: 700;
  color: var(--lg-ink); margin: 0 0 10px; letter-spacing: -.5px; text-wrap: balance;
}
.lg-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: var(--t-3); color: var(--lg-muted) }
.lg-meta b { color: var(--lg-ink); font-weight: 600 }
.lg-ver {
  display: inline-flex; align-items: center; gap: 6px;
  background: #E1EDEE; color: var(--primary-color, #04696F);
  border-radius: 100px; padding: 3px 12px;
  font-family: var(--font-h); font-size: var(--t-1); font-weight: 600;
}
.lg-ver.is-draft { background: var(--lg-amber-bg); color: var(--lg-amber-ink) }

.lg-body { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 34px; padding: 30px 44px 46px }
.lg-toc {
  position: sticky; top: 20px; align-self: start; font-size: var(--t-3);
  max-height: calc(100vh - 44px); overflow-y: auto;
}
.lg-toc div {
  font-family: var(--font-h); font-size: var(--t-1); font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--lg-muted); margin-bottom: 10px;
}
.lg-toc a {
  display: block; color: var(--lg-body); text-decoration: none;
  padding: 4px 0 4px 10px; border-left: 2px solid transparent;
}
.lg-toc a:hover { color: var(--primary-color, #04696F) }
.lg-toc a.on { color: var(--primary-color, #04696F); font-weight: 600; border-left-color: var(--primary-color, #04696F) }

.lg-txt h2 {
  font-family: var(--font-h); font-size: var(--t-6); font-weight: 600;
  color: var(--lg-ink); margin: 30px 0 8px;
  scroll-margin-top: 24px;
}
.lg-txt h2:first-child { margin-top: 0 }
.lg-txt h3 {
  font-family: var(--font-h); font-size: var(--t-4); font-weight: 600;
  color: var(--lg-ink); margin: 20px 0 6px;
}
.lg-txt p { margin: 0 0 12px; max-width: 70ch }
.lg-txt ul { margin: 0 0 14px; padding-left: 20px; max-width: 70ch }
.lg-txt li { margin: 5px 0 }
.lg-txt strong { color: var(--lg-ink) }

.lg-note {
  background: var(--lg-bg); border: 1px solid var(--lg-line); border-radius: 10px;
  padding: 13px 16px; margin: 0 0 16px; font-size: var(--t-3); max-width: 70ch;
}
.lg-note b { color: var(--lg-ink) }

.lg-tbl { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: var(--t-3); max-width: 70ch }
.lg-tbl th {
  text-align: left; font-family: var(--font-h); font-size: var(--t-1);
  letter-spacing: .06em; text-transform: uppercase; color: var(--lg-muted);
  border-bottom: 1px solid var(--lg-line); padding: 0 12px 7px 0;
}
.lg-tbl td { padding: 9px 12px 9px 0; border-bottom: 1px solid #F1F4F6; vertical-align: top }
.lg-tbl td:first-child { color: var(--lg-ink); font-weight: 600; width: 34% }

.lg-foot {
  border-top: 1px solid var(--lg-line); padding: 22px 44px 30px;
  display: flex; gap: 20px; justify-content: space-between; flex-wrap: wrap;
  font-size: var(--t-3); color: var(--lg-muted);
}
.lg-foot a { color: var(--primary-color, #04696F); text-decoration: none }
.lg-foot a:hover { text-decoration: underline }

/* A passage still waiting on the owner or a lawyer. Deliberately loud: a
   placeholder that reads as settled wording is the failure mode here. */
.todo {
  background: var(--lg-amber-bg); border-bottom: 1px dashed var(--lg-amber-line);
  color: var(--lg-amber-ink); padding: 0 3px; border-radius: 2px;
}

/* ---- the language toggle ------------------------------------------------ */
/* Two links, not two buttons: each language has its own URL, so a reader can
   send a colleague the Arabic page rather than the page plus an instruction. */
.lg-lang { display: inline-flex; border: 1px solid var(--lg-line); border-radius: 100px; overflow: hidden }
.lg-lang a {
  background: #fff; text-decoration: none; font-family: var(--font-h);
  font-size: var(--t-2); font-weight: 600; color: var(--lg-muted); padding: 6px 15px;
}
.lg-lang a:hover { color: var(--primary-color, #04696F) }
.lg-lang a.on { background: var(--primary-color, #04696F); color: #fff }
.lg-lang a:focus-visible { outline: 2px solid var(--primary-color, #04696F); outline-offset: -2px }

/* ---- Arabic: the same page, mirrored ------------------------------------ */
[dir="rtl"] .lg-body,
[dir="rtl"] .lg-hero,
[dir="rtl"] .lg-foot,
[dir="rtl"] .lg-top { direction: rtl; text-align: right }
[dir="rtl"] .lg-txt,
[dir="rtl"] .lg-toc { font-family: 'Noto Naskh Arabic', 'Geeza Pro', 'Segoe UI', serif }
[dir="rtl"] .lg-txt h2,
[dir="rtl"] .lg-txt h3,
[dir="rtl"] .lg-hero h1,
[dir="rtl"] .lg-toc div { font-family: 'Noto Kufi Arabic', 'Geeza Pro', 'Segoe UI', sans-serif }
[dir="rtl"] .lg-txt { font-size: var(--t-4); line-height: 1.95 }
[dir="rtl"] .lg-txt ul { padding-left: 0; padding-right: 20px }
[dir="rtl"] .lg-toc a { border-left: 0; border-right: 2px solid transparent; padding-left: 0; padding-right: 10px }
[dir="rtl"] .lg-toc a.on { border-right-color: var(--primary-color, #04696F) }
[dir="rtl"] .lg-tbl th,
[dir="rtl"] .lg-tbl td { text-align: right; padding-right: 0; padding-left: 12px }

@media (max-width: 820px) {
  .lg-body { grid-template-columns: 1fr }
  .lg-toc { display: none }
  .lg-hero, .lg-body, .lg-top, .lg-foot { padding-left: 22px; padding-right: 22px }
  .lg-hero h1 { font-size: var(--t-8) }
  .lg-gate { padding: 52px 22px 58px }
  .lg-wrap { padding: 16px 12px 48px }
}

@media print {
  .lg-toc, .lg-lang { display: none }
  .lg-page { box-shadow: none; border-radius: 0 }
  .lg-body { grid-template-columns: 1fr }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto }
}

[hidden] { display: none !important }


/* ==========================================================================
   legal-gate-ux.css — UX/UI upgrade for the "under development" legal gate
   (Terms of Service / Privacy Policy). Append to the END of legal.css.
   ========================================================================== */

/* 1) Arabic typography — the gate was never in the RTL font rules, so Arabic
      text fell back to Poppins / Source Sans (no Arabic glyphs) = system font. */
[dir="rtl"] .lg-gate,
[dir="rtl"] .lg-top nav > a {
  font-family: 'Noto Naskh Arabic', 'Geeza Pro', 'Segoe UI', serif;
}
[dir="rtl"] .lg-gate h1,
[dir="rtl"] .lg-gate .lg-ver,
[dir="rtl"] .lg-gate__back,
[dir="rtl"] .lg-gate__alt,
[dir="rtl"] .lg-lang a[hreflang="ar"] {
  font-family: 'Noto Kufi Arabic', 'Geeza Pro', 'Segoe UI', sans-serif;
  letter-spacing: 0;
}
[dir="rtl"] .lg-gate__body { line-height: 1.95 }

/* 2) Card fills the screen — no empty grey band under it; content centred */
.lg-wrap { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column }
.lg-page { flex: 1; display: flex; flex-direction: column }
/* The content landmark added 2026-11-03 sits between .lg-page and its sections, so it
   has to pass the flex column through or .lg-gate's `flex: 1` has no tall parent to
   centre in and the withheld state jumps to the top. */
.lg-main { flex: 1; display: flex; flex-direction: column; min-width: 0 }
.lg-gate {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  max-width: 600px; padding: 64px 32px;
}

/* 3) Calm brand-teal icon (the amber "!" read as an error page) */
.lg-gate__icon {
  width: 64px; height: 64px; border-radius: 20px; margin-bottom: 22px;
  background: #E1EDEE; color: var(--primary-color, #04696F);
  box-shadow: 0 0 0 8px #F1F7F7;
}

/* 4) Status pill sits ABOVE the title as an eyebrow, with a live dot */
.lg-gate .lg-ver { margin: 0 0 14px }
.lg-ver .lg-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--lg-amber-line);
  box-shadow: 0 0 0 3px rgba(232, 164, 0, .18);
}
@media (prefers-reduced-motion: no-preference) {
  .lg-ver .lg-dot { animation: lgPulse 2s ease-in-out infinite }
  @keyframes lgPulse { 50% { box-shadow: 0 0 0 6px rgba(232, 164, 0, 0) } }
}
.lg-gate h1 { font-size: clamp(26px, 5vw, 34px); margin-bottom: 14px }
.lg-gate__lead { font-size: var(--t-5); color: var(--lg-ink); font-weight: 600; margin: 0 0 6px }
.lg-gate__body { max-width: 46ch; margin: 0 auto 26px; text-wrap: pretty }

/* 5) "Questions about your data?" box — a privacy page should always offer
      a contact, even before the policy exists */
.lg-gate__contact {
  display: flex; align-items: center; gap: 12px; width: 100%; max-width: 440px;
  background: var(--lg-bg); border: 1px solid var(--lg-line); border-radius: 14px;
  padding: 14px 18px; margin: 0 0 28px; font-size: var(--t-3); text-align: start;
}
.lg-gate__contact svg { flex: none; color: var(--primary-color, #04696F) }
.lg-gate__contact b { display: block; color: var(--lg-ink); font-weight: 600 }
.lg-gate__contact a { font-family: var(--font-h); font-size: var(--t-3); color: var(--primary-color, #04696F); font-weight: 600; text-decoration: none; direction: ltr; unicode-bidi: isolate }
.lg-gate__contact a:hover { text-decoration: underline }

/* 6) Primary + secondary action side by side */
.lg-gate__actions { display: flex; gap: 10px 14px; flex-wrap: wrap; justify-content: center; align-items: center }
.lg-gate__back {
  transition: background .15s, transform .15s, box-shadow .15s;
  box-shadow: 0 4px 14px rgba(4, 105, 111, .22); padding: 11px 26px;
}
.lg-gate__back:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(4, 105, 111, .28) }
.lg-gate__alt {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: 100px;
  border: 1px solid var(--lg-line); background: #fff; color: var(--lg-ink); text-decoration: none;
  font-family: var(--font-h); font-size: var(--t-3); font-weight: 600;
  transition: border-color .15s, color .15s;
}
.lg-gate__alt:hover { border-color: var(--primary-color, #04696F); color: var(--primary-color, #04696F) }
.lg-gate__alt:focus-visible { outline: 2px solid var(--primary-color, #04696F); outline-offset: 2px }
.lg-gate__foot { order: 99; margin: 26px 0 0; font-size: var(--t-2); color: var(--lg-muted) }

/* 7) Current page in the header nav gets a clear underline */
.lg-top nav > a[aria-current="page"], .lg-top nav > a.on { position: relative; color: var(--primary-color, #04696F); font-weight: 600 }
.lg-top nav > a[aria-current="page"]::after, .lg-top nav > a.on::after {
  content: ""; position: absolute; inset-inline: 0; bottom: -6px; height: 2px; border-radius: 2px;
  background: var(--primary-color, #04696F);
}

/* 8) Phones */
@media (max-width: 560px) {
  .lg-wrap { padding: 12px 12px 24px }
  .lg-top { padding: 16px 20px; justify-content: center }
  .lg-gate { padding: 44px 20px 48px }
  .lg-gate__actions { flex-direction: column; width: 100%; max-width: 320px }
  .lg-gate__back, .lg-gate__alt { width: 100%; justify-content: center; text-align: center }
}

/* 9) Header stays in ONE fixed layout in both languages:
      logo on the left, page links + language switch on the right,
      and the switch always reads  English | العربية.
      Only the words change when you switch — nothing jumps. */
[dir="rtl"] .lg-top { direction: ltr; text-align: left }
.lg-lang { direction: ltr; flex: none }
.lg-top nav > a { unicode-bidi: isolate }
