:root {
  --primary: #1a2b9b;
  --secondary: #12cfdd;
  --primary-dark: #141f7a;
  --secondary-light: #5dd9e3;
  --dark: #0d1449;
  --light: #f4fbfb;
  --gray: #64748b;
  --gradient-brand: linear-gradient(180deg, #12cfdd 0%, #1a2b9b 100%);
  --gradient-brand-135: linear-gradient(135deg, #12cfdd 0%, #1a2b9b 100%);
  --shadow-brand: 0 4px 20px rgba(26, 43, 155, 0.15);
  --shadow-brand-lg: 0 8px 32px rgba(26, 43, 155, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
  background: #fff;
  color: #1e293b;
  line-height: 1.8;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: auto;
}

/* ==========================================================================
   Language Switching Utilities & Logical Replacements
   ========================================================================== */
body.lang-en {
  direction: ltr;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

/* Hide English text by default when body is in Arabic */
body:not(.lang-en) .lang-en {
  display: none !important;
}

/* Hide Arabic text when body has the .lang-en class */
body.lang-en .lang-ar {
  display: none !important;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
header {
  background: white;
  position: sticky;
  top: 0;
  z-index: 999;
  box-shadow: 0 2px 16px rgba(26, 43, 155, 0.08);
  border-bottom: 1px solid rgba(18, 207, 221, 0.15);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  gap: 20px;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.logo-link {
  display: block;
  line-height: 0;
  text-decoration: none;
}

.logo-img {
  height: 80px;
  width: auto;
  max-width: min(380px, 75vw);
  object-fit: contain;
  display: block;
}

.logo h2 {
  color: var(--primary);
  font-size: 1.35rem;
  line-height: 1.2;
}

.logo-subtitle {
  display: block;
  color: var(--gray);
  font-size: 0.75rem;
  line-height: 1.3;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--dark);
  border-radius: 2px;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

.nav-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-menu ul {
  display: flex;
  list-style: none;
  gap: 25px;
}

.nav-menu a {
  text-decoration: none;
  color: var(--dark);
  font-weight: 600;
  transition: color 0.3s ease;
}

.nav-menu a:hover {
  color: var(--secondary);
}

.nav-menu a:active,
.nav-menu a:focus-visible {
  color: var(--primary);
}

.nav-actions {
  display: flex;
  align-items: center;
}

/* Language Switch — segmented pill */
.lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: 999px;
  background: var(--light);
  border: 1px solid rgba(18, 207, 221, 0.3);
  gap: 2px;
  box-shadow: inset 0 1px 2px rgba(26, 43, 155, 0.06);
}

.lang-switch-option {
  padding: 7px 14px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--gray);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
  line-height: 1.2;
  min-width: 44px;
  text-align: center;
}

.lang-switch-option:hover:not(.is-active) {
  color: var(--primary);
  background: rgba(26, 43, 155, 0.07);
}

.lang-switch-option.is-active {
  background: var(--gradient-brand-135);
  color: white;
  box-shadow: var(--shadow-brand);
}

.lang-switch-option:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  background: var(--gradient-brand-135);
  color: white;
  text-align: center;
  padding: 120px 20px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 20% 80%,
      rgba(255, 255, 255, 0.12) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(255, 255, 255, 0.08) 0%,
      transparent 40%
    );
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 20px;
}

.hero h2 {
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 25px;
}

.hero p {
  max-width: 900px;
  margin: auto;
  margin-bottom: 35px;
}

/* ==========================================================================
   Buttons & General Layout Components
   ========================================================================== */
.buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.btn {
  background: white;
  color: var(--primary);
  padding: 14px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    color 0.2s ease;
  box-shadow: 0 4px 14px rgba(26, 43, 155, 0.2);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 43, 155, 0.3);
  color: var(--primary-dark);
}

.btn-outline {
  border: 2px solid white;
  color: white;
  background: transparent;
  box-shadow: none;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  box-shadow: none;
}

section {
  padding: 90px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 50px;
}

.section-title h2 {
  color: var(--primary);
  margin-bottom: 10px;
}

.section-title h2::after {
  content: "";
  display: block;
  width: 60px;
  height: 4px;
  margin: 12px auto 0;
  border-radius: 2px;
  background: var(--gradient-brand);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
}

.card {
  background: white;
  border-radius: 15px;
  padding: 30px;
  box-shadow: var(--shadow-brand);
  border: 1px solid rgba(18, 207, 221, 0.12);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-brand-lg);
}

.card h3 {
  color: var(--primary);
  margin-bottom: 15px;
}

/* ==========================================================================
   Specific Sections
   ========================================================================== */
.problem {
  background: var(--light);
}

.solution {
  background: linear-gradient(180deg, #e8f9fc 0%, #f0f7ff 100%);
}

.features {
  background: white;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 25px;
  text-align: center;
}

.step {
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: var(--shadow-brand);
  border-inline-start: 4px solid var(--secondary);
}

/* ==========================================================================
   Pricing Table & Testimonials
   ========================================================================== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
}

.price-card {
  border-radius: 15px;
  padding: 35px;
  box-shadow: var(--shadow-brand);
  text-align: center;
  background: white;
  border: 1px solid rgba(18, 207, 221, 0.15);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.price-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-brand-lg);
}

.price-card h3 {
  color: var(--primary);
}

.price {
  font-size: 2rem;
  margin: 20px 0;
  font-weight: bold;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.price-card ul {
  list-style: none;
  text-align: start; /* Automatically adapts to RTL/LTR text flow */
}

.price-card li {
  margin: 10px 0;
}

.testimonial {
  background: var(--light);
  padding: 20px;
  border-radius: 8px;
  border-inline-start: 5px solid var(--secondary);
  box-shadow: var(--shadow-brand);
}

/* ==========================================================================
   FAQ & Footer
   ========================================================================== */
.faq-item {
  background: white;
  margin-bottom: 15px;
  padding: 20px;
  border-radius: 10px;
  box-shadow: var(--shadow-brand);
  border: 1px solid rgba(18, 207, 221, 0.1);
}

.faq-item h4 {
  color: var(--primary);
  margin-bottom: 10px;
}

.cta {
  background: var(--gradient-brand-135);
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 70% 30%,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 50%
  );
  pointer-events: none;
}

.cta .container {
  position: relative;
  z-index: 1;
}

footer {
  background: var(--primary-dark);
  color: white;
  padding: 50px 0;
  border-top: 3px solid var(--secondary);
}

.footer-logo {
  height: 120px;
  width: auto;
  max-width: 520px;
  object-fit: contain;
  margin-bottom: 20px;
  display: inline-block;
  background: white;
  padding: 18px 32px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

footer ul {
  list-style: none;
}

footer a {
  color: var(--secondary-light);
  text-decoration: none;
  transition: color 0.2s ease;
}

footer a:hover {
  color: white;
}

.en {
  color: #64748b;
  font-size: 0.95rem;
}

/* ==========================================================================
   Responsive Media Queries (Mobile & Tablet Optimization)
   ========================================================================== */
@media (max-width: 768px) {
  .navbar {
    display: grid;
    grid-template-columns: 1fr auto auto;
    grid-template-areas:
      "logo toggle lang"
      "menu menu menu";
    align-items: center;
    gap: 12px 16px;
    padding: 12px 0;
  }

  .logo {
    grid-area: logo;
    min-width: 0;
  }

  .logo-subtitle {
    display: none;
  }

  .logo-img {
    height: 58px;
    max-width: min(280px, 68vw);
  }

  .nav-toggle {
    display: flex;
    grid-area: toggle;
  }

  .nav-actions {
    grid-area: lang;
  }

  .nav-menu {
    grid-area: menu;
    display: none;
    width: 100%;
    padding-top: 4px;
    border-top: 1px solid rgba(18, 207, 221, 0.2);
  }

  .nav-menu.is-open {
    display: block;
  }

  .nav-menu ul {
    flex-direction: column;
    gap: 0;
    padding: 8px 0 4px;
  }

  .nav-menu li {
    border-bottom: 1px solid rgba(18, 207, 221, 0.1);
  }

  .nav-menu li:last-child {
    border-bottom: none;
  }

  .nav-menu a {
    display: block;
    padding: 14px 4px;
    font-size: 1rem;
  }

  .lang-switch-option {
    padding: 6px 11px;
    font-size: 0.75rem;
    min-width: 40px;
  }

  .hero {
    padding: 80px 20px;
  }

  .hero h1 {
    font-size: 1.75rem;
    line-height: 1.4;
  }

  .hero h2 {
    font-size: 1.25rem;
  }

  section {
    padding: 60px 0;
  }

  .section-title {
    margin-bottom: 30px;
  }

  .buttons {
    flex-direction: column;
    width: 100%;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  .footer-logo {
    height: 88px;
    max-width: min(420px, 92vw);
    padding: 14px 24px;
  }
}
