/*
 * The privacy policy and terms (app/views/pages/privacy.*.html.erb and
 * terms.*.html.erb), following Figma LG1 and LG2 (D089).
 *
 * Every rule is scoped to the header or <main class="legal">; the header and
 * the colours also serve the sign-in pages (auth.css). Colours,
 * type, spacing and radii are the Figma file's variables and text styles.
 * Logical properties (block, inline) serve Arabic and English alike.
 * The Figma file has no dark mode, so neither do these pages.
 */

:root:has(main.legal, main.auth) {
  --ink: #0f2a33;           /* Color/text/primary */
  --muted: #4e6469;         /* Color/text/secondary */
  --teal: #137a7f;          /* Color/mark/bead */
  --ground: #f1f6f6;        /* Color/bg/ground */
  --surface: #ffffff;       /* Color/bg/surface */
  --line: #d8e2e3;          /* Figma: field and card borders */
  --danger: #a3271f;        /* Figma A2: error text and outline */
}

body:has(> main.legal, > main.auth) {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
}

/* Header: white bar, 72 high, lockup at the start. */

.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-block-size: 72px;
  padding-inline: 40px;
  background: var(--surface);
}

.lockup {
  display: flex;
  align-items: center;
  gap: 7.5px;
  color: var(--ink);
  text-decoration: none;
}

.lockup-words {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  font-weight: 500;
  line-height: 1;
}

.lockup-arabic {
  font-size: 26.5px;
  line-height: 33px;
}

.lockup-latin {
  font-size: 5px;
  letter-spacing: 0.3em;
}

.lockup-mark {
  inline-size: 36px;
  block-size: 36px;
}

.lockup-mark .ring {
  fill: none;
  stroke: var(--ink);
  stroke-width: 4.5;
}

.lockup-mark .bead {
  fill: var(--teal);
}

.legal-header .language {
  font-size: 14px;
  line-height: 22px;
  color: var(--muted);
}

/* Body: one 640-wide column, 16 between every block. */

.legal {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-inline-size: 640px;
  margin-inline: auto;
  padding-block: 64px;
  font-size: 16px;            /* Body */
  line-height: 26px;
  color: var(--muted);
}

.legal > * {
  margin: 0;
}

.legal h1 {                   /* Title */
  font-size: 24px;
  line-height: 36px;
  color: var(--ink);
}

.legal h2 {                   /* Heading */
  font-size: 18px;
  line-height: 28px;
  color: var(--ink);
}

.legal .caption {             /* Caption */
  font-size: 12px;
  line-height: 18px;
}

.legal .group-label {         /* Small strong */
  font-size: 14px;
  font-weight: 500;
  line-height: 22px;
  color: var(--muted);
}

.legal ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-inline-start: 20px;
}

.legal strong {
  font-weight: 500;
  color: var(--ink);
}

.legal a {
  color: var(--ink);
}

/* The "In short" box: white, radius lg (16), padding 16, 12 between lines. */
.legal .box {
  gap: 12px;
  padding: 16px;
  list-style: none;
  background: var(--surface);
  border-radius: 16px;
  color: var(--ink);
}

.legal .see-also {
  margin-block-start: 16px;
}

/* Phones: the Figma mobile screens use 24 at the sides. */
@media (max-width: 688px) {
  .legal-header {
    padding-inline: 24px;
  }

  .legal {
    padding-block: 32px;
    padding-inline: 24px;
  }
}
