:root {
  --blue: #00486a;
  --blue-2: #006f8f;
  --light-blue: #eaf7fc;
  --orange: #fb5637;
  --orange-2: #ff714f;
  --text: #09304d;
  --muted: #38556c;
  --white: #ffffff;
  --card: rgba(255, 255, 255, 0.92);
  --shadow: 0 18px 45px rgba(0, 72, 106, 0.14);
  --border: rgba(0, 111, 143, 0.18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", "Cairo", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 14% 25%, rgba(251, 86, 55, 0.08), transparent 18%),
    radial-gradient(circle at 84% 20%, rgba(0, 111, 143, 0.12), transparent 22%),
    linear-gradient(180deg, #ffffff 0%, #f2fbff 48%, #e8f7fd 100%);
  overflow-x: hidden;
}

body[dir="rtl"] {
  font-family: "Cairo", "Inter", sans-serif;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.container {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  min-height: 90px;
  display: grid;
  grid-template-columns: 270px 1fr auto;
  gap: 28px;
  align-items: center;
}

body[dir="rtl"] .header-inner {
  grid-template-columns: 270px 1fr auto;
}

.brand img {
  width: 255px;
  height: 72px;
  object-fit: contain;
  object-position: left center;
}

body[dir="rtl"] .brand img {
  object-position: right center;
}

.nav {
  display: flex;
  justify-content: center;
  gap: 46px;
  font-size: 18px;
  font-weight: 700;
}

.nav a {
  color: #0f3855;
  transition: color 0.2s ease;
}

.nav a:hover { color: var(--orange); }

.language-switch {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #083b59;
  font-size: 18px;
  font-weight: 800;
}

.lang-btn {
  border: 0;
  background: transparent;
  color: #0f3855;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 999px;
}

.lang-btn.active {
  color: var(--orange);
  background: rgba(251, 86, 55, 0.09);
}

.lang-btn.arabic {
  font-family: "Cairo", sans-serif;
}

.hero {
  position: relative;
  padding: 34px 0 22px;
  min-height: 560px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(150deg, rgba(255,255,255,0) 0 52%, rgba(204, 237, 247, 0.55) 52% 100%),
    radial-gradient(circle at 94% 50%, rgba(0,111,143,0.1), transparent 24%);
  clip-path: ellipse(120% 100% at 50% 0%);
  pointer-events: none;
}

body[dir="rtl"] .hero::before {
  background:
    linear-gradient(210deg, rgba(255,255,255,0) 0 52%, rgba(204, 237, 247, 0.55) 52% 100%),
    radial-gradient(circle at 6% 50%, rgba(0,111,143,0.1), transparent 24%);
}

.decor {
  position: absolute;
  color: rgba(0, 111, 143, 0.11);
  font-weight: 900;
  user-select: none;
}

.decor-1 { left: 7%; top: 22%; font-size: 76px; }
.decor-2 { right: 7%; top: 42%; font-size: 82px; }
.decor-3 { right: 16%; top: 24%; font-size: 54px; }

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 60px;
  align-items: center;
}

body[dir="rtl"] .hero-grid {
  direction: rtl;
}

.hero-copy {
  padding: 38px 0 0 120px;
}

body[dir="rtl"] .hero-copy {
  padding: 38px 120px 0 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 30px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
  color: white;
  font-size: 28px;
  font-weight: 900;
  box-shadow: 0 18px 28px rgba(251, 86, 55, 0.18);
}

.hero h1 {
  margin: 24px 0 10px;
  font-size: clamp(58px, 7vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

body[dir="rtl"] .hero h1 {
  letter-spacing: 0;
}

.hero h1 span {
  color: var(--blue);
  text-shadow: 0 4px 0 rgba(0, 72, 106, 0.07);
}

.hero h1 strong {
  color: var(--orange);
  font-weight: 900;
  text-shadow: 0 4px 0 rgba(251, 86, 55, 0.08);
}

.intro {
  max-width: 650px;
  margin: 22px 0;
  color: #183a56;
  font-size: 23px;
  line-height: 1.45;
  font-weight: 600;
}

.hero h2 {
  margin: 28px 0 10px;
  color: var(--blue);
  font-size: clamp(30px, 3vw, 45px);
  line-height: 1.15;
  font-weight: 900;
}

.hero h3 {
  margin: 0;
  color: var(--orange);
  font-family: "Cairo", sans-serif;
  font-size: clamp(42px, 4vw, 66px);
  line-height: 1.15;
  font-weight: 900;
}

.hero-art {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-art img {
  width: min(620px, 100%);
  filter: drop-shadow(0 24px 38px rgba(0, 72, 106, 0.18));
}

.cards-section {
  padding: 0 0 18px;
}

.cards-grid {
  display: grid;
  grid-template-columns: 1.02fr 1.16fr 1.02fr;
  gap: 24px;
  align-items: stretch;
}

.info-card,
.purpose-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.info-card {
  padding: 30px 34px;
  position: relative;
  overflow: hidden;
}

.info-card::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -80px;
  width: 190px;
  height: 190px;
  background: radial-gradient(circle, rgba(0, 111, 143, 0.08), transparent 70%);
}

body[dir="rtl"] .info-card::after {
  right: auto;
  left: -60px;
}

.card-icon {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  color: white;
  font-size: 32px;
  box-shadow: 0 14px 24px rgba(0, 72, 106, 0.2);
  margin-bottom: 18px;
}

.main-about-card .card-icon {
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
}

.info-card h2 {
  margin: 0 0 22px;
  font-size: 25px;
  color: var(--blue);
  line-height: 1.2;
}

.info-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.info-card li {
  position: relative;
  padding-left: 28px;
  margin: 10px 0;
  color: #163a55;
  font-size: 17px;
  font-weight: 600;
}

.info-card li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 3px;
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-2);
  color: white;
  font-size: 12px;
  font-weight: 900;
}

body[dir="rtl"] .info-card li {
  padding-left: 0;
  padding-right: 28px;
}

body[dir="rtl"] .info-card li::before {
  left: auto;
  right: 0;
}

.main-about-card p {
  margin: 0 0 14px;
  color: #0e334d;
  font-size: 18px;
  line-height: 1.65;
  font-weight: 600;
}

.main-about-card .highlight {
  color: var(--orange);
  font-weight: 900;
  font-size: 20px;
}

.purpose {
  padding: 0 0 18px;
}

.purpose-card {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 24px;
  align-items: center;
  padding: 22px 36px;
}

body[dir="rtl"] .purpose-card {
  grid-template-columns: 1fr 100px;
}

.purpose-icon {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
  font-size: 36px;
}

.purpose h2 {
  margin: 0 0 4px;
  color: var(--orange);
  font-size: 28px;
}

.purpose p {
  margin: 0;
  color: #173a55;
  font-size: 18px;
  font-weight: 600;
}

.contact-bar {
  background: linear-gradient(90deg, #004866, #006b88);
  color: white;
  padding: 20px 0;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
}

.contact-item {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 0 20px;
  border-right: 1px solid rgba(255,255,255,0.35);
  font-size: 20px;
  font-weight: 800;
}

body[dir="rtl"] .contact-item {
  border-right: 0;
  border-left: 1px solid rgba(255,255,255,0.35);
}

.contact-item:last-child {
  border-right: 0;
}

body[dir="rtl"] .contact-item:last-child {
  border-left: 0;
}

.contact-item span {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.16);
  display: grid;
  place-items: center;
  font-size: 24px;
}

.contact-item.whatsapp span {
  background: #30c768;
}

.closing {
  background: #f9fdff;
  color: var(--blue);
  text-align: center;
  padding: 10px 0 14px;
  font-size: 22px;
  font-weight: 900;
}

.closing p {
  margin: 0;
}

@media (max-width: 1180px) {
  .header-inner {
    grid-template-columns: 230px 1fr;
  }

  .language-switch {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .hero-copy,
  body[dir="rtl"] .hero-copy {
    padding-left: 20px;
    padding-right: 20px;
  }

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

  .contact-item,
  body[dir="rtl"] .contact-item {
    border-right: 0;
    border-left: 0;
    border-bottom: 1px solid rgba(255,255,255,0.25);
  }

  .contact-item:last-child,
  body[dir="rtl"] .contact-item:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 840px) {
  .container {
    width: min(100% - 28px, 1440px);
  }

  .header-inner {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 8px;
    padding: 10px 0;
  }

  .brand img {
    width: 220px;
    object-position: center;
  }

  .nav {
    gap: 18px;
    flex-wrap: wrap;
    font-size: 15px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .hero-copy,
  body[dir="rtl"] .hero-copy {
    padding: 10px 0 0;
    text-align: center;
  }

  .intro {
    margin-left: auto;
    margin-right: auto;
    font-size: 19px;
  }

  .badge {
    font-size: 20px;
  }

  .hero-art img {
    width: min(430px, 92%);
  }

  .cards-grid {
    gap: 18px;
  }

  .info-card {
    padding: 24px 22px;
  }

  .purpose-card,
  body[dir="rtl"] .purpose-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .purpose-icon {
    margin: 0 auto;
  }

  .contact-item {
    font-size: 16px;
    flex-wrap: wrap;
  }
}


/* Keep emails and phone numbers readable in both English and Arabic layouts */
.ltr-text,
.phone-number {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
  display: inline-block;
}

.contact-item strong {
  direction: ltr;
  unicode-bidi: isolate;
}

body[dir="rtl"] .contact-item {
  direction: ltr;
}

body[dir="rtl"] .contact-item strong {
  direction: ltr;
  unicode-bidi: isolate;
}

body[dir="rtl"] .contact-item.whatsapp strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

body[dir="rtl"] .contact-item.whatsapp [data-i18n="whatsapp_label"] {
  direction: rtl;
  unicode-bidi: isolate;
  font-family: "Cairo", sans-serif;
}

/* ===== Final legal/navigation fixes ===== */
body[dir="rtl"] .purpose-card {
  grid-template-columns: 1fr 96px;
}
body[dir="rtl"] .purpose-card .purpose-icon {
  grid-column: 2;
  grid-row: 1;
}
body[dir="rtl"] .purpose-card > div:not(.purpose-icon) {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}
body[dir="rtl"] .purpose-card p,
body[dir="rtl"] .purpose-card h3 {
  white-space: normal;
  word-break: normal;
  overflow-wrap: normal;
  text-align: right;
}

/* Dedicated legal pages */
.legal-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 20%, rgba(255, 95, 72, .08), transparent 25%),
    radial-gradient(circle at 88% 18%, rgba(31, 111, 178, .11), transparent 30%),
    linear-gradient(180deg, #f8fcff 0%, #eaf9fb 100%);
  color: var(--navy);
}
.legal-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(19,60,89,.12);
}
.legal-nav {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.legal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--navy);
  font-weight: 900;
}
.legal-brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}
.legal-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  font-weight: 800;
}
.legal-links a, .legal-lang button {
  color: var(--navy);
  text-decoration: none;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.legal-links a:hover, .legal-lang button:hover { color: var(--coral); }
.legal-lang {
  display: flex;
  align-items: center;
  gap: 10px;
}
.legal-lang button.active {
  color: var(--coral);
  background: rgba(255,95,72,.10);
  padding: 8px 12px;
  border-radius: 999px;
}
.legal-hero {
  max-width: 1050px;
  margin: 0 auto;
  padding: 58px 22px 24px;
  text-align: center;
}
.legal-badge {
  display: inline-flex;
  padding: 12px 24px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--coral), #ff7c59);
  color: white;
  font-weight: 900;
  box-shadow: 0 18px 36px rgba(255,95,72,.22);
}
.legal-title {
  margin: 24px 0 12px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -1px;
}
.legal-subtitle {
  max-width: 780px;
  margin: 0 auto 10px;
  color: rgba(19,60,89,.78);
  font-size: 18px;
  line-height: 1.7;
}
.legal-updated {
  font-weight: 900;
  color: var(--navy);
}
.legal-main {
  max-width: 1050px;
  margin: 0 auto;
  padding: 20px 22px 70px;
}
.legal-notice {
  border-radius: 28px;
  padding: 26px;
  background: linear-gradient(135deg, rgba(31,111,178,.13), rgba(30,184,166,.14));
  border: 1px solid rgba(31,111,178,.12);
  box-shadow: var(--shadow);
  font-size: 18px;
  line-height: 1.8;
  font-weight: 800;
  text-align: center;
  margin-bottom: 22px;
}
.legal-card {
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(19,60,89,.08);
  border-radius: 24px;
  padding: 26px 30px;
  margin: 18px 0;
  box-shadow: 0 16px 40px rgba(19,60,89,.08);
}
.legal-card h2 {
  font-size: 23px;
  margin-bottom: 10px;
  font-weight: 900;
  color: var(--navy);
}
.legal-card p, .legal-card li {
  font-size: 16px;
  line-height: 1.9;
  color: rgba(19,60,89,.88);
}
.legal-card ul { padding-left: 22px; margin-top: 8px; }
body[dir="rtl"] .legal-card ul { padding-left: 0; padding-right: 22px; }
.legal-footer-note {
  margin-top: 24px;
  text-align: center;
  color: rgba(19,60,89,.68);
  line-height: 1.8;
}
body[dir="rtl"] .legal-body,
body[dir="rtl"] .legal-card,
body[dir="rtl"] .legal-notice {
  text-align: right;
}
body[dir="rtl"] .legal-hero,
body[dir="rtl"] .legal-footer-note { text-align: center; }

@media (max-width: 760px) {
  .legal-nav { align-items: flex-start; flex-direction: column; }
  .legal-links { gap: 12px; }
  .legal-card { padding: 22px 18px; }
  .legal-notice { padding: 22px 18px; }
}


/* Final MedSharePilot fixes: purpose card and legal nav links */
.purpose-card{width:100%;display:flex;align-items:center;gap:20px;justify-content:flex-start;text-align:start;}
.purpose-card .purpose-icon{flex:0 0 auto;}
.purpose-card .purpose-text{flex:1 1 auto;min-width:0;max-width:none;}
.purpose-card .purpose-text p{max-width:none;width:100%;line-height:1.8;}
html[dir="rtl"] .purpose-card, body[dir="rtl"] .purpose-card{direction:rtl;text-align:right;}
html[dir="ltr"] .purpose-card, body[dir="ltr"] .purpose-card{direction:ltr;text-align:left;}
@media(max-width:700px){.purpose-card{align-items:flex-start}.purpose-card .purpose-text p{font-size:15px}}
