/*
 * الوكيل — public site stylesheet.
 * Colours are the project tokens verbatim (design/tokens.css). Do not invent new ones here;
 * change design/tokens.css and mirror the value across, so site / app / admin stay in sync.
 */

@import url('fonts.css');

/* ─────────────────────────────  tokens  ───────────────────────────── */
:root {
  --bg: #f7f8f7;
  --surface: #ffffff;
  --surface2: #f1f4f2;
  --text: #14201c;
  --text2: #5b6b64;
  --text3: #8a988f;
  --primary: #0e5a4e;
  --primary-d: #0a4239;
  --primary-soft: #e3efeb;
  --gold: #c9a227;
  --gold-soft: #f6efd6;
  --success: #1e8e5a;
  --success-soft: #e1f3e9;
  --warning: #b4690e;
  --warning-soft: #f8ecd9;
  --error: #c0392b;
  --border: #e5eae7;
  --line: #eef1ef;
  --shadow: rgba(20, 32, 28, 0.1);

  /* Ink used on top of the deep-green hero, which stays dark in both themes. */
  --on-dark: #eaf2ee;
  --on-dark2: #a9c4bb;

  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 26px;
  --r-pill: 999px;

  --font-ar: 'Cairo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --wrap: 1120px;
  --pad: clamp(16px, 4vw, 28px);
}

:root[data-theme='dark'] {
  --bg: #0f1512;
  --surface: #1a2320;
  --surface2: #141c19;
  --text: #eaf2ee;
  --text2: #9db0a8;
  --text3: #6e807a;
  --primary: #3ba891;
  --primary-d: #2e8c78;
  --primary-soft: #12312b;
  --gold: #e4c15a;
  --gold-soft: #33290f;
  --success: #48c98a;
  --success-soft: #123024;
  --warning: #e0913c;
  --warning-soft: #33260f;
  --error: #f0776b;
  --border: #26332e;
  --line: #212b27;
  --shadow: rgba(0, 0, 0, 0.45);
}

/* ─────────────────────────────  base  ───────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ar);
  font-size: 17px;
  line-height: 1.85;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--primary-d);
}

h1,
h2,
h3,
h4 {
  line-height: 1.35;
  margin: 0 0 0.5em;
  font-weight: 800;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(30px, 5.6vw, 50px);
}
h2 {
  font-size: clamp(24px, 3.6vw, 34px);
}
h3 {
  font-size: clamp(18px, 2.2vw, 21px);
}

p {
  margin: 0 0 1em;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.skip {
  position: absolute;
  inset-inline-start: -9999px;
  top: 0;
  z-index: 100;
  background: var(--surface);
  color: var(--text);
  padding: 12px 18px;
  border-radius: var(--r-sm);
}
.skip:focus {
  inset-inline-start: 12px;
  top: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ─────────────────────────────  header  ───────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  font-weight: 800;
  font-size: 21px;
  margin-inline-end: auto;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: block;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav a {
  color: var(--text2);
  text-decoration: none;
  font-size: 15.5px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--r-sm);
}

.nav a:hover {
  color: var(--text);
  background: var(--surface2);
}

@media (max-width: 820px) {
  .nav {
    display: none;
  }
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  cursor: pointer;
  flex: none;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--text3);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

:root[data-theme='dark'] .icon-btn .i-moon,
:root:not([data-theme='dark']) .icon-btn .i-sun {
  display: none;
}

/* ─────────────────────────────  buttons  ───────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 24px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-gold {
  background: var(--gold);
  color: #241f07;
}
.btn-gold:hover {
  background: #b8931f;
  color: #241f07;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover {
  background: var(--surface2);
  color: var(--text);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-d);
  color: #fff;
}

/* Store badges — real links once site-config.js carries a URL, inert placeholders until then. */
.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.store {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 11px 20px 11px 22px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--on-dark);
  text-decoration: none;
  min-width: 196px;
}

.store svg {
  width: 26px;
  height: 26px;
  flex: none;
}

.store b {
  display: block;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
}

.store small {
  display: block;
  font-size: 12.5px;
  color: var(--on-dark2);
  line-height: 1.3;
}

a.store:hover {
  background: rgba(255, 255, 255, 0.17);
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--on-dark);
}

.store[aria-disabled='true'] {
  cursor: default;
  opacity: 0.72;
}

/* ─────────────────────────────  hero  ───────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(165deg, #0e5a4e 0%, #0a4239 62%, #093a32 100%);
  color: var(--on-dark);
}

/* A single soft gold bloom, echoing the beam in the logo. */
.hero::before {
  content: '';
  position: absolute;
  inset-block-start: -220px;
  inset-inline-start: -160px;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, rgba(201, 162, 39, 0.18), transparent 62%);
  pointer-events: none;
}

.hero .wrap {
  position: relative;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  padding-block: clamp(48px, 8vw, 92px) clamp(40px, 7vw, 84px);
}

.hero h1 {
  color: #fff;
  margin-bottom: 18px;
}

.hero h1 .accent {
  color: var(--gold);
}

.hero .lead {
  font-size: clamp(17px, 2.1vw, 19.5px);
  color: var(--on-dark2);
  max-width: 46ch;
  margin-bottom: 26px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 14px;
  font-weight: 600;
  color: var(--on-dark);
}

.hero-note {
  margin: 18px 0 0;
  font-size: 14px;
  color: var(--on-dark2);
}

.hero-note a {
  color: var(--gold);
}

/* Phone mock — two screens, the rear one peeking behind. */
.phones {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: 380px;
}

.phone {
  border-radius: 30px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(255, 255, 255, 0.12);
  line-height: 0;
}

.phone img {
  display: block;
  width: 100%;
  height: auto;
}

.phone-front {
  width: min(268px, 62vw);
  position: relative;
  z-index: 2;
}

.phone-back {
  width: min(212px, 48vw);
  position: absolute;
  inset-inline-end: 4%;
  bottom: 34px;
  z-index: 1;
  opacity: 0.94;
}

@media (max-width: 900px) {
  .hero .wrap {
    grid-template-columns: 1fr;
    text-align: start;
  }
  /* Headline first on a phone — the screenshot is the supporting act, not the pitch. */
  .phones {
    min-height: 0;
    margin-top: 12px;
  }
  .phone-back {
    display: none;
  }
  .phone-front {
    width: min(240px, 58vw);
  }
}

/* ─────────────────────────────  sections  ───────────────────────────── */
.section {
  padding-block: clamp(48px, 7vw, 84px);
}

/* The header is sticky, so an anchor jump must stop short of it or it covers the heading. */
section[id],
.doc h2[id] {
  scroll-margin-top: 88px;
}

.section-alt {
  background: var(--surface2);
  border-block: 1px solid var(--line);
}

.section-head {
  max-width: 62ch;
  margin-bottom: 34px;
}

.section-head p {
  color: var(--text2);
  margin: 0;
}

.eyebrow {
  display: inline-block;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 4px 12px;
  border-radius: var(--r-pill);
  margin-bottom: 12px;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
}

.card h3 {
  margin-bottom: 6px;
}

.card p {
  color: var(--text2);
  font-size: 15.5px;
  margin: 0;
}

.card-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: var(--r-md);
  background: var(--primary-soft);
  color: var(--primary);
  margin-bottom: 16px;
}

.card-icon svg {
  width: 24px;
  height: 24px;
}

.card-gold .card-icon {
  background: var(--gold-soft);
  color: var(--gold);
}

.tag-soon {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--warning);
  background: var(--warning-soft);
  border-radius: var(--r-pill);
  padding: 2px 10px;
  margin-inline-start: 8px;
  vertical-align: middle;
}

/* Screens rail */
.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 218px;
  gap: 20px;
  overflow-x: auto;
  padding-block: 6px 18px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.rail figure {
  margin: 0;
  scroll-snap-align: center;
}

/* Space is reserved here, in CSS, rather than with a `height` attribute on the <img>. An
   attribute would win over `width: 100%` and squash the screenshot for anyone whose browser is
   still holding an older copy of this stylesheet; a wrong aspect-ratio declaration cannot,
   because it ships in the same file as the rule it belongs to. */
.rail img,
.phone img {
  aspect-ratio: 620 / 1298;
}

.rail img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 22px;
  border: 1px solid var(--border);
  box-shadow: 0 14px 30px var(--shadow);
  background: #fff;
}

.rail figcaption {
  margin-top: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text2);
  text-align: center;
}

/* Callout / disclaimer */
.callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-inline-start: 4px solid var(--gold);
  border-radius: var(--r-md);
  padding: 22px 24px;
}

.callout h3 {
  margin-bottom: 8px;
}

.callout p {
  color: var(--text2);
  font-size: 15.5px;
}

.callout p:last-child {
  margin-bottom: 0;
}

/* Two-column CTA band */
.band {
  display: grid;
  grid-template-columns: 1.4fr auto;
  gap: 24px;
  align-items: center;
  background: var(--primary);
  color: #fff;
  border-radius: var(--r-xl);
  padding: clamp(26px, 4vw, 40px);
}

/* In dark mode --primary is the light teal, which white text cannot sit on. Keep the band the
   same deep green as the hero so the contrast holds in both themes. */
:root[data-theme='dark'] .band {
  background: linear-gradient(165deg, #12463c, #0e332c);
  border: 1px solid var(--border);
}

.band h2 {
  color: #fff;
  margin-bottom: 8px;
}

.band p {
  color: rgba(255, 255, 255, 0.84);
  margin: 0;
  font-size: 16px;
}

@media (max-width: 720px) {
  .band {
    grid-template-columns: 1fr;
  }
}

/* ─────────────────────────────  legal / article pages  ───────────────────────────── */
.page-head {
  background: linear-gradient(165deg, #0e5a4e, #0a4239);
  color: var(--on-dark);
  padding-block: clamp(36px, 6vw, 60px);
}

.page-head h1 {
  color: #fff;
  margin-bottom: 10px;
  font-size: clamp(27px, 4.4vw, 40px);
}

.page-head p {
  color: var(--on-dark2);
  margin: 0;
  max-width: 60ch;
}

.crumbs {
  font-size: 14px;
  color: var(--on-dark2);
  margin-bottom: 14px;
}

.crumbs a {
  color: var(--on-dark2);
}

.crumbs a:hover {
  color: #fff;
}

.doc {
  max-width: 760px;
  padding-block: clamp(32px, 5vw, 56px);
}

.doc h2 {
  font-size: clamp(20px, 2.6vw, 25px);
  margin-top: 2em;
  padding-top: 0.4em;
  border-top: 1px solid var(--line);
}

.doc h2:first-of-type {
  margin-top: 0.6em;
}

.doc h3 {
  font-size: 18px;
  margin-top: 1.6em;
}

.doc p,
.doc li {
  color: var(--text2);
}

.doc strong {
  color: var(--text);
  font-weight: 700;
}

.doc ul,
.doc ol {
  padding-inline-start: 1.35em;
  margin: 0 0 1em;
}

/* Arabic-Indic numerals, so the list markers match the ١، ٢، ٣ used in the headings. */
.doc ol,
.toc ol {
  list-style-type: arabic-indic;
}

.doc li {
  margin-bottom: 0.45em;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.4em;
  font-size: 15px;
}

.doc th,
.doc td {
  border: 1px solid var(--border);
  padding: 10px 13px;
  text-align: start;
  vertical-align: top;
  color: var(--text2);
}

.doc th {
  background: var(--surface2);
  color: var(--text);
  font-weight: 700;
}

.table-scroll {
  overflow-x: auto;
}

.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px 22px;
  margin-bottom: 2em;
}

.toc p {
  margin: 0 0 8px;
  font-weight: 800;
  color: var(--text);
}

.toc ol {
  margin: 0;
  font-size: 15.5px;
}

.updated {
  display: inline-block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--on-dark2);
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--r-pill);
  padding: 3px 13px;
  margin-top: 14px;
}

/* Contact rows (support page) */
.contact-list {
  display: grid;
  gap: 12px;
  /* auto-fill, not auto-fit: with only the email row configured it stays one card wide instead
     of stretching across the whole column. */
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  margin: 0 0 2em;
  padding: 0;
  list-style: none;
}

.contact-list a {
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 15px 18px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  height: 100%;
}

.contact-list a:hover {
  border-color: var(--primary);
}

.contact-list svg {
  width: 22px;
  height: 22px;
  color: var(--primary);
  flex: none;
}

.contact-list b {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
}

.contact-list span {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text2);
  line-height: 1.5;
  word-break: break-word;
}

details.faq {
  border-bottom: 1px solid var(--line);
  padding: 6px 0;
}

details.faq summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
  padding: 10px 0;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

details.faq summary::after {
  content: '+';
  color: var(--primary);
  font-weight: 800;
  font-size: 21px;
  line-height: 1;
  flex: none;
}

details.faq[open] summary::after {
  content: '−';
}

details.faq p:last-child {
  margin-bottom: 12px;
}

/* ─────────────────────────────  footer  ───────────────────────────── */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-block: 44px 28px;
  margin-top: 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(2, minmax(0, 1fr));
  gap: 28px;
  padding-bottom: 26px;
}

@media (max-width: 720px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }
}

.footer-grid p {
  color: var(--text2);
  font-size: 15px;
  max-width: 40ch;
}

.footer-grid h4 {
  font-size: 15px;
  margin-bottom: 10px;
}

.footer-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-grid li {
  margin-bottom: 6px;
}

.footer-grid a {
  color: var(--text2);
  text-decoration: none;
  font-size: 15px;
}

.footer-grid a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.social {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.social a {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  color: var(--text2);
}

.social a:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.social svg {
  width: 19px;
  height: 19px;
}

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text3);
}

/* Anything driven by site-config.js stays hidden until a value is actually configured. */
[hidden] {
  display: none !important;
}
