:root {
  --primary: #392B58;
  --primary-hover: #99D5C9;
  --dark: #0f172a;
  --muted: #475569;
  --bg: #ffffff;
  --card: #ffffff;
  --border: #1e293b;
  --text: #392B58; /* تصحيح لون النص الافتراضي ليكون داكناً وواضحاً على الخلفيات الفاتحة */
  --text-bright: #ffffff;
  --text-sub: #392B58;
  --link: #2563eb;
  --success: #10b981;
  --danger: #ffcc02;
}

* {
  box-sizing: border-box;
}

html, body {
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

.container {
  width: min(1120px, 92%);
  margin: auto;
}

/* Header & Navigation */
.site-header {
  background: #99D5C9;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.nav-wrap {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
  padding: 10px 0;
}

.logo {
  font-weight: 800;
  font-size: 1.35rem;
  color: #392B58 !important;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  color: #392B58 !important;
  font-family: monospace;
  font-weight: bold;
}

.site-header nav {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Dropdown Menu */
.menu-dropdown {
  position: relative;
  display: inline-block;
}

.menu-btn {
  background: #392B58;
  color: #ffffff !important;
  border-color: #392B58;
  white-space: nowrap;
}

.dropdown-content {
  display: none;
  position: absolute;
  left: 0;
  top: 48px;
  background: #ffffff;
  min-width: 240px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  z-index: 999;
  padding: 8px 0;
}

.dropdown-content.show {
  display: block;
}

.dropdown-content a {
  color: #392B58;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  font-size: 0.95rem;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.2s, color 0.2s;
}

.dropdown-content a:last-child {
  border-bottom: none;
}

.dropdown-content a:hover {
  background: #99D5C9;
  color: #392B58;
}

/* Buttons System Standardized */
.btn {
  padding: 10px 20px;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
  transition: all 0.2s ease;
  min-height: 42px;
  line-height: 1.2;
  white-space: nowrap;
  border-radius: 8px;
}

.btn-primary { 
  background: #392B58; 
  color: #ffffff !important;
}
.btn-primary:hover { 
  background: #2a1f42; 
  color: #ffffff !important;
}

.btn-dark { 
  background: #0f172a; 
  color: #ffffff !important; 
}

.btn-danger { 
  background: #ef4444; 
  color: #ffffff !important; 
}

.btn-outline {
   background: #392B58; 
  color: #ffffff !important;;
}
.btn-outline:hover { 
  background: #2a1f42; 
  color: #ffffff !important;
}

/* Button Container Helpers */
.actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 15px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.actions > .btn, .hero-actions > .btn {
  flex: 1 1 auto;
  min-width: 140px;
}

/* Hero Section */
.hero {
  padding: 60px 0;
  background: #6C969D;
  color: #392B58;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1.25;
  margin: 15px 0 20px;
  color: #392B58;
}

.hero p {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: #392B58;
}

.hero-actions {
  margin-top: 25px;
}

.hero-card, .card, .plan, .table-wrap {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  color: #392B58;
}

.stat {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.1);
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  color: #392B58;
}

.hero-card { 
    padding: 30px; 
    border-radius: 16px;  
    background: #ffffff;
}
.tech-list { list-style: none; padding: 0; margin: 15px 0 0; }
.tech-list li { padding: 8px 0; color: #392B58; font-weight: 600; }

/* Sections */
.section { padding: 50px 0; }
.section-dark { background: #99d5c9; }
.section h2 { text-align: center; margin: 0 0 12px; font-size: clamp(1.5rem, 3vw, 2rem); color: #392B58; }
.section-intro { text-align: center; color: #392B58; margin: 0 auto 35px; max-width: 700px; }

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.feature {
  padding: 30px;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.feature h3 { color: #392B58; margin-top: 0; }
.feature p { color: #392B58; text-align: center; }

.feature-icon { font-size: 2.5rem; margin-bottom: 12px; }

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 400px));
  justify-content: center;
  gap: 20px;
}

.plan { padding: 28px; text-align: center; background: #ffffff; }
.plan h3 { color: #392B58; }
.plan.featured { border: 2px solid #392B58; position: relative; }
.price { font-size: 2rem; font-weight: 800; margin: 12px 0; color: #392B58; }
.price span { font-size: 1rem; color: #475569; font-weight: normal; }
.price-sub { color: #10b981; font-size: 0.95rem; }

.plan ul { padding: 0; list-style: none; text-align: right; margin: 20px 0; }
.plan ul li { padding: 8px 0; color: #392B58; border-bottom: 1px solid #e2e8f0; }

/* Forms & Inputs */
.form-wrap { max-width: 650px; margin: 30px auto; padding: 0 10px; }
.card { padding: 24px; }

label { display: block; margin: 0 0 7px; font-weight: 700; font-size: 0.95rem; color: #392B58; }

input, textarea, select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font: inherit;
  margin-bottom: 15px;
  background: #ffffff;
  color: #392B58;
}

input::placeholder, textarea::placeholder {
  color: #94a3b8;
}

textarea { min-height: 120px; resize: vertical; }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 15px;
}

/* Alerts */
.alert { padding: 12px 15px; border-radius: 10px; margin-bottom: 20px; word-break: break-word; font-weight: 600; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #f87171; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #34d399; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fbbf24; }

/* Responsive Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; min-width: 600px; }
.table th { color: #ffffff; background: #392B58; padding: 12px 10px; text-align: right; font-size: 0.9rem; }
.table td { padding: 12px 10px; border-bottom: 1px solid #e2e8f0; text-align: right; font-size: 0.9rem; color: #392B58; }

/* Footer */
.site-footer {
  background: #6c969d;
  border-top: 1px solid rgba(0,0,0,0.1);
  padding-top: 40px;
  color: #ffffff;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  padding-bottom: 30px;
}

.footer-about p { margin-top: 15px; font-size: 0.9rem; color: #ffffff; }
.footer-links h4, .footer-contact h4 { color: #392B58; margin-bottom: 14px; font-size: 1.1rem; }
.footer-links ul { list-style: none; padding: 0; margin: 0; }
.footer-links ul li { margin-bottom: 8px; }
.footer-links ul li a { color: #ffffff; text-decoration: none; transition: color 0.2s; font-size: 0.9rem; }
.footer-links ul li a:hover { color: #392B58; }

.footer-bottom {
  border-top: 1px solid rgba(0,0,0,0.1);
  padding: 15px 0;
  text-align: center;
  font-size: 0.85rem;
  color: #392B58;
  background: #99d5c9;
}

/* Badges & File Rows */
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-blue { background: #392B58; color: #ffffff; }
.badge-yellow { background: #fef3c7; color: #92400e; }

.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  margin: 6px 0;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #392B58;
  flex-wrap: wrap;
}

/* Global Links Color */
a { color: #392B58; }

/* Media Queries Optimization (Responsive) */
@media (max-width: 768px) {
  .nav-wrap {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .site-header nav {
    justify-content: flex-end;
    width: auto;
  }

  .dropdown-content {
    right: 0;
    left: auto;
    width: 260px;
  }

  /* توحيد حشو كروت الـ Hero على الهواتف لعدم انضغاط النص */
  .hero-card {
    padding: 20px !important;
  }
  
  .hero-card ul {
    padding-right: 20px !important;
  }

  .actions, .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .actions > .btn, .hero-actions > .btn {
    width: 100%;
  }

  /* توسيط عناصر الـ Footer على الهاتف بشكل متناسق */
  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-about, .footer-links, .footer-contact {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .footer-about .logo {
    justify-content: center;
  }
}