/* =========================================================
   ArabWay Studio — Professional Design System
   RTL-first · restrained palette · no decorative noise
   ========================================================= */

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

@font-face { font-family:'Tajawal'; src:url('../fonts/tajawal-400.woff2') format('woff2'); font-weight:400; font-display:swap; }
@font-face { font-family:'Tajawal'; src:url('../fonts/tajawal-500.woff2') format('woff2'); font-weight:500; font-display:swap; }
@font-face { font-family:'Tajawal'; src:url('../fonts/tajawal-700.woff2') format('woff2'); font-weight:700; font-display:swap; }
@font-face { font-family:'Tajawal'; src:url('../fonts/tajawal-800.woff2') format('woff2'); font-weight:800; font-display:swap; }
@font-face { font-family:'Amiri Quran'; src:url('../fonts/AmiriQuran-Regular.ttf') format('truetype'); font-weight:400; font-display:swap; }

:root {
  --bg: #0d1117;
  --bg-raised: #121821;
  --surface: #151d28;
  --surface-2: #1b2532;
  --border: #253141;
  --border-strong: #334358;
  --text: #e8edf4;
  --muted: #93a1b5;
  --muted-2: #6b7a8f;
  --accent: #c8a96a;
  --accent-soft: rgba(200, 169, 106, .12);
  --success: #5fbfa0;
  --danger: #d97a7a;
  --shadow: 0 18px 50px rgba(0, 0, 0, .35);
  --radius: 12px;
  --radius-sm: 8px;
  --max: 1160px;
  --header-h: 68px;
}

[data-theme="light"] {
  --bg: #f6f7f9;
  --bg-raised: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --border: #dfe4ea;
  --border-strong: #c8d0da;
  --text: #16202d;
  --muted: #5b6777;
  --muted-2: #8591a1;
  --accent: #8a6d34;
  --accent-soft: rgba(138, 109, 52, .09);
  --shadow: 0 16px 40px rgba(20, 32, 50, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); }
body {
  margin: 0;
  font-family: 'Tajawal', 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
::selection { background: var(--accent-soft); color: var(--text); }

/* ---------- Utilities ---------- */
.container { width: min(var(--max), calc(100% - 48px)); margin-inline: auto; }
.section { padding: 88px 0; }
.section-sm { padding: 56px 0; }
.text-center { text-align: center; }
.muted { color: var(--muted); }
.eyebrow {
  display: inline-block; padding: 5px 12px; border: 1px solid var(--border-strong);
  border-radius: 6px; color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .3px;
  margin-bottom: 16px;
}
h1, h2, h3, h4 { line-height: 1.35; margin: 0 0 12px; font-weight: 700; letter-spacing: -.2px; }
h1 { font-size: clamp(34px, 5vw, 52px); font-weight: 700; }
h2 { font-size: clamp(26px, 3.6vw, 36px); }
h3 { font-size: 18px; }
p { margin: 0 0 12px; }
.section-head { max-width: 660px; margin: 0 auto 44px; text-align: center; }
.section-head p { color: var(--muted); font-size: 16px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-weight: 600; font-size: 14px; transition: background .18s, border-color .18s, color .18s;
  white-space: nowrap; line-height: 1.6;
}
.btn-primary { background: var(--accent); color: #14100a; }
.btn-primary:hover { background: #d8ba7c; }
[data-theme="light"] .btn-primary { color: #fff; }
.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100; height: var(--header-h);
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -.3px; }
.brand-mark {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 7px;
  background: var(--accent); color: #14100a; font-size: 17px; font-weight: 700;
}
[data-theme="light"] .brand-mark { color: #fff; }
.brand small { display: block; font-size: 9px; color: var(--muted); font-weight: 500; letter-spacing: .8px; line-height: 1.2; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { padding: 8px 14px; border-radius: 6px; font-size: 13px; color: var(--muted); transition: .18s; }
.nav a:hover, .nav a.active { color: var(--text); background: var(--surface); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid var(--border); color: var(--muted); transition: .18s; font-size: 15px;
}
.icon-btn:hover { background: var(--surface); color: var(--text); }
.menu-btn { display: none; }
.scroll-progress { position: fixed; top: 0; right: 0; height: 2px; width: 0; z-index: 200; background: var(--accent); }

/* ---------- Hero ---------- */
.hero { padding: 80px 0 64px; border-bottom: 1px solid var(--border); }
.hero-grid { display: grid; grid-template-columns: 1fr .95fr; gap: 72px; align-items: center; }
.hero-badge {
  display: inline-block; padding: 6px 12px; border: 1px solid var(--border-strong);
  border-radius: 6px; font-size: 12px; color: var(--muted); margin-bottom: 22px;
}
.hero-badge b { color: var(--accent); }
.hero-lead { font-size: 17px; color: var(--muted); max-width: 580px; margin-bottom: 28px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 32px; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 22px; padding-top: 22px; border-top: 1px solid var(--border); }
.trust-item { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.trust-item .tick { color: var(--success); font-size: 14px; font-weight: 700; }

.hero-panel {
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 0; box-shadow: var(--shadow);
}
.hp-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
}
.hp-head strong { font-size: 13px; }
.hp-head span { font-size: 11px; color: var(--muted-2); font-family: 'Inter', monospace; direction: ltr; }
.hp-row { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.hp-row:last-child { border-bottom: 0; }
.hp-num {
  width: 26px; height: 26px; border: 1px solid var(--border-strong); border-radius: 6px;
  display: grid; place-items: center; font-size: 11px; color: var(--accent); flex: none;
  font-family: 'Inter', sans-serif; direction: ltr;
}
.hp-row strong { display: block; font-size: 13px; }
.hp-row small { color: var(--muted-2); font-size: 11px; }

/* ---------- Stats ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.stat-card { padding: 24px 20px; border-inline-end: 1px solid var(--border); }
.stat-card:last-child { border-inline-end: 0; }
.stat-num { font-family: 'Inter', sans-serif; font-size: 28px; font-weight: 600; color: var(--text); line-height: 1.2; margin-bottom: 4px; direction: ltr; }
.stat-card span { font-size: 12px; color: var(--muted); }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; transition: border-color .18s, background .18s;
}
.card:hover { border-color: var(--border-strong); }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 14px; margin: 0; }
.card-index {
  font-family: 'Inter', sans-serif; font-size: 11px; color: var(--accent);
  letter-spacing: 1px; margin-bottom: 18px; display: block;
}
.feature-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.feature-pill { padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.feature-pill .fp-num { font-size: 12px; color: var(--accent); font-family: 'Inter', sans-serif; display: block; margin-bottom: 10px; }
.feature-pill strong { display: block; font-size: 14px; margin-bottom: 4px; }
.feature-pill small { color: var(--muted); font-size: 12px; line-height: 1.7; }
.rules-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.step-card { padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.step-card h3 { font-size: 16px; }
.step-card p { color: var(--muted); font-size: 13px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
label.field-label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 7px; }
input[type="text"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="time"], textarea, select {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg);
  border: 1px solid var(--border-strong); color: var(--text); outline: none; transition: .18s; font-size: 14px;
}
textarea { resize: vertical; min-height: 110px; line-height: 1.8; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }
input[type="file"] { font-size: 12px; color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- FAQ ---------- */
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: 10px; overflow: hidden; }
.faq-q { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; background: none; border: 0; color: var(--text); font-weight: 600; text-align: start; font-size: 14px; }
.faq-q .plus { color: var(--accent); font-size: 18px; transition: transform .2s; }
.faq-item.open .faq-q .plus { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-a div { padding: 0 20px 18px; color: var(--muted); font-size: 13px; }
.faq-item.open .faq-a { max-height: 500px; }

/* ---------- CTA / Footer ---------- */
.cta-box { text-align: center; padding: 52px 28px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.cta-box p { color: var(--muted); max-width: 520px; margin: 0 auto 22px; }
.site-footer { border-top: 1px solid var(--border); padding: 52px 0 24px; margin-top: 40px; background: var(--bg-raised); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 36px; }
.footer-grid h4 { font-size: 13px; margin-bottom: 14px; }
.footer-grid a { display: block; color: var(--muted); font-size: 13px; padding: 4px 0; }
.footer-grid a:hover { color: var(--text); }
.footer-about p { color: var(--muted); font-size: 13px; max-width: 300px; }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 20px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted-2); font-size: 12px; }

/* ---------- Ads / Toast / misc ---------- */
.ad-slot { margin: 28px 0; text-align: center; min-height: 90px; display: grid; place-items: center; }
.ad-slot::before { content: "إعلان"; display: block; font-size: 9px; color: var(--muted-2); letter-spacing: 2px; margin-bottom: 6px; }
.ad-placeholder { width: 100%; max-width: 760px; min-height: 90px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); display: grid; place-items: center; gap: 4px; padding: 14px; color: var(--muted-2); font-size: 12px; }
.ad-placeholder strong { color: var(--muted); }
.toast { position: fixed; bottom: 24px; inset-inline-start: 24px; z-index: 300; background: var(--bg-raised); border: 1px solid var(--border-strong); color: var(--text); padding: 12px 18px; border-radius: var(--radius-sm); box-shadow: var(--shadow); font-size: 13px; transform: translateY(20px); opacity: 0; pointer-events: none; transition: .25s; }
.toast.show { transform: translateY(0); opacity: 1; }
.back-top { position: fixed; bottom: 24px; inset-inline-end: 24px; z-index: 90; width: 40px; height: 40px; border-radius: var(--radius-sm); background: var(--bg-raised); border: 1px solid var(--border-strong); color: var(--muted); display: grid; place-items: center; opacity: 0; pointer-events: none; transition: .25s; }
.back-top.show { opacity: 1; pointer-events: auto; }
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.reveal.visible { opacity: 1; transform: none; }
.page-head { padding: 56px 0 28px; text-align: center; }
.page-head h1 { font-size: clamp(30px, 4.5vw, 44px); margin-bottom: 10px; }
.page-head p { color: var(--muted); font-size: 16px; max-width: 620px; margin-inline: auto; }
.breadcrumb { font-size: 12px; color: var(--muted-2); margin-bottom: 12px; }
.article { max-width: 820px; margin-inline: auto; }
.article h2 { font-size: 24px; margin: 40px 0 14px; padding-inline-start: 14px; border-inline-start: 3px solid var(--accent); }
.article h3 { font-size: 18px; margin: 26px 0 10px; }
.article p, .article li { color: var(--muted); }
.article ul, .article ol { padding-inline-start: 22px; }
.article li { margin-bottom: 8px; }
.article a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article blockquote { margin: 24px 0; padding: 16px 20px; border-inline-start: 3px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--muted); }
.article table { width: 100%; border-collapse: collapse; margin: 22px 0; font-size: 13px; }
.article th, .article td { padding: 11px; border: 1px solid var(--border); text-align: start; }
.article th { background: var(--surface-2); color: var(--text); }
.article code { background: var(--surface-2); padding: 2px 6px; border-radius: 5px; font-family: 'Inter', monospace; font-size: 12px; direction: ltr; display: inline-block; }
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 32px; }
.toc strong { display: block; margin-bottom: 10px; font-size: 13px; }
.toc a { display: block; padding: 6px 0; color: var(--muted); font-size: 13px; border-bottom: 1px solid var(--border); }
.toc a:hover { color: var(--text); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .hero-panel { max-width: 560px; }
  .feature-strip { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .nav { position: absolute; top: var(--header-h); inset-inline: 0; flex-direction: column; background: var(--bg-raised); border-bottom: 1px solid var(--border); padding: 12px 24px 18px; transform: translateY(-10px); opacity: 0; pointer-events: none; transition: .2s; align-items: stretch; }
  .nav.open { transform: none; opacity: 1; pointer-events: auto; }
  .menu-btn { display: grid; }
  .grid-3, .grid-2, .stats-grid, .rules-grid { grid-template-columns: 1fr; }
  .stat-card { border-inline-end: 0; border-bottom: 1px solid var(--border); }
  .stat-card:last-child { border-bottom: 0; }
  .section { padding: 60px 0; }
  .hero { padding: 52px 0 44px; }
}
@media (max-width: 520px) {
  .container { width: min(var(--max), calc(100% - 28px)); }
  .feature-strip, .field-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .header-actions .btn span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
