/* rabeh.qa — shared design system. Bilingual (EN/AR), light + dark, RTL-aware. */

:root {
  --rabeh-red: #c0392b;
  --rabeh-red-dark: #a1301f;
  --rabeh-gold: #b8862b;
  --rabeh-gold-soft: #fdf0d8;

  --bg: #f8f6f2;
  --bg-raised: #ffffff;
  --bg-sunken: #f0ede6;
  --bg-accent: #fdf6ed;

  --ink: #1a1a1a;
  --ink-2: #4a4a4a;
  --ink-3: #6f6a62;
  --rule: #e4e0d8;
  --rule-strong: #ccc6bc;

  --ok: #2d7d4a;
  --ok-bg: #e8f5ed;
  --warn: #9a6520;
  --warn-bg: #fdf3e0;
  --err: #b13b3b;
  --err-bg: #f7eaea;

  --shadow-s: 0 1px 3px rgba(26, 20, 12, 0.06), 0 1px 2px rgba(26, 20, 12, 0.04);
  --shadow-m: 0 4px 16px rgba(26, 20, 12, 0.08);
  --shadow-l: 0 12px 40px rgba(26, 20, 12, 0.12);

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Playfair Display", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --measure: 68ch;
  --gutter: 16px;
  --radius: 10px;
}

:root[lang="ar"] {
  --font-body: "IBM Plex Sans Arabic", "Noto Sans Arabic", system-ui, sans-serif;
  --font-display: "IBM Plex Sans Arabic", "Noto Kufi Arabic", Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14120f;
    --bg-raised: #1c1a16;
    --bg-sunken: #100e0c;
    --bg-accent: #221d16;
    --ink: #f2efe9;
    --ink-2: #c4bfb5;
    --ink-3: #9d968a;
    --rule: #2e2a24;
    --rule-strong: #443e35;
    --rabeh-red: #e2604f;
    --rabeh-red-dark: #ef7a69;
    --rabeh-gold: #e0b45c;
    --rabeh-gold-soft: #2a2118;
    --ok: #6cc38b;
    --ok-bg: #16281d;
    --warn: #dda352;
    --warn-bg: #2a2014;
    --err: #e4756e;
    --err-bg: #2c1717;
  }
}

:root[data-theme="dark"] {
  --bg: #14120f;
  --bg-raised: #1c1a16;
  --bg-sunken: #100e0c;
  --bg-accent: #221d16;
  --ink: #f2efe9;
  --ink-2: #c4bfb5;
  --ink-3: #9d968a;
  --rule: #2e2a24;
  --rule-strong: #443e35;
  --rabeh-red: #e2604f;
  --rabeh-red-dark: #ef7a69;
  --rabeh-gold: #e0b45c;
  --rabeh-gold-soft: #2a2118;
  --ok: #6cc38b;
  --ok-bg: #16281d;
  --warn: #dda352;
  --warn-bg: #2a2014;
  --err: #e4756e;
  --err-bg: #2c1717;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: var(--rabeh-red);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover {
  color: var(--rabeh-red-dark);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.015em;
}
h1 {
  font-size: clamp(2.1rem, 5.5vw, 3.6rem);
}
h2 {
  font-size: clamp(1.55rem, 3.6vw, 2.3rem);
}
h3 {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
}

:focus-visible {
  outline: 2px solid var(--rabeh-gold);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── layout ── */
.wrap {
  width: 100%;
  max-width: 1140px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.prose {
  max-width: var(--measure);
}
section.band {
  padding-block: clamp(3rem, 7vw, 5.5rem);
}
section.band.alt {
  background: var(--bg-sunken);
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rabeh-gold);
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.lede {
  font-size: clamp(1.05rem, 2vw, 1.22rem);
  color: var(--ink-2);
}
.stack > * + * {
  margin-top: 1rem;
}
.mt2 {
  margin-top: 2rem;
}
.mt3 {
  margin-top: 3rem;
}

/* ── header ── */
header.site {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}
header.site .bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 62px;
  width: 100%;
  max-width: 1140px;
  margin-inline: auto;
  padding-inline: var(--gutter);
  position: relative;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}
.brand img {
  height: 42px;
  width: auto;
}
.brand .wordmark {
  font-family: var(--font-display);
  font-size: 1.72rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  display: flex;
  flex-direction: column;
}
.brand .wordmark em {
  font-family: var(--font-body);
  font-style: normal;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--rabeh-red);
  margin-top: 2px;
}
header.site .bar {
  min-height: 78px;
}
footer.site .brand img {
  height: 34px;
}
footer.site .brand .wordmark {
  font-size: 1.4rem;
}

nav.main {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-inline-start: auto;
  flex-wrap: wrap;
}
nav.main a,
nav.main button.navlink {
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.44rem 0.7rem;
  border-radius: 7px;
  color: var(--ink-2);
  text-decoration: none;
  background: none;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}
nav.main a:hover,
nav.main button.navlink:hover {
  background: var(--bg-sunken);
  color: var(--ink);
}
nav.main a[aria-current="page"] {
  color: var(--rabeh-red);
  background: var(--bg-accent);
}

/* A gated menu item stays visible but is inert until access is granted. */
.locked {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.44rem 0.7rem;
  color: var(--ink-3);
  cursor: not-allowed;
}
.locked svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.langtoggle {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid var(--rule-strong);
  background: var(--bg-raised);
  color: var(--ink-2);
  padding: 0.34rem 0.6rem;
  border-radius: 7px;
  cursor: pointer;
}
.langtoggle:hover {
  border-color: var(--rabeh-gold);
  color: var(--ink);
}

.burger {
  display: none;
  background: none;
  border: 1px solid var(--rule-strong);
  border-radius: 7px;
  padding: 0.4rem 0.55rem;
  cursor: pointer;
  color: var(--ink);
  margin-inline-start: auto;
}
.burger svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 860px) {
  .burger {
    display: block;
  }
  nav.main {
    display: none;
    position: absolute;
    inset-inline: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--rule);
    padding: 0.5rem var(--gutter) 0.9rem;
    box-shadow: var(--shadow-m);
    margin-inline-start: 0;
  }
  nav.main.open {
    display: flex;
  }
  nav.main a,
  nav.main button.navlink,
  nav.main .locked {
    padding-block: 0.65rem;
    text-align: start;
  }
  .langtoggle {
    align-self: flex-start;
    margin-top: 0.4rem;
  }
}

/* ── buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font: inherit;
  font-size: 0.94rem;
  font-weight: 600;
  padding: 0.72rem 1.35rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s, border-color 0.18s, transform 0.08s;
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: var(--rabeh-red);
  color: #fff;
}
.btn-primary:hover {
  background: var(--rabeh-red-dark);
  color: #fff;
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-strong);
}
.btn-ghost:hover {
  border-color: var(--rabeh-gold);
  color: var(--ink);
}
.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.8rem;
}

/* ── hero ── */
.hero {
  padding-block: clamp(3.2rem, 9vw, 6.5rem) clamp(2.5rem, 6vw, 4.5rem);
  background: linear-gradient(180deg, var(--bg-accent), var(--bg));
}
.hero h1 {
  max-width: 21ch;
}
.hero .lede {
  max-width: 56ch;
  margin-top: 1.2rem;
}

/* ── cards & grids ── */
.grid {
  display: grid;
  gap: 1.1rem;
}
.grid.c2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.grid.c3 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.grid.c4 {
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
}

.card {
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.45rem;
  box-shadow: var(--shadow-s);
}
.card h3 {
  margin-bottom: 0.5rem;
}
.card p {
  color: var(--ink-2);
  font-size: 0.93rem;
}
/* Icons are line art: one stroke weight, no fills, inherit the text colour. */
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.ico {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: var(--rabeh-red);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-bottom: 0.85rem;
  flex-shrink: 0;
}
.ico-inline {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin: 0;
}
.burger svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.card.row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.card.row .ico {
  margin-bottom: 0;
  margin-top: 2px;
}

.stat {
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.15rem;
}
.stat .n {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3.2vw, 2rem);
  font-weight: 700;
  color: var(--rabeh-red);
  line-height: 1.1;
}
.stat .l {
  font-size: 0.8rem;
  color: var(--ink-3);
  margin-top: 0.3rem;
}

/* numbered steps */
ol.steps {
  list-style: none;
  padding: 0;
  counter-reset: s;
  display: grid;
  gap: 1.15rem;
}
ol.steps li {
  counter-increment: s;
  position: relative;
  padding-inline-start: 3rem;
}
ol.steps li::before {
  content: counter(s);
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--rabeh-gold-soft);
  color: var(--rabeh-gold);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid var(--rabeh-gold);
}
ol.steps li strong {
  display: block;
}
ol.steps li span {
  color: var(--ink-2);
  font-size: 0.93rem;
}

ul.ticks {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}
ul.ticks li {
  padding-inline-start: 1.7rem;
  position: relative;
  color: var(--ink-2);
}
ul.ticks li::before {
  content: "✓";
  position: absolute;
  inset-inline-start: 0;
  color: var(--ok);
  font-weight: 700;
}

/* ── forms ── */
.panel {
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: clamp(1.4rem, 3vw, 2.2rem);
  box-shadow: var(--shadow-m);
}
.panel-narrow {
  max-width: 520px;
  margin-inline: auto;
}
.field {
  margin-bottom: 1.05rem;
}
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.field .hint {
  font-size: 0.76rem;
  color: var(--ink-3);
  margin-top: 0.3rem;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  padding: 0.66rem 0.8rem;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
}
.field input:focus {
  border-color: var(--rabeh-gold);
}
.field.bad input {
  border-color: var(--err);
  background: var(--err-bg);
}
.field .err {
  font-size: 0.78rem;
  color: var(--err);
  margin-top: 0.3rem;
  display: none;
}
.field.bad .err {
  display: block;
}
/* Phone, email and URL values stay left-to-right even on the Arabic side. */
:root[dir="rtl"] input[type="tel"],
:root[dir="rtl"] input[type="email"],
:root[dir="rtl"] input[type="url"],
:root[dir="rtl"] .ltr {
  direction: ltr;
  text-align: start;
}

.notice {
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-size: 0.89rem;
  margin-bottom: 1.2rem;
}
.notice.ok {
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid var(--ok);
}
.notice.warn {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid var(--warn);
}
.notice.err {
  background: var(--err-bg);
  color: var(--err);
  border: 1px solid var(--err);
}

.tabs {
  display: flex;
  gap: 0.3rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1.6rem;
  flex-wrap: wrap;
}
.tabs button {
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 0.6rem 0.9rem;
  color: var(--ink-3);
  cursor: pointer;
}
.tabs button[aria-selected="true"] {
  color: var(--rabeh-red);
  border-bottom-color: var(--rabeh-red);
}

/* ── tables ── */
.tablewrap {
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg-raised);
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.87rem;
}
th,
td {
  padding: 0.62rem 0.8rem;
  text-align: start;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
th {
  background: var(--bg-sunken);
  font-weight: 600;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-3);
  white-space: nowrap;
}
tbody tr:last-child td {
  border-bottom: 0;
}

.pill {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pill.pending {
  background: var(--warn-bg);
  color: var(--warn);
}
.pill.approved {
  background: var(--ok-bg);
  color: var(--ok);
}
.pill.rejected,
.pill.suspended {
  background: var(--err-bg);
  color: var(--err);
}

/* ── footer ── */
footer.site {
  border-top: 1px solid var(--rule);
  background: var(--bg-sunken);
  padding-block: 2.5rem;
  margin-top: 3rem;
  font-size: 0.85rem;
  color: var(--ink-3);
}
footer.site .cols {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
}
footer.site a {
  color: var(--ink-2);
  text-decoration: none;
}
footer.site a:hover {
  color: var(--rabeh-red);
}
footer.site nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.skip {
  position: absolute;
  inset-inline-start: -9999px;
}
.skip:focus {
  inset-inline-start: var(--gutter);
  top: 8px;
  z-index: 100;
  background: var(--bg-raised);
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  box-shadow: var(--shadow-m);
}

[hidden] {
  display: none !important;
}
.mono {
  font-family: var(--font-mono);
  font-size: 0.85em;
}
.muted {
  color: var(--ink-3);
}
.small {
  font-size: 0.82rem;
}
.center {
  text-align: center;
}
