/**
 * New design system — distinct from previous rebrand.
 * Typography: Tajawal (Arabic), Outfit (Latin fallback).
 * No reuse of old class names or token names.
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Tajawal:wght@400;500;700;800&display=swap');

:root {
  /* Palette */
  --brand-deep: #0d3b4c;
  --brand-mid: #1a5f73;
  --brand-light: #e8f4f2;
  --accent: #c9a227;
  --accent-hover: #a8841a;
  --ink: #1a1d21;
  --ink-muted: #5c6369;
  --surface: #ffffff;
  --surface-alt: #f6f8fa;
  --border-color: #e2e6ea;
  --success: #0d7d4a;
  --error: #b91c1c;

  /* Spacing scale (different rhythm) */
  --r1: 0.25rem;   /* 4px */
  --r2: 0.5rem;    /* 8px */
  --r3: 0.75rem;   /* 12px */
  --r4: 1rem;      /* 16px */
  --r5: 1.25rem;   /* 20px */
  --r6: 1.5rem;    /* 24px */
  --r8: 2rem;      /* 32px */
  --r10: 2.5rem;   /* 40px */
  --r12: 3rem;     /* 48px */
  --r16: 4rem;     /* 64px */
  --r20: 5rem;     /* 80px */
  --r24: 6rem;     /* 96px */

  /* Typography scale */
  --font-display: 'Tajawal', 'Outfit', sans-serif;
  --font-text: 'Tajawal', 'Outfit', sans-serif;
  --text-2xs: 0.8125rem;
  --text-xs: 0.875rem;
  --text-sm: 0.9375rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;

  /* Layout */
  --page-max: 75rem;
  --page-gutter: 1.25rem;
  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 16px;
  --shadow-s: 0 1px 4px rgba(0,0,0,0.06);
  --shadow-m: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-l: 0 12px 40px rgba(0,0,0,0.1);
}

@media (min-width: 768px) {
  :root {
    --page-gutter: 2rem;
  }
}

/* Reset / base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-text);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--ink);
  background: var(--surface);
  direction: rtl;
  text-align: right;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-mid); text-decoration: none; }
a:hover { color: var(--brand-deep); text-decoration: underline; }

/* Layout */
.wrap {
  max-width: var(--page-max);
  margin: 0 auto;
  padding-left: var(--page-gutter);
  padding-right: var(--page-gutter);
}

/* Header — new structure: single bar, logo left (RTL: right), nav center, CTA right */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4rem;
  gap: var(--r6);
}
.site-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xl);
  color: var(--brand-deep);
}
.site-logo a { color: inherit; text-decoration: none; display: flex; align-items: center; }
.site-logo a:hover { text-decoration: none; opacity: 0.9; }
.site-logo__img {
  display: block;
  height: 4.5rem;
  width: auto;
  max-width: 360px;
  object-fit: contain;
  object-position: right center;
}
@media (min-width: 768px) {
  .site-logo__img {
    height: 5.5rem;
    max-width: 420px;
  }
}

.nav-main {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: var(--r6);
}
@media (min-width: 768px) {
  .nav-main { display: flex; flex-wrap: wrap; }
}
.nav-main a {
  color: var(--ink);
  padding: var(--r2) var(--r3);
  border-radius: var(--radius-s);
  font-weight: 500;
}
.nav-main a:hover { background: var(--surface-alt); text-decoration: none; }

.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--border-color);
  background: var(--surface);
  border-radius: var(--radius-s);
  cursor: pointer;
  font-size: 1.25rem;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--r3);
  flex-wrap: wrap;
}
.header-actions .btn { white-space: nowrap; }
.header-actions .link-signin {
  color: var(--ink-muted);
  font-size: var(--text-sm);
  font-weight: 500;
}
.header-actions .link-signin:hover { color: var(--brand-mid); text-decoration: none; }
.nav-cta { display: none !important; }
@media (min-width: 768px) {
  .nav-toggle { display: none; }
  .nav-cta { display: inline-flex !important; }
}
@media (max-width: 767px) {
  .header-actions { display: none; }
}
.nav-drawer .drawer-actions { margin-top: var(--r2); padding-top: var(--r4); border-top: 1px solid var(--border-color); }
.nav-drawer .drawer-actions a { display: block; }
.nav-drawer .drawer-actions .btn { width: 100%; justify-content: center; }

.nav-drawer {
  position: fixed;
  top: 4rem;
  right: 0;
  left: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border-color);
  padding: var(--r4);
  display: none;
  flex-direction: column;
  gap: var(--r2);
  z-index: 99;
  max-height: calc(100vh - 4rem);
  overflow: auto;
}
.nav-drawer.is-open { display: flex; }
@media (min-width: 768px) { .nav-drawer { display: none !important; } }
.nav-drawer a {
  padding: var(--r3);
  color: var(--ink);
  font-weight: 500;
  border-radius: var(--radius-s);
}
.nav-drawer a:hover { background: var(--surface-alt); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--r2);
  padding: var(--r3) var(--r6);
  font-family: var(--font-text);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-m);
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn-primary {
  background: var(--brand-deep);
  color: var(--surface);
}
.btn-primary:hover { background: var(--brand-mid); color: var(--surface); text-decoration: none; }
.btn-secondary {
  background: var(--accent);
  color: var(--ink);
}
.btn-secondary:hover { background: var(--accent-hover); color: var(--ink); text-decoration: none; }
.btn-outline {
  background: transparent;
  color: var(--brand-deep);
  border: 2px solid var(--brand-deep);
}
.btn-outline:hover { background: var(--brand-light); text-decoration: none; }

/* Hero — split layout (text | image) */
.hero-split {
  display: grid;
  gap: var(--r8);
  align-items: center;
  padding: var(--r12) 0;
  min-height: 60vh;
}
@media (min-width: 768px) {
  .hero-split { grid-template-columns: 1fr 1fr; padding: var(--r20) 0; }
}
.hero-split__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl));
  line-height: 1.2;
  color: var(--brand-deep);
  margin: 0 0 var(--r4);
}
.hero-split__lead {
  font-size: var(--text-lg);
  color: var(--ink-muted);
  margin: 0 0 var(--r6);
  max-width: 32ch;
}
.hero-split__actions { display: flex; flex-wrap: wrap; gap: var(--r4); }
.hero-split__media {
  background: var(--surface-alt);
  border-radius: var(--radius-l);
  aspect-ratio: 4/3;
  overflow: hidden;
}
.hero-split__media img { width: 100%; height: 100%; object-fit: cover; }

/* Split section (image + content) */
.wrap--split {
  display: grid;
  gap: var(--r8);
  align-items: center;
}
@media (min-width: 768px) {
  .wrap--split { grid-template-columns: 1fr 1fr; }
  .wrap--split .split-media { order: 0; }
  .wrap--split .split-content { order: 1; }
}
.split-media { border-radius: var(--radius-l); overflow: hidden; }
.split-media img { width: 100%; height: auto; object-fit: cover; }

/* Section block */
.section {
  padding: var(--r16) 0;
}
.section--alt { background: var(--surface-alt); }
.section__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-3xl);
  color: var(--brand-deep);
  margin: 0 0 var(--r6);
  text-align: center;
}
.section__lead {
  font-size: var(--text-lg);
  color: var(--ink-muted);
  max-width: 42rem;
  margin: 0 auto var(--r10);
  text-align: center;
}

/* Timeline (steps) — different from old “cards” */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}
.step {
  display: grid;
  gap: var(--r4);
  padding: var(--r6) 0;
  border-right: 3px solid var(--border-color);
  padding-right: var(--r6);
  margin-right: var(--r4);
  position: relative;
  counter-increment: step;
}
.step::before {
  content: counter(step);
  position: absolute;
  right: calc(-1 * var(--r6) - 10px);
  top: var(--r6);
  width: 1.75rem;
  height: 1.75rem;
  background: var(--accent);
  color: var(--ink);
  font-weight: 700;
  font-size: var(--text-xs);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step__title { font-weight: 700; font-size: var(--text-xl); color: var(--ink); margin: 0 0 var(--r2); }
.step__text { color: var(--ink-muted); margin: 0; }

/* Feature tabs */
.tabs {
  margin: 0 0 var(--r8);
}
.tabs__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--r2);
  list-style: none;
  margin: 0 0 var(--r6);
  padding: 0;
  border-bottom: 2px solid var(--border-color);
}
.tabs__tab {
  padding: var(--r3) var(--r5);
  font-weight: 600;
  color: var(--ink-muted);
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-text);
  font-size: var(--text-sm);
  border-radius: var(--radius-s);
}
.tabs__tab:hover { color: var(--ink); }
.tabs__tab.is-active { color: var(--brand-deep); background: var(--brand-light); }
.tabs__panel { display: none; }
.tabs__panel.is-active { display: block; }
.tabs__panel h3 { font-size: var(--text-xl); margin: 0 0 var(--r4); color: var(--brand-deep); }
.tabs__panel p { color: var(--ink-muted); margin: 0; }

/* FAQ accordion */
.faq-list { margin: 0; padding: 0; list-style: none; }
.faq-item {
  border-bottom: 1px solid var(--border-color);
}
.faq-item__head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--r5) 0;
  font-family: var(--font-text);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--ink);
  background: none;
  border: none;
  cursor: pointer;
  text-align: right;
}
.faq-item__head:hover { color: var(--brand-mid); }
.faq-item__head::after {
  content: '+';
  font-size: var(--text-xl);
  color: var(--brand-mid);
  flex-shrink: 0;
  margin-right: var(--r3);
}
.faq-item.is-open .faq-item__head::after { content: '−'; }
.faq-item__body {
  display: none;
  padding: 0 0 var(--r5);
  color: var(--ink-muted);
}
.faq-item.is-open .faq-item__body { display: block; }

/* CTA strip */
.cta-strip {
  background: var(--brand-deep);
  color: var(--surface);
  padding: var(--r12) 0;
  text-align: center;
}
.cta-strip__title { font-size: var(--text-2xl); margin: 0 0 var(--r4); font-weight: 700; }
.cta-strip__title a { color: inherit; }
.cta-strip__title a:hover { text-decoration: none; opacity: 0.9; }
.cta-strip .btn { margin-top: var(--r4); }

/* Portfolio grid (المحافظ الاستثمارية) */
.portfolio-grid {
  display: grid;
  gap: var(--r6);
  margin-bottom: var(--r10);
}
@media (min-width: 640px) { .portfolio-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .portfolio-grid { grid-template-columns: repeat(3, 1fr); } }
.portfolio-card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-m);
  overflow: hidden;
  box-shadow: var(--shadow-s);
}
.portfolio-card__accent {
  height: 4px;
  background: var(--accent);
}
/* Tier colors — professional palette */
.portfolio-card--bronze .portfolio-card__accent { background: #B87333; }
.portfolio-card--bronze .portfolio-card__title { color: #8B5A2B; }
.portfolio-card--silver .portfolio-card__accent { background: #94A3B8; }
.portfolio-card--silver .portfolio-card__title { color: #64748B; }
.portfolio-card--gold .portfolio-card__accent { background: #D4A84B; }
.portfolio-card--gold .portfolio-card__title { color: #B8860B; }
.portfolio-card--vip .portfolio-card__accent { background: #7C3AED; }
.portfolio-card--vip .portfolio-card__title { color: #6D28D9; }
.portfolio-card--diamond .portfolio-card__accent { background: #06B6D4; }
.portfolio-card--diamond .portfolio-card__title { color: #0891B2; }
.portfolio-card__inner { padding: var(--r6); }
.portfolio-card__title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--brand-deep);
  margin: 0 0 var(--r4);
}
.portfolio-card__list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: var(--text-sm);
  color: var(--ink-muted);
  line-height: 1.65;
}
.portfolio-card__list li { margin-bottom: var(--r2); }
.portfolio-card__list li:last-child { margin-bottom: 0; }
.portfolio-registry {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--ink-muted);
  margin: 0;
  padding: var(--r4);
  background: var(--surface);
  border-radius: var(--radius-m);
  border: 1px solid var(--border-color);
}
.portfolio-registry a { font-weight: 600; }

/* Cards — new style (border-top accent) */
.card-block {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-m);
  overflow: hidden;
  box-shadow: var(--shadow-s);
  transition: box-shadow 0.2s;
}
.card-block:hover { box-shadow: var(--shadow-m); }
.card-block__accent {
  height: 4px;
  background: var(--accent);
}
.card-block__inner { padding: var(--r6); }
.card-block__title { font-size: var(--text-xl); font-weight: 700; margin: 0 0 var(--r3); color: var(--brand-deep); }
.card-block__text { color: var(--ink-muted); margin: 0; }

/* Footer — full layout with about block + columns */
.site-footer {
  background: linear-gradient(135deg, var(--brand-deep) 0%, #0a5268 100%);
  background-color: var(--brand-deep);
  color: var(--surface);
  padding: var(--r16) 0 var(--r8);
}
.site-footer a { color: var(--brand-light); }
.site-footer a:hover { text-decoration: underline; }
.footer-about-block {
  margin-bottom: var(--r10);
  max-width: 42rem;
}
.footer-about-block .footer-about__text {
  margin: 0 0 var(--r4);
  font-size: var(--text-sm);
  line-height: 1.65;
  color: rgba(255,255,255,0.9);
}
.footer-about-block .footer-cma-link {
  color: #7dd3fc !important;
  text-decoration: underline;
  font-weight: 500;
}
.footer-about-block .footer-cma-link:hover { color: #bae6fd !important; text-decoration: underline; }
.footer-grid {
  display: grid;
  gap: var(--r8);
  margin-bottom: var(--r10);
}
@media (min-width: 640px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: repeat(4, 1fr); } }
.footer-col__title {
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 var(--r4);
  color: var(--surface);
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: var(--r2); }
.footer-bottom {
  padding-top: var(--r6);
  border-top: 1px solid rgba(255,255,255,0.2);
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.85);
  text-align: center;
}
.footer-bottom p { margin: 0; }

/* Forms */
.form-group { margin-bottom: var(--r5); }
.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: var(--r2);
  color: var(--ink);
}
.form-control {
  width: 100%;
  padding: var(--r3) var(--r4);
  font-family: var(--font-text);
  font-size: var(--text-base);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-s);
  background: var(--surface);
}
.form-control:focus {
  outline: none;
  border-color: var(--brand-mid);
  box-shadow: 0 0 0 3px rgba(26, 95, 115, 0.2);
}
.form-control.is-invalid { border-color: var(--error); }
.form-hint { font-size: var(--text-xs); color: var(--ink-muted); margin-top: var(--r2); }
textarea.form-control { min-height: 120px; resize: vertical; }
.form-actions { margin-top: var(--r6); }
.form-message { margin-top: var(--r4); padding: var(--r4); border-radius: var(--radius-s); font-size: var(--text-sm); }
.form-message--success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.form-message--error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.form-footer-note { margin-top: var(--r8); font-size: var(--text-sm); color: var(--ink-muted); }
.checkbox-label { display: flex; align-items: flex-start; gap: var(--r3); cursor: pointer; font-weight: 400; }
.checkbox-label input[type="checkbox"] { margin-top: 0.2em; flex-shrink: 0; }
.checkbox-label span { flex: 1; }

/* Page title (inner pages) */
.page-head {
  background: var(--surface-alt);
  padding: var(--r10) 0;
  margin-bottom: var(--r12);
}
.page-head__title { font-size: var(--text-3xl); font-weight: 700; color: var(--brand-deep); margin: 0; }

/* Report abuse block (Contact) */
.report-abuse {
  margin-top: var(--r12);
  padding: var(--r6);
  background: var(--surface-alt);
  border-radius: var(--radius-m);
  border: 1px solid var(--border-color);
}
.report-abuse__title { font-size: var(--text-lg); font-weight: 600; margin: 0 0 var(--r3); }
.report-abuse__text { font-size: var(--text-sm); color: var(--ink-muted); margin: 0; }

/* About page intro (replaces first banner) */
.about-intro {
  background: var(--surface-alt);
  padding: var(--r10) 0;
}
.about-intro__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--brand-deep);
  margin: 0 0 var(--r5);
}
.about-intro__text {
  margin: 0 0 var(--r4);
  color: var(--ink);
  line-height: 1.7;
  max-width: 50rem;
}
.about-intro__text:last-child { margin-bottom: 0; }

/* About page banner */
.about-banner {
  width: 100%;
  margin-bottom: var(--r8);
  overflow: hidden;
}
.about-banner img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  max-height: 28rem;
}

/* Prose figure (about page inline image) */
.prose-figure {
  margin: var(--r6) 0;
}
.prose-figure img {
  width: 100%;
  max-width: 20rem;
  height: auto;
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-m);
}
.prose-figure figcaption {
  font-size: var(--text-xs);
  color: var(--ink-muted);
  margin-top: var(--r2);
}
@media (min-width: 640px) {
  .prose-figure--right {
    float: left;
    margin-left: var(--r6);
    margin-bottom: var(--r4);
  }
  .prose-figure--right img { max-width: 18rem; }
}

/* Content prose (legal pages) */
.prose {
  max-width: 50rem;
  margin: 0 auto;
}
.prose h2 { font-size: var(--text-xl); margin: var(--r8) 0 var(--r4); color: var(--brand-deep); }
.prose p { margin: 0 0 var(--r4); }
.prose ul { margin: 0 0 var(--r4); padding-right: 1.5em; }
.prose::after { content: ''; display: table; clear: both; }
