/* الألوان والمتغيرات الأساسية */
:root {
  --navy: #062846;
  --navy2: #0b345b;
  --teal: #11b9b2;
  --teal-hover: #0d8f96;
  --gold: #f3ad2f;
  --green: #20c466;
  --ink: #17314d;
  --muted: #6b7b8d;
  --line: #e7eef5;
  --bg: #f6f9fc;
  --white: #fff;
  --shadow: 0 20px 60px rgba(5, 32, 60, 0.12);
  --shadow-hover: 0 30px 70px rgba(5, 32, 60, 0.18);
  --radius: 22px;
  --transition: 0.3s ease-in-out;
}

/* الإعدادات العامة */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Cairo', "Segoe UI", Tahoma, Arial, sans-serif; /* تم إضافة Cairo */
  color: var(--ink);
  background: var(--white);
  line-height: 1.65;
  overflow-x: hidden;
}

.container {
  width: min(1180px, 92%);
  margin: auto;
}

/* المساعدات (Utilities) */
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.full-width { width: 100%; text-align: center; }

/* الشريط العلوي (Topbar) */
.topbar {
  background: #041f38;
  color: #dcefff;
  font-size: 13px;
  padding: 10px 0;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.topbar-links {
  display: flex;
  gap: 12px;
  align-items: center;
}

.topbar .separator {
  color: rgba(255, 255, 255, 0.2);
}

.topbar a {
  color: #fff;
  text-decoration: none;
  transition: var(--transition);
}

.topbar a:hover {
  color: var(--teal);
}

/* القائمة الرئيسية (Navbar) */
.navbar {
  position: sticky;
  top: 0;
  z-index: 99;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.nav-inner {
  height: 85px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand img {
  width: 170px;
  max-height: 58px;
  object-fit: contain;
}

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

.nav-links a {
  text-decoration: none;
  color: var(--navy);
  font-weight: 700;
  font-size: 15px;
  position: relative;
  text-align: center;
  line-height: 1.3;
}

.nav-links a small {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.nav-links a:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -10px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--teal);
  transform: scaleX(0);
  transition: var(--transition);
}

.nav-links a:hover:after,
.nav-links a.active:after {
  transform: scaleX(1);
}

/* الأزرار (Buttons) */
.actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 24px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  white-space: nowrap;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--teal), #0a78b8);
  color: #fff;
  box-shadow: 0 10px 25px rgba(17, 185, 178, 0.22);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 36px rgba(17, 185, 178, 0.35);
}

.btn-gold {
  background: var(--gold);
  color: #082844;
}

.btn-gold:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(243, 173, 47, 0.3);
}

.btn-outline {
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.15);
}

.lang-toggle {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--navy);
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
}

.lang-toggle:hover {
  background: var(--bg);
}

.menu-toggle {
  display: none;
  border: 0;
  background: var(--navy);
  color: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 22px;
  cursor: pointer;
}

/* قسم البداية (Hero) */
.hero {
  position: relative;
  min-height: 720px;
  background: radial-gradient(circle at 80% 30%, rgba(17, 185, 178, 0.24), transparent 28%),
              linear-gradient(135deg, #05213b 0%, #08335a 52%, #074853 100%);
  color: #fff;
  overflow: hidden;
}

.hero:before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
                    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 70px 70px;
  mask-image: linear-gradient(to bottom, #000, transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent);
  opacity: 0.45;
}

.hero .container {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 48px;
  align-items: center;
  padding: 95px 0 80px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(17, 185, 178, 0.16);
  border: 1px solid rgba(17, 185, 178, 0.25);
  color: #dffefa;
  font-weight: 700;
  margin-bottom: 24px;
  font-size: 14px;
}

.hero h1 {
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.15;
  margin: 0 0 20px;
  font-weight: 800;
}

.gradient-text {
  background: linear-gradient(90deg, #19d4cb, #f6b933);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  font-size: 18px;
  color: #dce8f4;
  margin: 0 0 32px;
  max-width: 620px;
  line-height: 1.8;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 32px 0;
}

.hero-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(170px, 1fr));
  gap: 16px;
  margin-top: 36px;
  color: #cceff1;
  font-size: 15px;
  font-weight: 600;
}

.hero-points span {
  display: flex;
  gap: 10px;
  align-items: center;
}

.check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(17, 185, 178, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #43dfd2;
  font-weight: 900;
  font-style: normal;
  font-size: 14px;
}

/* تصميم واجهة النظام التوضيحية (Dashboard Mockup) */
.dash-wrap {
  position: relative;
  perspective: 1000px;
}

.dashboard {
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  transform: rotateY(5deg) rotateX(2deg); /* عدلت الزاوية للتناسب مع الاتجاه العربي */
  animation: float 6s ease-in-out infinite;
}

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: #f8fbff;
  color: #092e52;
  border-bottom: 1px solid var(--line);
}

.dots span {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #dfe8f1;
  margin: 0 4px;
}

.dash-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  min-height: 420px;
}

.sidebar {
  background: #092b4b;
  color: #cde6f2;
  padding: 24px 16px;
}

.sidebar h3 {
  color: #fff;
  margin: 0 0 24px;
  font-weight: 800;
}

.side-item {
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.side-item.active,
.side-item:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.dash-main {
  padding: 24px;
  background: #f7fbff;
}

.dash-title {
  margin: 0 0 20px 0;
  color: var(--navy);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 8px 18px rgba(10, 47, 82, 0.04);
}

.stat b {
  font-size: 26px;
  color: var(--teal);
  font-family: monospace;
}

.charts {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.chart-card,
.task-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  min-height: 180px;
}

.task-desc {
  color: var(--muted);
  margin: 10px 0 0;
  font-size: 14px;
}

.line-chart {
  height: 110px;
  background: linear-gradient(to top, rgba(17, 185, 178, 0.15), transparent),
              repeating-linear-gradient(to top, #eef4fa 0, #eef4fa 1px, transparent 1px, transparent 28px);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  margin-top: 16px;
}

.line-chart:before {
  content: "";
  position: absolute;
  inset: 18px 10px;
  background: linear-gradient(135deg, transparent 0 20%, #15beb7 20% 23%, transparent 23% 38%, #15beb7 38% 41%, transparent 41% 55%, #f3ad2f 55% 58%, transparent 58% 80%, #15beb7 80% 83%, transparent 83%);
}

.donut {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 16px auto;
  background: conic-gradient(var(--teal) 0 40%, var(--gold) 40% 72%, #29c96b 72% 88%, #ec5b5b 88%);
  position: relative;
}

.donut:after {
  content: "124";
  position: absolute;
  inset: 24px;
  background: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: var(--navy);
  font-size: 20px;
}

/* الأقسام العامة (Sections) */
.section {
  padding: 100px 0;
}

.section.alt {
  background: var(--bg);
}

.section-head {
  text-align: center;
  margin-bottom: 50px;
}

.section-head h2 {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.3;
  color: var(--navy);
  margin: 0 0 12px;
  font-weight: 800;
}

.section-head p {
  color: var(--muted);
  max-width: 720px;
  margin: auto;
  font-size: 17px;
}

/* البطاقات (Cards) */
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.dual-cards {
  grid-template-columns: 1fr 1fr;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: 0 12px 35px rgba(10, 47, 82, 0.05);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card:before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 4px;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transform: scaleX(0);
  transform-origin: right; /* للغة العربية */
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

.card:hover:before {
  transform: scaleX(1);
}

.icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(17, 185, 178, 0.11);
  font-size: 26px;
  color: var(--teal);
  margin-bottom: 20px;
}

.card:nth-child(even) .icon {
  background: rgba(243, 173, 47, 0.14);
  color: var(--gold);
}

.card h3 {
  margin: 0 0 10px;
  color: var(--navy);
  font-weight: 700;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

/* التخطيط المنقسم (Split Layout) */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
}

.split-title {
  color: var(--navy);
  font-size: clamp(30px, 4vw, 40px);
  margin-top: 0;
  line-height: 1.3;
}

.split-desc {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
  margin-bottom: 30px;
}

.mock-img {
  width: 100%;
  border-radius: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

/* سير العمل (Workflow) */
.workflow {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.step {
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px 16px;
  position: relative;
  transition: var(--transition);
}

.step:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.step:not(:last-child):after {
  content: "←"; /* اتجاه عربي */
  position: absolute;
  left: -14px;
  top: 40%;
  color: var(--teal);
  font-weight: 900;
  font-size: 20px;
}

.num {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  font-weight: 900;
  font-size: 18px;
}

/* معرض الصور (Gallery) */
.gallery {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
}

.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 24px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.gallery img:hover {
  transform: scale(1.02);
}

/* الأسعار (Pricing) */
.pricing {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.price-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 40px 30px;
  box-shadow: 0 12px 35px rgba(10, 47, 82, 0.05);
  position: relative;
  transition: var(--transition);
  text-align: center;
}

.price-card.featured {
  transform: scale(1.05);
  border: 2px solid var(--teal);
  box-shadow: var(--shadow);
  z-index: 2;
}

.price-card:hover {
  transform: translateY(-5px);
}

.price-card.featured:hover {
  transform: scale(1.05) translateY(-5px);
}

.price-card h3 {
  font-size: 24px;
  color: var(--navy);
  margin: 0 0 8px;
}

.price-subtitle {
  color: var(--teal);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 24px;
}

.price-card ul {
  list-style: none;
  padding: 0;
  margin: 24px 0 32px;
  text-align: start;
}

.price-card li {
  padding: 10px 0;
  color: #40556a;
  border-bottom: 1px solid var(--line);
}

.price-card li:last-child {
  border-bottom: none;
}

.price-card li:before {
  content: "✓";
  color: var(--green);
  font-weight: 900;
  margin-inline-end: 10px;
}

/* نموذج التواصل (Contact) */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.contact-title {
  font-size: 42px;
  color: var(--navy);
  margin-top: 0;
  line-height: 1.3;
}

.contact-desc {
  color: var(--muted);
  font-size: 18px;
}

.form {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 36px;
  box-shadow: var(--shadow);
}

.form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--navy);
  font-size: 15px;
}

.form input,
.form textarea,
.form select {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 20px;
  font-family: inherit;
  font-size: 15px;
  transition: var(--transition);
  background: #fdfdfd;
}

.form input:focus,
.form textarea:focus,
.form select:focus {
  outline: none;
  border-color: var(--teal);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(17, 185, 178, 0.1);
}

.form textarea {
  min-height: 150px;
  resize: vertical;
}

.cta {
  background: linear-gradient(135deg, #062846, #084c58);
  color: #fff;
  border-radius: 30px;
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
  position: relative;
}

.cta:before {
  content: "";
  position: absolute;
  width: 350px;
  height: 350px;
  border-radius: 50%;
  background: rgba(17, 185, 178, 0.14);
  left: -120px; /* عكس الاتجاه للعربي */
  top: -140px;
}

.cta-title {
  margin: 0 0 8px;
  font-size: 26px;
  position: relative;
  z-index: 1;
}

.cta-desc {
  margin: 0;
  color: #cfe8f1;
  position: relative;
  z-index: 1;
}

.cta .btn {
  position: relative;
  z-index: 1;
}

/* التذييل (Footer) */
.footer {
  background: #041f38;
  color: #cfe1ef;
  padding: 80px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
}

.footer-about p {
  line-height: 1.8;
  margin-top: 16px;
}

.footer a {
  color: #cfe1ef;
  text-decoration: none;
  display: block;
  margin: 12px 0;
  transition: var(--transition);
}

.footer a:hover {
  color: var(--teal);
  padding-inline-start: 5px;
}

.footer h4 {
  color: #fff;
  margin: 0 0 20px;
  font-size: 18px;
}

.footer-logo {
  width: 190px;
  filter: brightness(0) invert(1);
}

.copy {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 50px;
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 14px;
}

/* أدوات المحادثة (Chat & WhatsApp) */
.whatsapp {
  position: fixed;
  left: 24px; /* النقل لليسار مناسب للمواقع العربية */
  bottom: 24px;
  width: 65px;
  height: 65px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  display: grid;
  place-items: center;
  text-decoration: none;
  font-size: 32px;
  z-index: 120;
  box-shadow: 0 14px 30px rgba(37, 211, 102, 0.35);
  animation: pulse 2.2s infinite;
}

.whatsapp:before {
  content: "تحدث معنا";
  position: absolute;
  left: 80px;
  background: #092b4b;
  color: #fff;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 999px;
  white-space: nowrap;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.chatbox {
  position: fixed;
  left: 24px;
  bottom: 105px;
  width: 330px;
  background: #fff;
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 121;
  display: none;
  border: 1px solid var(--line);
}

.chatbox.open {
  display: block;
  animation: pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-head {
  background: #075e54;
  color: #fff;
  padding: 16px 20px;
  font-weight: 800;
  font-size: 16px;
}

.chat-body {
  padding: 24px;
}

.chat-body p {
  background: #f2f7f6;
  border-radius: 14px 14px 0 14px;
  padding: 16px;
  margin: 0 0 20px;
  color: var(--navy);
  font-size: 15px;
}

/* الحركات (Animations) */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@keyframes float {
  0%, 100% { transform: rotateY(5deg) rotateX(2deg) translateY(0); }
  50% { transform: rotateY(5deg) rotateX(2deg) translateY(-15px); }
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.45); }
  70% { box-shadow: 0 0 0 20px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

@keyframes pop {
  from { opacity: 0; transform: translateY(20px) scale(0.9); }
  to { opacity: 1; transform: none; }
}

/* الاستجابة للشاشات (Responsive) */
@media (max-width: 1050px) {
  .hero .container, .split, .contact-grid { grid-template-columns: 1fr; }
  .dash-wrap { order: -1; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .pricing { grid-template-columns: 1fr; }
  .price-card.featured { transform: none; }
  .price-card.featured:hover { transform: translateY(-5px); }
  .workflow { grid-template-columns: 1fr 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  
  .nav-links {
    position: absolute;
    top: 85px;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    padding: 24px 6%;
    box-shadow: var(--shadow);
    display: none;
  }
  .nav-links.open { display: flex; }
  .menu-toggle { display: block; }
  .desktop-only { display: none; }
  
  .hero { min-height: auto; }
  .hero .container { padding-top: 50px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .charts { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

@media (max-width: 640px) {
  .topbar-inner { flex-direction: column; align-items: center; text-align: center; }
  .brand img { width: 140px; }
  .nav-inner { height: 75px; }
  .nav-links { top: 75px; }
  
  .hero-buttons, .cta { align-items: stretch; flex-direction: column; text-align: center; }
  .hero-points, .cards, .dual-cards, .workflow, .footer-grid { grid-template-columns: 1fr; }
  
  .step:not(:last-child):after { display: none; }
  .section { padding: 70px 0; }
  
  .whatsapp:before { display: none; }
  .chatbox { left: 16px; right: 16px; width: auto; }
  .whatsapp { left: 16px; bottom: 16px; }
  
  .dashboard { transform: none; animation: none; }
  .hero h1 { font-size: 32px; }
}