/* Legal documents & help pages (terms, privacy, copyright, support, /legal hub).
   The homepage header and footer, then a documents layout: title block, a sidebar with the
   document list and the contents, and the numbered sections in a card.
   Colours and type come from /brand.css. Flat: cards are solid fills, no shadows. */

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { font-family: var(--font-sans); background: var(--color-bg); color: var(--color-text); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---------- header: same as the homepage ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: var(--color-chrome); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--color-on-chrome); }
.brand img { width: auto; height: 34px; }
.nav-links { display: flex; gap: 22px; font-size: 16px; color: var(--color-on-chrome-muted); }
.nav-links a:hover { color: var(--color-on-chrome); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.link-login { font-size: 14px; font-weight: 600; padding: 8px 10px; color: var(--color-on-chrome); }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; font-weight: 700; font-size: 14px; white-space: nowrap; transition: background .15s, opacity .15s; }
.nav .pill-dark { background: var(--color-on-chrome); color: var(--color-chrome); border-radius: var(--radius-sm); }
@media (max-width: 900px) { .nav-links { display: none; } }
/* phones: the header stays on one line */
@media (max-width: 480px) {
  .nav .wrap { gap: 8px; }
  .brand { gap: 8px; font-size: 15px; white-space: nowrap; }
  .brand img { height: 30px; }
  .link-login { display: none; }   /* the hero / register page link to login */
  .nav .pill-dark { padding: 9px 12px; }
}

/* ---------- footer: same as the homepage ---------- */
.footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 56px; padding: 22px 0 30px; font-size: 13px; color: var(--color-text-muted); }
.footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer nav a:hover { color: var(--color-text); }

/* ---------- title block ---------- */
.doc-head { max-width: 760px; padding-top: 40px; }
.crumb { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 500; color: var(--color-text-muted); }
.crumb:hover { color: var(--color-text); }
.crumb svg { width: 16px; height: 16px; color: var(--color-icon); }
.part { display: block; margin-top: 26px; font-size: 13px; font-weight: 700; color: var(--color-text-subtle); }
.doc-head h1 { font-size: clamp(32px, 4.4vw, 48px); font-weight: 700; line-height: 1.25; margin: 6px 0 14px; }
.lead { font-size: 17px; line-height: 1.9; color: var(--color-text-muted); }
.meta { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 16px; font-size: 13px; color: var(--color-text-subtle); }
.meta [dir="ltr"] { font-family: var(--font-mono); font-size: 12.5px; }   /* monospace only for Latin (Arabic letters would spread) */
.note { display: flex; gap: 12px; max-width: 760px; margin-top: 26px; padding: 16px 18px; border-radius: var(--radius-md); background: var(--color-surface-2); }
.note > svg { flex-shrink: 0; width: 18px; height: 18px; margin-top: 3px; color: var(--color-icon); }
.note strong { display: block; font-size: 14.5px; margin-bottom: 4px; color: var(--color-text); }
.note p { font-size: 14px; line-height: 1.85; color: var(--color-text-muted); }

/* ---------- layout: sidebar + document ---------- */
.doc-layout { display: flex; gap: 24px; align-items: flex-start; margin-top: 34px; }
.doc-side { flex: 0 0 250px; position: sticky; top: 84px; display: flex; flex-direction: column; gap: 14px; }
.side-card { background: var(--color-surface); border-radius: var(--radius-lg); padding: 16px 12px; }
.side-label { font-size: 12px; font-weight: 700; color: var(--color-text-subtle); padding: 0 8px 8px; }
.side-docs a { display: block; padding: 9px 10px; border-radius: 10px; font-size: 15px; font-weight: 500; }
.side-docs a:hover { background: var(--color-surface-2); }
.side-docs a.on { background: var(--color-surface-2); font-weight: 700; }
.side-toc { max-height: calc(100vh - 300px); overflow-y: auto; scrollbar-width: thin; }
.side-toc a { display: block; padding: 2px 8px; font-size: 12px; line-height: 1.45; color: var(--color-text-muted); border-radius: 8px; }
.side-toc a:hover { color: var(--color-text); }
.side-toc a.on { color: var(--color-text); font-weight: 700; background: var(--color-surface-2); }
.side-toc .n { font-family: var(--font-mono); font-size: 11px; color: var(--color-text-subtle); margin-inline-end: 4px; }

/* ---------- the document ---------- */
.doc { flex: 1; min-width: 0; background: var(--color-surface); border-radius: var(--radius-lg); padding: 36px 40px 40px; }
.doc section + section { margin-top: 34px; }
.doc h2 { display: flex; align-items: baseline; gap: 10px; font-size: 18px; font-weight: 700; line-height: 1.5; margin-bottom: 12px; color: var(--color-text); }
.doc h2 .num { flex-shrink: 0; font-family: var(--font-mono); font-size: 15px; color: var(--color-accent); direction: ltr; }
.doc p, .doc li { font-size: 15.5px; line-height: 1.95; color: var(--color-text-muted); }
.doc p + p, .doc p + ul, .doc ul + p, .doc p + ol, .doc ol + p { margin-top: 10px; }
.doc ul, .doc ol { padding-inline-start: 20px; display: flex; flex-direction: column; gap: 6px; }
.doc li::marker { color: var(--color-text); }
.doc strong { color: var(--color-text); }
.doc a { color: var(--color-accent); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- help page: FAQ + contact ---------- */
.faq-search { width: 100%; height: 46px; padding: 0 18px; margin-bottom: 8px; border: 1px solid var(--color-border-strong); border-radius: var(--radius-pill); background: var(--color-surface); color: var(--color-text); font: inherit; font-size: 15px; outline: none; }
.faq-search:focus { border-color: var(--color-icon); box-shadow: 0 0 0 3px var(--color-focus); }
.faq-item { border-bottom: 1px solid var(--color-border); }
.faq-item summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px 2px; font-size: 16px; font-weight: 700; color: var(--color-text); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--color-surface-2); color: var(--color-icon); display: grid; place-items: center; font-size: 17px; transition: transform .2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-answer { padding: 0 2px 16px; font-size: 15.5px; line-height: 1.9; color: var(--color-text-muted); }
.no-results { display: none; text-align: center; color: var(--color-text-subtle); padding: 24px; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.contact-tile { border: 1px solid var(--color-border-strong); border-radius: var(--radius-md); padding: 18px; }
.contact-tile .ico { color: var(--color-icon); margin-bottom: 8px; line-height: 0; }
.contact-tile .ico svg { width: 22px; height: 22px; }
.contact-tile h3 { font-size: 15px; margin-bottom: 2px; color: var(--color-text); }
.doc .contact-tile p, .doc .contact-tile a { font-size: 14.5px; line-height: 1.7; word-break: break-word; }

/* ---------- /legal hub ---------- */
.hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 34px; }
.hub-card { display: flex; flex-direction: column; gap: 6px; padding: 22px; background: var(--color-surface); border-radius: var(--radius-lg); transition: background .15s; }
.hub-card:hover { background: var(--color-surface-2); }
.hub-card .part { margin: 0; }
.hub-card h2 { font-size: 20px; font-weight: 700; }
.hub-card p { font-size: 14.5px; line-height: 1.8; color: var(--color-text-muted); }
.hub-card .meta { margin-top: auto; padding-top: 8px; }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .doc-layout { flex-direction: column; gap: 14px; }
  .doc-side { position: static; flex: none; width: 100%; }
  .side-toc { display: none; }
  .side-docs { display: flex; gap: 6px; overflow-x: auto; padding: 6px; scrollbar-width: none; }
  .side-docs::-webkit-scrollbar { display: none; }
  .side-docs .side-label { display: none; }
  .side-docs a { flex: none; white-space: nowrap; font-size: 14px; }
  .doc { padding: 24px 20px 28px; }
  .doc-head { padding-top: 28px; }
}
