/* Enwan brand tokens. The values are the active theme in src/pp/brand.py.
   A rebrand edits that theme and these custom properties together.
   Logical properties throughout so every rule mirrors under dir="rtl". */

/* -- fonts ------------------------------------------------------------ */

@font-face {
  font-family: "Readex Pro";
  src: url("/_s/fonts/ReadexPro-Variable-Latin.a4805912173b.woff2") format("woff2");
  font-weight: 160 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Readex Pro Arabic";
  src: url("/_s/fonts/ReadexPro-Variable-Arabic.0b9663026949.woff2") format("woff2");
  font-weight: 160 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Tajawal";
  src: url("/_s/fonts/Tajawal-Regular.23d57ff88f92.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Tajawal";
  src: url("/_s/fonts/Tajawal-Medium.3fde0fc4d3f5.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Tajawal";
  src: url("/_s/fonts/Tajawal-Bold.e5493cb56161.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/_s/fonts/IBMPlexSans-Regular.ba711a3085ff.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/_s/fonts/IBMPlexSans-SemiBold.f78048030eab.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Kaitech Riyal";
  src: url("/_s/fonts/KaitechRiyal.1292b537bb98.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* -- color tokens (light / linen theme) ------------------------------- */

:root {
  color-scheme: light dark;

  /* font stacks */
  --font-sans: "Readex Pro", "Readex Pro Arabic", "Kaitech Riyal", system-ui, sans-serif;
  --font-arabic: "Tajawal", "Readex Pro", "Kaitech Riyal", Tahoma, sans-serif;
  --font-text: "IBM Plex Sans", "Tajawal", "Kaitech Riyal", system-ui, sans-serif;
  --font-arabic-text: "Tajawal", "IBM Plex Sans", "Kaitech Riyal", Tahoma, sans-serif;

  /* palette and semantic colours: light (linen) theme */
  --night: #1b2a41;
  --linen: #f4f0e8;
  --white: #ffffff;
  --iris: #7c77df;
  --iris-text: #5852d6;
  --iris-on-night: #9490e5;
  --link: #5852d6;
  --header-muted: #545f70;
  --paper: #f4f0e8;
  --surface: #ffffff;
  --sunken: #eae4d8;
  --line: #ddd5c6;
  --line-strong: #737b8a;
  --ink: #1b2a41;
  --muted: #545f70;
  --action: #1b2a41;
  --on-action: #ffffff;
  --negative: #a3283a;
  --negative-soft: #f6dfe2;
  --positive: #2b5e8c;
  --positive-soft: #e1eaf3;
  --focus-ring: 0 0 0 2px #f4f0e8, 0 0 0 4px #1b2a41;
  --shadow-sm: 0 1px 2px #1b2a410f;

  /* spacing (4px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  /* radius */
  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 10px;

  /* layout */
  --container: 1200px;
  --container-text: 680px;
  --header-height: 72px;
  --grid-gutter: 24px;
}

/* -- dark (night) theme ----------------------------------------------- */

@media (prefers-color-scheme: dark) {
  :root {
    --iris-text: #9490e5;
    --link: #9490e5;
    --paper: #131e30;
    --surface: #1b2a41;
    --sunken: #0e1624;
    --line: #2c3b52;
    --line-strong: #6f7d93;
    --ink: #f4f0e8;
    --muted: #a9b3c2;
    --action: #f4f0e8;
    --on-action: #1b2a41;
    --negative: #f28b98;
    --negative-soft: #3a1820;
    --positive: #8db8e0;
    --positive-soft: #18263a;
    --focus-ring: 0 0 0 2px #131e30, 0 0 0 4px #f4f0e8;
    --shadow-sm: 0 1px 2px #00000066;
  }
}

/* -- reset ------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }

/* -- base layout ------------------------------------------------------ */

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-text);
  font-size: 19px;
  line-height: 34px;
  font-weight: 400;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

/* Arabic body: Tajawal 400 */
[dir="rtl"] body {
  font-family: var(--font-arabic-text);
}

/* -- focus ------------------------------------------------------------ */

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* -- header ----------------------------------------------------------- */

/* Linen in both color schemes. The wordmark letters are night, and the
   dark-scheme ink and action tokens would hide them and the header button. */
.pp-header {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--header-height);
  padding-inline: var(--space-5);
  border-block-end: 1px solid var(--line);
  background: var(--linen);
  color: var(--night);
}

.pp-logo {
  height: 28px;
  width: auto;
}

/* Arabic logo is taller per kaitech.sa pattern */
[dir="rtl"] .pp-logo {
  height: 36px;
}

/* -- main ------------------------------------------------------------- */

main {
  flex: 1;
  width: 100%;
  max-width: var(--container-text);
  margin-inline: auto;
  padding: var(--space-7) var(--space-5) var(--space-7);
}

/* -- typography ------------------------------------------------------- */

h1, h2, h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 600;
  text-wrap: balance;
}

/* English heading sizes */
h1 { font-size: 30px; line-height: 38px; letter-spacing: -0.01em; }
h2 { font-size: 23px; line-height: 31px; letter-spacing: -0.005em; }
h3 { font-size: 18px; line-height: 26px; }

/* Arabic headings: Tajawal 700, one step larger */
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 {
  font-family: var(--font-arabic);
  font-weight: 700;
}
[dir="rtl"] h1 { font-size: 32px; line-height: 52px; letter-spacing: 0; }
[dir="rtl"] h2 { font-size: 25px; line-height: 40px; letter-spacing: 0; }
[dir="rtl"] h3 { font-size: 20px; line-height: 32px; }

h1 { margin-block-end: var(--space-4); }

p { color: var(--muted); margin: 0; }

a { color: inherit; text-underline-offset: 3px; }

.pp-muted { color: var(--muted); }

/* -- footer ----------------------------------------------------------- */

footer {
  padding: var(--space-5) var(--space-4);
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
  border-block-start: 1px solid var(--line);
}

/* Endorsed lockup: night letters, so the strip stays linen. */
.pp-endorsed {
  background: var(--linen);
  border-block-start: 1px solid var(--line);
}

.pp-endorsed-logo {
  height: 32px;
  width: auto;
  max-width: 100%;
}

[dir="rtl"] footer {
  font-size: 14px;
  line-height: 24px;
}

/* -- card surface (person page) --------------------------------------- */

.pp-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.pp-card h1 { margin-block-end: var(--space-2); }

.pp-card .pp-title {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  color: var(--ink);
  margin: 0;
}

[dir="rtl"] .pp-card .pp-title {
  font-family: var(--font-arabic);
  font-size: 17px;
  line-height: 28px;
}

.pp-card .pp-org {
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
  margin-block-start: var(--space-1);
}

[dir="rtl"] .pp-card .pp-org {
  font-size: 15px;
  line-height: 24px;
}

/* -- registration card ------------------------------------------------ */

.pp-register-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  max-width: var(--container-text);
}

.pp-register-card h1 {
  margin-block-end: var(--space-2);
}

.pp-register-card > p {
  margin-block-end: var(--space-5);
}

/* -- registration form ------------------------------------------------ */

.pp-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.pp-form label {
  display: block;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--ink);
  margin-block-end: var(--space-2);
}

[dir="rtl"] .pp-form label {
  font-family: var(--font-arabic);
  font-size: 15px;
  line-height: 24px;
}

.pp-form input[type="email"],
.pp-form input[type="text"],
.pp-form input[type="tel"],
.pp-form input[type="url"],
.pp-form select {
  display: block;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font: inherit;
  font-size: 16px;
  line-height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  min-height: 40px;
}

.pp-form input::placeholder {
  color: var(--muted);
}

/* -- buttons ---------------------------------------------------------- */

.pp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  box-sizing: border-box;
  height: 40px;
  margin-block-start: var(--space-3);
  padding-block: 0;
  padding-inline: var(--space-4);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--action);
  color: var(--on-action);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color .12s ease;
}

[dir="rtl"] .pp-btn {
  font-family: var(--font-arabic);
  font-size: 16px;
  font-weight: 700;
  /* Tajawal draws Arabic above the centre of the em box. A little
     extra padding on the block-start side brings the glyphs down. */
  padding-block: 3px 0;
}

.pp-btn:hover {
  opacity: 0.85;
}

.pp-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pp-btn-danger {
  background: var(--negative);
  color: var(--on-action);
}

.pp-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  margin-block-end: var(--space-4);
  font-size: 15px;
  line-height: 24px;
}

.pp-nav a {
  color: var(--link);
  text-underline-offset: 3px;
}

.pp-nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
}

.pp-btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}

/* -- hints and errors ------------------------------------------------- */

.pp-hint {
  margin-block-start: var(--space-1);
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
}

.pp-slug-free {
  color: var(--positive);
}

.pp-slug-taken {
  color: var(--negative);
}

[dir="rtl"] .pp-hint {
  font-size: 15px;
  line-height: 24px;
}

.pp-error {
  padding: var(--space-3) var(--space-4);
  background: var(--negative-soft);
  color: var(--negative);
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  border-radius: var(--radius-md);
}

[dir="rtl"] .pp-error {
  font-size: 15px;
  line-height: 24px;
}

/* -- form step (registration wizard) ---------------------------------- */

.pp-step {
  display: flex;
  flex-direction: column;
  border: none;
  margin: 0;
  padding: 0;
}

.pp-step[hidden] {
  display: none;
}

/* -- step indicator --------------------------------------------------- */

.pp-step-indicator {
  font-size: 13px;
  line-height: 20px;
  color: var(--muted);
  margin-block-end: var(--space-4);
}

[dir="rtl"] .pp-step-indicator {
  font-size: 14px;
  line-height: 24px;
}

/* -- sent-to line (code step) ----------------------------------------- */

.pp-sent-to {
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
  margin-block-end: var(--space-3);
}

[dir="rtl"] .pp-sent-to {
  font-size: 15px;
  line-height: 24px;
}

.pp-sent-to .ltr {
  font-weight: 500;
  color: var(--ink);
}

/* -- text links under the card ---------------------------------------- */

.pp-card-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-block-start: var(--space-5);
  font-size: 14px;
  line-height: 20px;
}

[dir="rtl"] .pp-card-links {
  font-size: 15px;
  line-height: 24px;
}

.pp-card-links a {
  color: var(--link);
  text-underline-offset: 3px;
}

.pp-card-links a:hover {
  color: var(--ink);
}

/* -- inline link button (change email, resend) ------------------------ */

.pp-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding-block: 2px;
  padding-inline: 0;
  font: inherit;
  font-size: 14px;
  line-height: 1.2;
  min-height: 24px;
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

[dir="rtl"] .pp-link-btn {
  font-size: 15px;
  line-height: 1.2;
  padding-block: 4px 1px;
}

.pp-link-btn:hover {
  color: var(--ink);
}

.pp-link-btn:disabled {
  opacity: 1;
  color: var(--muted);
  text-decoration: none;
  cursor: not-allowed;
}

/* -- code-step action row --------------------------------------------- */

.pp-code-actions {
  display: flex;
  gap: var(--space-4);
  margin-block-start: var(--space-3);
  flex-wrap: wrap;
  align-items: center;
}

/* -- passkeys --------------------------------------------------------- */

.pp-passkey-manage {
  margin-block-start: var(--space-6);
  padding-block-start: var(--space-5);
  border-block-start: 1px solid var(--line);
}

.pp-passkey h2 { margin-block-end: var(--space-2); }

.pp-passkey > p { margin-block-end: var(--space-4); }

.pp-passkey-list {
  list-style: none;
  margin: 0 0 var(--space-4);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.pp-passkey-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
}

.pp-passkey-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
  flex: 1 1 10rem;
}

.pp-passkey-name {
  color: var(--ink);
  font-weight: 600;
  overflow-wrap: break-word;
}

.pp-passkey-when {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
}

[dir="rtl"] .pp-passkey-when {
  font-size: 15px;
  line-height: 24px;
}

.pp-passkey-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.pp-passkey-prompt .pp-passkey-actions {
  flex-direction: column;
  align-items: stretch;
}

.pp-passkey .pp-btn,
[dir="rtl"] .pp-passkey .pp-btn {
  margin-block-start: 0;
  white-space: normal;
  height: auto;
  min-height: 40px;
  padding-block: var(--space-2);
  text-align: center;
}

@media (max-width: 480px) {
  .pp-code-actions {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
  }
  .pp-code-actions .pp-link-btn {
    justify-content: flex-start;
    min-height: 44px;
  }
  .pp-passkey-row .pp-btn,
  .pp-passkey-actions,
  .pp-passkey-actions .pp-btn {
    width: 100%;
  }
}

/* -- slug availability ------------------------------------------------ */

.pp-slug-ok {
  color: var(--positive);
}

.pp-slug-taken {
  color: var(--negative);
}

/* -- done state ------------------------------------------------------- */

.pp-done-msg {
  font-size: 16px;
  line-height: 26px;
}

[dir="rtl"] .pp-done-msg {
  font-size: 17px;
  line-height: 28px;
}

.pp-done-msg a {
  color: var(--link);
  font-weight: 500;
}

/* -- language toggle -------------------------------------------------- */

.pp-lang {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--link);
  text-decoration: none;
}

.pp-lang:hover { color: var(--ink); }

/* -- form privacy note ------------------------------------------------ */

.pp-form-note {
  font-size: 13px;
  line-height: 20px;
  color: var(--muted);
  margin: 0;
}

[dir="rtl"] .pp-form-note {
  font-size: 14px;
  line-height: 24px;
}

.pp-form-note a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* -- consent notice (E5.2) -------------------------------------------- */

.pp-notice {
  margin-block: var(--space-4);
  padding: var(--space-4);
  background: var(--sunken);
  border-radius: var(--radius-md);
  font-size: 15px;
  line-height: 24px;
  color: var(--ink);
}

[dir="rtl"] .pp-notice {
  font-size: 16px;
  line-height: 28px;
}

.pp-notice h2 {
  margin-block-end: var(--space-2);
}

.pp-notice p {
  color: var(--ink);
  margin-block-end: var(--space-2);
}

.pp-notice p:last-child {
  margin-block-end: 0;
}

.pp-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: 15px;
  line-height: 24px;
  color: var(--ink);
  cursor: pointer;
}

[dir="rtl"] .pp-checkbox-label {
  font-size: 16px;
  line-height: 28px;
}

.pp-checkbox-label input[type="checkbox"] {
  margin-block-start: 4px;
  flex-shrink: 0;
  accent-color: var(--action);
}

/* -- admin table (people list) ---------------------------------------- */

.pp-table {
  width: 100%;
  border-collapse: collapse;
  margin-block-start: var(--space-4);
  font-size: 15px;
  line-height: 24px;
}

.pp-table th, .pp-table td {
  padding: var(--space-2) var(--space-3);
  text-align: start;
  border-block-end: 1px solid var(--line);
}

.pp-table th {
  font-weight: 500;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

/* -- platform admin (E3.2) -------------------------------------------- */

.pp-admin-card {
  max-width: var(--container-text);
  margin: 0 auto;
}
.pp-admin-card h1 { margin-block-end: var(--space-3); }

.pp-admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-block-start: var(--space-4);
}
.pp-admin-table th,
.pp-admin-table td {
  padding: var(--space-2) var(--space-3);
  text-align: start;
  border-block-end: 1px solid var(--line);
}
.pp-admin-table th {
  font-weight: 500;
  color: var(--muted);
  font-size: 14px;
}
.pp-admin-table td { font-size: 15px; }

.pp-btn-sm {
  height: 32px;
  padding-block: 0;
  padding-inline: var(--space-3);
  font-size: 14px;
  border-radius: var(--radius-sm);
}

[dir="rtl"] .pp-btn-sm {
  padding-block: 2px 0;
}

.pp-btn-block {
  display: flex;
  width: 100%;
}

.pp-muted { color: var(--muted); }

.pp-status {
  margin-block-start: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: 14px;
}
.pp-status-ok {
  background: var(--positive-soft);
  color: var(--positive);
}
.pp-status-error {
  background: var(--negative-soft);
  color: var(--negative);
}

.pp-admin-actions {
  margin-block-start: var(--space-5);
  text-align: center;
}

.pp-admin-scroll { display: none; }

.pp-admin-table a {
  color: var(--positive);
}

.pp-admin-table td,
.pp-admin-table a,
.pp-table td,
.pp-table a,
.pp-wait-card,
.pp-wait-card a {
  overflow-wrap: break-word;
  word-break: normal;
}

.pp-wait-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-block-start: var(--space-4);
}

.pp-wait-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  background: var(--surface);
}

.pp-wait-card h2 {
  margin: 0;
  font-size: 18px;
  line-height: 28px;
}

.pp-wait-card p { margin: var(--space-2) 0 0; }

.pp-wait-card .pp-btn { width: 100%; }

.pp-wait-reason { margin-block-start: var(--space-3); }

@media (max-width: 639px) {
  .pp-table thead { display: none; }
  .pp-table,
  .pp-table tbody,
  .pp-table tr,
  .pp-table td { display: block; width: 100%; }
  .pp-table tr {
    margin-block-end: var(--space-4);
    padding: var(--space-3);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
  }
  .pp-table td { border: none; padding: var(--space-1) 0; }
}

.pp-form textarea {
  display: block;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font: inherit;
  font-size: 16px;
  line-height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
}

/* -- consent banner --------------------------------------------------- */

.en-consent {
  position: fixed;
  inset-block-end: 0;
  inset-inline: 0;
  background: var(--surface);
  border-block-start: 1px solid var(--line);
  padding: var(--space-4) var(--space-5);
  z-index: 100;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
}

.en-consent[hidden] { display: none; }

.en-consent-inner {
  max-width: var(--container);
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.en-consent p {
  flex: 1;
  min-width: 200px;
  font-size: 14px;
  line-height: 20px;
  color: var(--ink);
  margin: 0;
}

[dir="rtl"] .en-consent p {
  font-size: 15px;
  line-height: 24px;
}

.en-consent-buttons {
  display: flex;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* -- Enwan home page (operating-board #204) --------------------------- */

.en-home .en-main {
  max-width: none;
  padding: 0;
}

/* ---- header ---- */

.en-header { justify-content: stretch; }

.en-header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-7);
}

.en-nav {
  display: flex;
  gap: var(--space-5);
  margin-inline-start: auto;
}

.en-nav a {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
}

[dir="rtl"] .en-nav a {
  font-family: var(--font-arabic);
  font-size: 15px;
}

.en-nav a:hover { color: var(--ink); }

.en-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.en-sign-in {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
}

[dir="rtl"] .en-sign-in {
  font-family: var(--font-arabic);
  font-size: 15px;
}

.en-sign-in:hover { color: var(--ink); }

/* Header chrome stays night on linen when the page itself is in dark mode.
   Links are bold night (Tajawal 700, Readex Pro 600), not thin grey. */
.pp-header .en-nav a,
.pp-header .en-sign-in,
.pp-header .pp-lang {
  color: var(--night);
  font-weight: 600;
}

[dir="rtl"] .pp-header .en-nav a,
[dir="rtl"] .pp-header .en-sign-in,
[dir="rtl"] .pp-header .pp-lang {
  font-weight: 700;
}

.pp-header .en-nav a:hover,
.pp-header .en-sign-in:hover,
.pp-header .pp-lang:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* The logo sits in an inline <picture>, which left it above the row centre. */
.en-header-inner picture { display: flex; align-items: center; }
.en-header .pp-logo { display: block; }

.pp-header .pp-btn {
  background: var(--night);
  color: var(--linen);
  border-color: transparent;
}

.en-btn-register {
  font-size: 14px;
  height: 36px;
  /* .pp-btn adds a 12px top margin for forms. In the header row it pushed
     the button 6px below the centre line of the links. */
  margin-block-start: 0;
}

/* ---- sections ---- */

.en-section {
  padding: var(--space-8) 0;
}

.en-container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-7);
}

.en-container-text {
  max-width: var(--container-text);
}

.en-section h2 {
  margin-block-end: var(--space-5);
}

/* ---- hero ---- */

.en-hero {
  padding: var(--space-9) 0 var(--space-8);
}

.en-hero .en-container {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.en-hero-text {
  flex: 1;
  min-width: 0;
}

.en-eyebrow {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--iris-text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-block-end: var(--space-3);
}

[dir="rtl"] .en-eyebrow {
  font-family: var(--font-arabic);
  font-size: 15px;
  text-transform: none;
  letter-spacing: 0;
}

.en-hero h1 {
  font-size: 40px;
  line-height: 52px;
  letter-spacing: -0.02em;
  margin-block-end: var(--space-4);
}

[dir="rtl"] .en-hero h1 {
  font-size: 42px;
  line-height: 60px;
  letter-spacing: 0;
}

.en-sub {
  font-size: 18px;
  line-height: 30px;
  color: var(--muted);
  margin-block-end: var(--space-5);
}

[dir="rtl"] .en-sub {
  font-size: 19px;
  line-height: 34px;
}

.en-hero-cta {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-block-end: var(--space-3);
}

.en-waiting {
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
}

[dir="rtl"] .en-waiting {
  font-size: 15px;
  line-height: 24px;
}

.en-hero-diagram {
  flex: 0 0 auto;
  width: 400px;
}

.en-hero-diagram img,
.en-hero-diagram .hd {
  width: 100%;
  height: auto;
}

/* Hero diagram (inline SVG): every colour is a token, so it follows the night theme. */
.hd { display: block; width: 100%; height: auto; --hd-o: 1; }
.hd text { font-family: var(--font-text); font-size: 19px; fill: var(--muted); }
[dir="rtl"] .hd text { font-family: var(--font-arabic-text); }
.hd .hd-name { font-size: 20px; font-weight: 600; fill: var(--ink); }
[dir="rtl"] .hd .hd-name { font-weight: 700; }
.hd .hd-label { font-size: 25px; font-weight: 700; fill: var(--ink); }
.hd .hd-btn-text { fill: var(--ink); }
.hd .hd-btn-text-on { fill: var(--on-action); }
.hd-outline { fill: none; stroke: var(--ink); stroke-opacity: var(--hd-o); stroke-width: 2; }
.hd-line { fill: none; stroke: var(--ink); stroke-opacity: var(--hd-o); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.hd-dash { stroke-dasharray: 2 8; }
.hd-soft { fill: var(--ink); fill-opacity: 0.2; }
.hd-qr rect { fill: var(--ink); }
.hd-avatar { fill: var(--ink); fill-opacity: 0.14; stroke: var(--ink); stroke-opacity: var(--hd-o); stroke-width: 1.5; }
.hd-fill { fill: var(--action); }
.hd-spark { fill: var(--iris); }
@media (prefers-color-scheme: dark) {
  .hd { --hd-o: 0.7; }
}

/* ---- what it is ---- */

.en-what { background: var(--surface); }

.en-lead {
  font-size: 18px;
  line-height: 30px;
  color: var(--muted);
  margin-block-end: var(--space-6);
  max-width: var(--container-text);
}

[dir="rtl"] .en-lead {
  font-size: 19px;
  line-height: 34px;
}

.en-what-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gutter);
}

.en-what-card {
  padding: var(--space-5);
  background: var(--paper);
  border-radius: var(--radius-lg);
}

.en-what-card h3 { margin-block-end: var(--space-2); }

/* ---- how it works ---- */

.en-steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--grid-gutter);
}

.en-step { position: relative; }

.en-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-block-end: var(--space-3);
}

.en-step h3 { margin-block-end: var(--space-2); }

/* ---- features ---- */

.en-features { background: var(--surface); }

.en-feat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gutter);
}

.en-feat-card {
  padding: var(--space-5);
  background: var(--paper);
  border-radius: var(--radius-lg);
}

.en-feat-card img {
  margin-block-end: var(--space-3);
}

.en-feat-card h3 { margin-block-end: var(--space-2); }

.en-feat-control {
  margin-block-start: var(--space-5);
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
}

[dir="rtl"] .en-feat-control {
  font-size: 15px;
  line-height: 24px;
}

/* ---- who it is for ---- */

.en-who-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gutter);
}

.en-who-card {
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.en-who-card h3 { margin-block-end: var(--space-2); }

/* ---- privacy ---- */

.en-privacy-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.en-privacy-list li {
  position: relative;
  padding-inline-start: var(--space-5);
  margin-block-end: var(--space-3);
  color: var(--muted);
}

.en-privacy-list li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 10px;
  width: 10px;
  height: 10px;
  background: var(--iris);
  transform: rotate(45deg);
}

/* ---- FAQ ---- */

.en-faq-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.en-faq-item {
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.en-faq-item summary {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

[dir="rtl"] .en-faq-item summary {
  font-family: var(--font-arabic);
  font-size: 17px;
  font-weight: 700;
}

.en-faq-item summary::-webkit-details-marker { display: none; }

.en-faq-item p {
  margin-block-start: var(--space-3);
  font-size: 15px;
  line-height: 24px;
}

[dir="rtl"] .en-faq-item p {
  font-size: 16px;
  line-height: 28px;
}

/* ---- final CTA band ---- */

.en-cta-band {
  background: var(--night);
  color: var(--linen);
  text-align: center;
  --link: var(--iris-on-night);
}

.en-cta-band h2 {
  color: var(--linen);
  margin-block-end: var(--space-3);
}

.en-cta-band p {
  color: var(--linen);
  opacity: 0.8;
  margin-block-end: var(--space-5);
}

.en-cta-band p.en-cta-contact {
  opacity: 1;
}

.en-cta-btn {
  background: var(--linen);
  color: var(--night);
}

.en-cta-contact {
  margin-block-start: var(--space-5);
  font-size: 14px;
}

[dir="rtl"] .en-cta-contact { font-size: 15px; }

.en-cta-contact a { color: var(--link); }

/* ---- home footer ---- */

.en-footer {
  padding: var(--space-5) 0;
  border-block-start: 1px solid var(--line);
}

.en-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.en-footer p {
  font-size: 13px;
  line-height: 20px;
  color: var(--muted);
  margin: 0;
}

[dir="rtl"] .en-footer p {
  font-size: 14px;
  line-height: 24px;
}

.en-footer-links {
  display: flex;
  gap: var(--space-5);
}

.en-footer-links a {
  font-size: 13px;
  line-height: 20px;
  color: var(--link);
  text-decoration: none;
}

[dir="rtl"] .en-footer-links a { font-size: 14px; }

.en-footer-links a:hover { color: var(--ink); }

.en-footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.en-footer-endorsed {
  height: 36px;
  width: auto;
}

[dir="rtl"] .en-footer-endorsed {
  height: 40px;
}

/* -- utility ---------------------------------------------------------- */

.ltr { direction: ltr; unicode-bidi: isolate; }

/* -- phone breakpoint ------------------------------------------------- */

@media (max-width: 640px) {
  body { font-size: 18px; }
  main { padding: var(--space-6) var(--space-4) var(--space-6); }
  .pp-header { height: auto; min-height: 56px; }

  /* Home header stays one row: logo, sign in, register, language. */
  .en-header {
    height: auto;
    min-height: 56px;
    padding-inline: var(--space-2);
  }
  .en-header-inner {
    flex-wrap: nowrap;
    align-items: center;
    gap: var(--space-2);
    padding-inline: 0;
    padding-block: var(--space-2);
  }
  .en-nav { display: none; }
  .en-header-actions {
    flex: 1 1 auto;
    align-items: center;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: var(--space-2);
    margin-inline-start: auto;
  }
  .en-header .en-sign-in,
  .en-header .pp-lang {
    flex: 0 0 auto;
    font-size: 13px;
    line-height: 1.2;
  }
  .en-header .en-btn-register {
    margin-block-start: 0;
    height: 32px;
    padding-inline: var(--space-2);
    font-size: 13px;
  }
  [dir="rtl"] .en-header .en-btn-register { font-size: 14px; }
  .en-header-actions a { white-space: nowrap; }
  .en-header .pp-logo { height: 20px; }
  [dir="rtl"] .en-header .pp-logo { height: 26px; }
  .pp-logo { height: 24px; }
  [dir="rtl"] .pp-logo { height: 28px; }
  .en-container { padding-inline: var(--space-4); }
  .en-hero .en-container { flex-direction: column; }
  .en-hero-diagram { width: 100%; }
  .en-hero h1 { font-size: 28px; line-height: 40px; }
  [dir="rtl"] .en-hero h1 { font-size: 30px; line-height: 44px; }
  .en-what-grid,
  .en-who-grid { grid-template-columns: 1fr; }
  .en-steps-grid { grid-template-columns: repeat(2, 1fr); }
  .en-feat-grid { grid-template-columns: 1fr 1fr; }
  .en-faq-grid { grid-template-columns: 1fr; }
}

/* Narrow phones: the register label wraps so the row still fits at 360px. */
@media (max-width: 480px) {
  .en-header .pp-logo { height: 18px; }
  [dir="rtl"] .en-header .pp-logo { height: 24px; }
  .en-header-actions a.en-btn-register {
    height: auto;
    min-height: 32px;
    padding: var(--space-1) var(--space-2);
    font-size: 12px;
    line-height: 1.15;
    white-space: normal;
    text-align: center;
    max-width: 9em;
  }
  [dir="rtl"] .en-header-actions a.en-btn-register {
    font-size: 13px;
    /* The shorthand above dropped the Tajawal block-start pad. */
    padding-block: 8px 2px;
  }
}

/* Feature icons are img files drawn in night: lighten them on the night theme. */
@media (prefers-color-scheme: dark) {
  .en-feat-card img { filter: invert(1) opacity(0.85); }
}
