/* ==========================================================================
   نور تراك — نظام التصميم الموحد
   1) الرموز (Tokens)  2) الأساس  3) التخطيط  4) المكونات  5) الأقسام  6) الاستجابة
   مكتوب بخصائص منطقية (inline-start/end) ليعمل RTL بدون ملف منفصل.
   ========================================================================== */

/* ---------- الخط: القاهرة (مستضاف محلياً) ---------- */
@font-face {
	font-family: "Cairo";
	font-style: normal;
	font-weight: 300 900;
	font-display: swap;
	src: url("../fonts/cairo-arabic.woff2") format("woff2");
	unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+FB50-FDFF, U+FE70-FEFC;
}
@font-face {
	font-family: "Cairo";
	font-style: normal;
	font-weight: 300 900;
	font-display: swap;
	src: url("../fonts/cairo-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- 1) الرموز ---------- */
:root {
	/* الألوان — مستخرجة من ملفات نور تراك */
	--ink: #130f26;            /* أعمق بنفسجي (خلفية الغلاف) */
	--brand-900: #2d0d62;      /* العناوين والأزرار الأساسية */
	--brand-700: #623ca4;      /* الروابط والتمييز */
	--brand-500: #8b5cf6;
	--brand-300: #a78bfa;      /* بنفسجي فاتح على الخلفيات الداكنة */
	--blue-800: #143f87;
	--blue-500: #2f7ded;
	--sky: #38b6f0;            /* لون السهم في الشعار */
	--cyan: #00f0ff;           /* لمسة تقنية — على الخلفيات الداكنة فقط */
	--danger: #e5303a;

	--bg: #ffffff;
	--surface: #f4f6fb;        /* خلفية الأقسام البديلة */
	--surface-2: #e8ecf4;
	--line: #d2d8de;
	--text: #130f26;
	--muted: #4a4f63;
	--on-dark: #e2e8f0;
	--on-dark-muted: #b9c0d4;

	/* الخط والمقاييس */
	--font: "Cairo", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
	--fs-xs: 0.8125rem;
	--fs-sm: 0.9375rem;
	--fs-md: 1rem;
	--fs-lg: 1.125rem;
	--fs-xl: clamp(1.125rem, 1.5vw + 0.8rem, 1.375rem);
	--fs-h3: clamp(1.125rem, 1vw + 0.9rem, 1.3125rem);
	--fs-h2: clamp(1.625rem, 2.6vw + 0.9rem, 2.5rem);
	--fs-h1: clamp(2rem, 4.2vw + 0.8rem, 3.5rem);

	/* مسافات (سلم 4px) */
	--s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem;
	--s-5: 1.5rem; --s-6: 2rem; --s-7: 3rem; --s-8: 4.5rem; --s-9: 6rem;

	/* الزوايا والظلال */
	--r-sm: 8px; --r-md: 14px; --r-lg: 22px; --r-pill: 999px;
	--shadow-sm: 0 1px 2px rgb(19 15 38 / 0.06), 0 2px 8px rgb(19 15 38 / 0.05);
	--shadow-md: 0 8px 28px rgb(45 13 98 / 0.12);
	--ring: 0 0 0 3px rgb(139 92 246 / 0.45);

	--container: 1200px;
	--gutter: clamp(1rem, 4vw, 2rem);
	--header-h: 72px;
	--ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- 2) الأساس ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-block-start: calc(var(--header-h) + 16px); }
body {
	margin: 0;
	font-family: var(--font);
	font-size: var(--fs-md);
	line-height: 1.8;
	color: var(--text);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { margin: 0 0 var(--s-3); line-height: 1.35; color: var(--brand-900); font-weight: 800; letter-spacing: 0; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 700; }
p { margin: 0 0 var(--s-4); }
a { color: var(--brand-700); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand-900); }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }
::selection { background: var(--brand-300); color: var(--ink); }
.icon { width: 1.25em; height: 1.25em; flex: none; }
.muted { color: var(--muted); font-weight: 400; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link {
	position: absolute; inset-block-start: -100px; inset-inline-start: var(--s-4); z-index: 200;
	background: var(--brand-900); color: #fff; padding: var(--s-2) var(--s-4); border-radius: var(--r-sm);
}
.skip-link:focus { inset-block-start: var(--s-3); color: #fff; }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- 3) التخطيط ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--s-8); }
.section-alt { background: var(--surface); }
.section-dark {
	background: radial-gradient(900px 420px at 12% 0%, rgb(0 240 255 / 0.10), transparent 60%),
	            radial-gradient(800px 460px at 100% 100%, rgb(139 92 246 / 0.22), transparent 60%),
	            var(--ink);
	color: var(--on-dark);
}
.section-dark h1, .section-dark h2, .section-dark h3 { color: #fff; }
.section-dark .lead, .section-dark p { color: var(--on-dark-muted); }
.section-head { max-width: 720px; margin-bottom: var(--s-7); }
.section-head .lead { margin-bottom: 0; }
.grid { display: grid; gap: var(--s-5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-7); align-items: center; }
.split-reverse .split-copy { order: 2; }
.split-media img { border-radius: var(--r-lg); box-shadow: var(--shadow-md); width: 100%; }
.stack-2 { display: grid; gap: var(--s-4); }
.eyebrow {
	display: inline-block; margin: 0 0 var(--s-3);
	font-size: var(--fs-sm); font-weight: 700; color: var(--brand-700);
	letter-spacing: 0;
}
.eyebrow-light { color: var(--brand-300); }
.lead { font-size: var(--fs-xl); color: var(--muted); line-height: 1.85; max-width: 62ch; }

/* ---------- 4) المكونات ---------- */
/* أزرار */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
	min-height: 46px; padding: 0.55rem 1.4rem;
	font: 700 var(--fs-md)/1.2 var(--font);
	border: 2px solid transparent; border-radius: var(--r-pill);
	text-decoration: none; cursor: pointer; white-space: nowrap;
	transition: transform .2s var(--ease), background-color .2s, color .2s, border-color .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-lg { min-height: 52px; padding-inline: 1.9rem; font-size: var(--fs-lg); }
.btn-primary { background: var(--brand-900); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-700); color: #fff; box-shadow: var(--shadow-md); }
.btn-secondary { background: transparent; color: var(--brand-900); border-color: var(--brand-900); }
.btn-secondary:hover { background: var(--brand-900); color: #fff; }
.btn-accent { background: var(--cyan); color: var(--ink); }
.btn-accent:hover { background: #fff; color: var(--ink); }
.btn-outline-light { background: transparent; color: #fff; border-color: rgb(255 255 255 / .6); }
.btn-outline-light:hover { background: #fff; color: var(--ink); }
.icon-end { width: 1.1em; height: 1.1em; }

/* بطاقات */
.card {
	display: flex; flex-direction: column; gap: var(--s-2);
	background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
	padding: var(--s-5); color: var(--text); text-decoration: none;
	box-shadow: var(--shadow-sm);
	transition: transform .25s var(--ease), box-shadow .25s, border-color .25s;
}
.card h2, .card h3 { margin: var(--s-2) 0 0; font-size: var(--fs-h3); }
.card p { margin: 0; color: var(--muted); font-size: var(--fs-sm); line-height: 1.8; }
.card-plain { box-shadow: none; }
.section-alt .card { background: #fff; }
.card-link:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--brand-300); color: var(--text); }
.card-link:hover .card-more .icon { transform: translateX(-4px); }
.card-icon {
	display: grid; place-items: center; width: 48px; height: 48px;
	border-radius: var(--r-md);
	background: linear-gradient(135deg, var(--brand-900), var(--brand-700));
	color: #fff;
}
.card-icon .icon { width: 24px; height: 24px; }
.card-more { margin-top: auto; padding-top: var(--s-3); display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 700; font-size: var(--fs-sm); color: var(--brand-700); }
.card-more .icon { transition: transform .2s var(--ease); }
.card-row { padding: 0; overflow: hidden; }
.card-row .card-thumb { width: 100%; aspect-ratio: 1100 / 581; object-fit: cover; border-bottom: 1px solid var(--line); }
.card-row .card-body { padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-2); flex: 1; }
.badge {
	align-self: flex-start; margin-top: var(--s-2);
	padding: 0.15rem 0.8rem; border-radius: var(--r-pill);
	background: rgb(98 60 164 / 0.1); color: var(--brand-900); font-size: var(--fs-xs); font-weight: 700;
}

/* قوائم */
.check-list { display: grid; gap: var(--s-2); margin: 0 0 var(--s-5); }
.check-list li { display: flex; gap: var(--s-2); align-items: center; color: var(--on-dark); font-weight: 600; }
.check-list .icon { color: var(--cyan); }

/* فتات الخبز */
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-2); font-size: var(--fs-sm); margin-bottom: var(--s-4); color: var(--muted); }
.breadcrumb li + li::before { content: "‹"; margin-inline-end: var(--s-2); color: var(--line); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand-700); }

/* جدول */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow-sm); }
.table { width: 100%; border-collapse: collapse; min-width: 480px; }
.table th, .table td { padding: var(--s-4) var(--s-5); text-align: start; border-bottom: 1px solid var(--line); }
.table thead th { background: var(--brand-900); color: #fff; font-weight: 700; }
.table tbody th { font-weight: 700; color: var(--brand-900); width: 50%; }
.table tbody tr:last-child th, .table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:nth-child(even) { background: var(--surface); }

/* نموذج */
.form { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-6); box-shadow: var(--shadow-sm); }
.form h2 { font-size: 1.5rem; }
.form-note { color: var(--muted); font-size: var(--fs-sm); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); margin-block: var(--s-5); }
.field { display: flex; flex-direction: column; gap: var(--s-1); }
.field-full { grid-column: 1 / -1; }
.field label { font-weight: 700; font-size: var(--fs-sm); }
.req { color: var(--danger); }
.field input, .field select, .field textarea {
	width: 100%; min-height: 48px; padding: 0.6rem 0.9rem;
	font: inherit; color: var(--text); background: #fff;
	border: 1.5px solid var(--line); border-radius: var(--r-md);
	transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: var(--ring); }
.field input:user-invalid, .field select:user-invalid { border-color: var(--danger); }
.alert { padding: var(--s-3) var(--s-4); border-radius: var(--r-md); margin-block: var(--s-4); font-weight: 600; }
.alert-success { background: #e7f7ee; color: #0b5d33; border: 1px solid #a9e2c2; }
.alert-error { background: #fdecee; color: #8e1b24; border: 1px solid #f3b7bc; }

/* ---------- 5) الأقسام ---------- */
/* الرأس */
.site-header {
	position: sticky; inset-block-start: 0; z-index: 100;
	background: rgb(255 255 255 / 0.92); backdrop-filter: saturate(1.4) blur(10px);
	border-bottom: 1px solid transparent;
	transition: border-color .2s, box-shadow .2s;
}
.site-header.is-scrolled { border-color: var(--line); box-shadow: var(--shadow-sm); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: var(--s-3); text-decoration: none; color: var(--brand-900); }
.brand-mark { height: 46px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 1.5rem; font-weight: 900; color: var(--brand-900); }
.brand-sub { font-size: 0.625rem; font-weight: 600; letter-spacing: 0.06em; color: var(--brand-700); text-transform: uppercase; }
.main-nav { display: flex; align-items: center; gap: var(--s-5); }
.main-nav ul { display: flex; gap: var(--s-1); }
.main-nav li a {
	display: block; padding: 0.5rem 0.9rem; border-radius: var(--r-pill);
	color: var(--text); font-weight: 600; text-decoration: none;
	transition: background-color .2s, color .2s;
}
.main-nav li a:hover { background: var(--surface); color: var(--brand-700); }
.main-nav li a[aria-current="page"] { color: var(--brand-700); background: rgb(98 60 164 / 0.1); }
.nav-toggle {
	display: none; width: 46px; height: 46px; padding: 0; place-items: center;
	background: var(--surface); color: var(--brand-900); border: 0; border-radius: var(--r-md); cursor: pointer;
}
.nav-toggle .icon { width: 24px; height: 24px; }
.nav-toggle .i-close { display: none; }
.nav-toggle[aria-expanded="true"] .i-open { display: none; }
.nav-toggle[aria-expanded="true"] .i-close { display: block; }

/* الهيرو */
.hero {
	position: relative; overflow: hidden;
	background: radial-gradient(900px 480px at 85% 10%, rgb(139 92 246 / 0.16), transparent 60%),
	            radial-gradient(700px 420px at 0% 100%, rgb(56 182 240 / 0.16), transparent 60%),
	            linear-gradient(180deg, #f4f6fb, #fff);
	padding-block: var(--s-8) var(--s-8);
}
.hero-inner { display: grid; grid-template-columns: 1.05fr 1fr; gap: var(--s-7); align-items: center; }
.hero h1 { margin-bottom: var(--s-4); }
.grad { background: linear-gradient(90deg, var(--brand-700), var(--blue-500)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-block: var(--s-5); }
.hero-points { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); font-weight: 600; color: var(--muted); font-size: var(--fs-sm); }
.hero-points li { display: inline-flex; align-items: center; gap: var(--s-2); }
.hero-points .icon { color: var(--brand-700); }
.hero-media img { border-radius: var(--r-lg); box-shadow: 0 24px 60px rgb(45 13 98 / 0.22); width: 100%; }

/* الإحصاءات */
.stats { background: var(--brand-900); color: #fff; }
.stats-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--s-4); padding-block: var(--s-6); text-align: center; }
.stats-grid strong { display: block; font-size: clamp(1.6rem, 3vw, 2.25rem); line-height: 1.2; font-weight: 900; color: var(--cyan); }
.stats-grid span { font-size: var(--fs-sm); color: var(--on-dark); }

/* رأس الصفحات الداخلية */
.page-hero {
	padding-block: var(--s-7) var(--s-6);
	background: radial-gradient(800px 360px at 90% 0%, rgb(139 92 246 / 0.14), transparent 60%), var(--surface);
	border-bottom: 1px solid var(--line);
}
.page-hero .lead { margin-bottom: 0; }
.service-hero { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-6); align-items: center; }
.service-hero .eyebrow { text-align: start; }
.service-media img { border-radius: var(--r-lg); box-shadow: var(--shadow-md); width: 100%; }

/* شريط الدعوة */
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s-6); flex-wrap: wrap; }
.cta-inner h2 { margin-bottom: var(--s-2); }
.cta-inner p { margin: 0; max-width: 56ch; }
.cta-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }

/* تواصل */
.contact-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--s-6); align-items: start; }
.contact-aside { background: var(--surface); border-radius: var(--r-lg); padding: var(--s-6); }
.contact-aside h2 { font-size: 1.5rem; }
.contact-list { display: grid; gap: var(--s-5); }
.contact-list li { display: flex; gap: var(--s-3); align-items: flex-start; }
.contact-list .icon { width: 24px; height: 24px; color: var(--brand-700); margin-top: 0.3rem; }
.contact-list div { display: flex; flex-direction: column; }
.contact-list strong { color: var(--brand-900); }

/* الخريطة (صفحة تواصل فقط) */
.map-frame { border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-sm); margin-bottom: var(--s-5); aspect-ratio: 16 / 7; background: var(--surface-2); }
.map-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
@media (max-width: 640px) { .map-frame { aspect-ratio: 4 / 3; } }

/* نص عام */
.prose { max-width: 760px; }
.prose h2 { margin-top: var(--s-6); }

/* التذييل */
.site-footer { background: var(--ink); color: var(--on-dark-muted); padding-block-start: var(--s-8); font-size: var(--fs-sm); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1.2fr 0.8fr 1.1fr; gap: var(--s-6); }
.footer-title { color: #fff; font-size: var(--fs-md); margin-bottom: var(--s-4); }
.footer-links { display: grid; gap: var(--s-2); }
.site-footer a { color: var(--on-dark); text-decoration: none; }
.site-footer a:hover { color: var(--cyan); text-decoration: underline; }
.footer-brand p { margin-block: var(--s-4); max-width: 38ch; }
.brand-on-dark .brand-name { color: #fff; }
.brand-on-dark .brand-sub { color: var(--brand-300); }
.brand-badge { display: grid; place-items: center; width: 52px; height: 52px; background: #fff; border-radius: var(--r-md); }
.brand-badge .brand-mark { height: 36px; }
.footer-contact { display: grid; gap: var(--s-3); }
.footer-contact li { display: flex; gap: var(--s-2); align-items: flex-start; }
.footer-contact .icon { color: var(--brand-300); margin-top: 0.3rem; }
.social { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.footer-bottom {
	display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-2);
	margin-top: var(--s-7); padding-block: var(--s-5); border-top: 1px solid rgb(255 255 255 / 0.12);
}
.footer-bottom p { margin: 0; font-size: var(--fs-xs); letter-spacing: 0.02em; }

/* شريط الجوال */
.mobile-bar { display: none; }

/* حركة الظهور (تتفعل فقط عند وجود JS وعدم تفضيل تقليل الحركة) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
	.js .reveal { opacity: 1; transform: none; }
}

/* ---------- 6) الاستجابة ---------- */
@media (max-width: 1080px) {
	.grid-4 { grid-template-columns: repeat(2, 1fr); }
	.footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 960px) {
	.hero-inner, .split, .service-hero, .contact-grid { grid-template-columns: 1fr; }
	.split-reverse .split-copy { order: 0; }
	.grid-3 { grid-template-columns: repeat(2, 1fr); }
	.grid-2 { grid-template-columns: 1fr; }
	.stats-grid { grid-template-columns: repeat(3, 1fr); row-gap: var(--s-5); }
	.nav-toggle { display: grid; }
	.main-nav {
		position: fixed; inset-block-start: var(--header-h); inset-inline: 0;
		flex-direction: column; align-items: stretch; gap: var(--s-4);
		background: #fff; padding: var(--s-4) var(--gutter) var(--s-6);
		border-bottom: 1px solid var(--line); box-shadow: var(--shadow-md);
		max-height: calc(100dvh - var(--header-h)); overflow-y: auto;
		transform: translateY(-8px); opacity: 0; visibility: hidden;
		transition: opacity .2s, transform .2s var(--ease), visibility .2s;
	}
	.main-nav.is-open { transform: none; opacity: 1; visibility: visible; }
	.main-nav ul { flex-direction: column; }
	.main-nav li a { padding: 0.8rem 1rem; font-size: var(--fs-lg); border-radius: var(--r-md); }
	.nav-cta { width: 100%; }
}
@media (max-width: 640px) {
	.section { padding-block: var(--s-7); }
	.hero { padding-block: var(--s-6) var(--s-7); }
	.grid-3, .grid-4 { grid-template-columns: 1fr; }
	.stats-grid { grid-template-columns: repeat(2, 1fr); }
	.stats-grid li:last-child { grid-column: 1 / -1; }
	.form { padding: var(--s-5); }
	.form-grid { grid-template-columns: 1fr; }
	.footer-grid { grid-template-columns: 1fr; }
	.brand-sub { display: none; }
	.hero-actions .btn, .cta-actions .btn { flex: 1 1 100%; }
	.cta-actions { width: 100%; }
	/* مساحة لشريط الإجراءات السفلي */
	body { padding-block-end: 68px; }
	.mobile-bar {
		display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 1px;
		position: fixed; inset-inline: 0; inset-block-end: 0; z-index: 90;
		background: var(--line); border-top: 1px solid var(--line);
		padding-bottom: env(safe-area-inset-bottom);
	}
	.mobile-bar a {
		display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
		min-height: 64px; background: #fff; color: var(--brand-900);
		font-size: var(--fs-xs); font-weight: 700; text-decoration: none;
	}
	.mobile-bar a.is-primary { background: var(--brand-900); color: #fff; }
}
