/* ============================================ */
/* FAX EXPRESS MAROC — Global Stylesheet v3     */
/* New identity: Deep Indigo × Emerald          */
/* ============================================ */

:root {
  --primary: #312e81;
  --primary-deep: #1e1b4b;
  --primary-light: #4f46e5;
  --primary-glow: #818cf8;
  --accent: #22c55e;
  --accent-dark: #0d9488;
  --dark: #12122b;
  --dark-2: #1c1c3d;
  --gray: #5b6478;
  --gray-light: #8b93a8;
  --bg: #f6f7fd;
  --bg-alt: #eef0fb;
  --white: #ffffff;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --shadow-sm: 0 2px 10px rgba(18,18,43,0.05);
  --shadow-md: 0 8px 28px rgba(18,18,43,0.09);
  --shadow-lg: 0 24px 56px rgba(49,46,129,0.16);
  --shadow-glow: 0 8px 28px rgba(34,197,94,0.35);
  --transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-arabic: 'Cairo', sans-serif;
}

/* ============ RESET & BASE ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }

body {
  font-family: var(--font-main);
  color: var(--dark);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; transition: var(--transition); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

::selection { background: var(--primary-light); color: white; }

/* ============ NAVBAR ============ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.86);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid rgba(18,18,43,0.07);
  transition: var(--transition);
  padding: 0 20px;
}

.navbar.scrolled {
  box-shadow: 0 6px 24px rgba(18,18,43,0.09);
  background: rgba(255,255,255,0.94);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.35rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 60%, var(--primary-glow) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
  white-space: nowrap;
}

.logo span { font-size: 1.6rem; -webkit-text-fill-color: initial; }

.ssl-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #15803d;
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.25);
  padding: 6px 12px;
  border-radius: 50px;
  margin-right: 20px;
  white-space: nowrap;
}

.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; }

.nav-links li a {
  display: block;
  padding: 10px 13px;
  white-space: nowrap;
  color: var(--dark);
  font-weight: 500;
  font-size: 0.92rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-links li a:hover { color: var(--primary-light); background: rgba(79,70,229,0.07); }

.nav-links li a.nav-cta {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #ffffff !important;
  font-weight: 700;
  padding: 11px 22px;
  border-radius: 50px;
  margin-left: 10px;
  box-shadow: 0 4px 16px rgba(34,197,94,0.3);
}

.nav-links li a.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(34,197,94,0.42);
  background: linear-gradient(135deg, #16a34a 0%, var(--accent-dark) 100%);
  color: #ffffff !important;
}

/* Hamburger */
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 8px; z-index: 1002; background: none; border: none; }
.hamburger span { display: block; width: 25px; height: 2.5px; background: var(--dark); border-radius: 3px; transition: var(--transition); }
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.nav-overlay {
  position: fixed; inset: 0;
  background: rgba(18,18,43,0.45);
  backdrop-filter: blur(3px);
  z-index: 998;
  opacity: 0; visibility: hidden;
  transition: var(--transition);
}
.nav-overlay.active { opacity: 1; visibility: visible; }

@media (max-width: 768px) {
  .ssl-badge { display: none; }
  .hamburger { display: flex; }
  .nav-links {
    position: fixed;
    top: 0; right: -100%;
    width: min(82vw, 330px);
    height: 100vh;
    background: var(--white);
    flex-direction: column;
    align-items: stretch;
    padding: 90px 22px 24px;
    gap: 6px;
    transition: right 0.35s cubic-bezier(0.4,0,0.2,1);
    z-index: 999;
    box-shadow: -8px 0 32px rgba(18,18,43,0.14);
    overflow-y: auto;
  }
  .nav-links.active { right: 0; }
  .nav-links li { width: 100%; }
  .nav-links li a { padding: 14px 16px; width: 100%; border-radius: var(--radius-md); }
  .nav-links li a.nav-cta { margin-left: 0; margin-top: 10px; text-align: center; }
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 34px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1.02rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  min-height: 54px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(34,197,94,0.45); color: #ffffff; }

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary-light);
}
.btn-secondary:hover { background: var(--primary-light); color: #ffffff; border-color: var(--primary-light); }

/* Glass variant for dark heroes */
.hero .btn-secondary {
  background: rgba(255,255,255,0.09);
  color: #ffffff;
  border: 1.5px solid rgba(255,255,255,0.35);
  backdrop-filter: blur(8px);
}
.hero .btn-secondary:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.55);
  transform: translateY(-3px);
  color: #ffffff;
}

/* ============ HERO (generic base) ============ */
.hero {
  position: relative;
  color: #ffffff;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(900px 480px at 12% -10%, rgba(129,140,248,0.38) 0%, transparent 60%),
    radial-gradient(760px 420px at 88% 8%, rgba(34,197,94,0.20) 0%, transparent 55%),
    radial-gradient(720px 520px at 50% 115%, rgba(79,70,229,0.4) 0%, transparent 60%),
    linear-gradient(160deg, #1e1b4b 0%, #312e81 48%, #4338ca 100%);
}

/* ============ SECTION HEADERS ============ */
.section { padding: 88px 20px; max-width: 1200px; margin: auto; }
.section-header { text-align: center; max-width: 720px; margin: 0 auto 60px; }

.section-tag {
  display: inline-block;
  background: linear-gradient(135deg, rgba(79,70,229,0.1), rgba(34,197,94,0.1));
  border: 1px solid rgba(79,70,229,0.16);
  color: var(--primary-light);
  padding: 7px 20px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 18px;
}

.section-title {
  font-size: clamp(1.85rem, 4vw, 2.55rem);
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 16px;
  line-height: 1.18;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.section-desc { color: var(--gray); font-size: 1.08rem; line-height: 1.7; max-width: 620px; margin: 0 auto; text-wrap: pretty; }
.section-desc a { color: var(--primary-light); font-weight: 600; }

/* ============ CTA BANNER ============ */
.cta-banner {
  position: relative;
  background:
    radial-gradient(700px 340px at 15% 0%, rgba(129,140,248,0.35) 0%, transparent 60%),
    radial-gradient(600px 300px at 90% 100%, rgba(34,197,94,0.22) 0%, transparent 55%),
    linear-gradient(135deg, #1e1b4b 0%, #312e81 55%, #4338ca 100%);
  color: #ffffff;
  text-align: center;
  padding: 88px 20px;
  overflow: hidden;
}
.cta-banner h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; margin-bottom: 16px; position: relative; letter-spacing: -0.02em; text-wrap: balance; }
.cta-banner p { font-size: 1.1rem; color: rgba(255,255,255,0.92); max-width: 620px; margin: 0 auto 34px; position: relative; line-height: 1.7; }
.cta-banner .btn { position: relative; }

/* ============ SCROLL ANIMATIONS ============ */
.animate-on-scroll { opacity: 0; transform: translateY(36px); transition: opacity 0.7s cubic-bezier(0.16,1,0.3,1), transform 0.7s cubic-bezier(0.16,1,0.3,1); }
.animate-on-scroll.visible { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: 0.08s; }
.delay-2 { transition-delay: 0.18s; }
.delay-3 { transition-delay: 0.28s; }

@keyframes fadeInUp { from { opacity: 0; transform: translateY(36px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.4); } 50% { box-shadow: 0 0 0 16px rgba(34,197,94,0); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* ============ WHATSAPP FLOAT & SCROLL TOP ============ */
.whatsapp-float {
  position: fixed;
  bottom: 26px; left: 26px;
  width: 58px; height: 58px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #ffffff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem;
  box-shadow: 0 6px 22px rgba(34,197,94,0.45);
  z-index: 999;
  transition: var(--transition);
  animation: pulse 2.4s infinite;
  text-decoration: none;
}
.whatsapp-float:hover { transform: scale(1.12) rotate(6deg); box-shadow: 0 10px 32px rgba(34,197,94,0.55); }

.scroll-top {
  position: fixed;
  bottom: 26px; right: 26px;
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: #ffffff;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 998;
  opacity: 0; visibility: hidden;
  transition: var(--transition);
  box-shadow: 0 6px 18px rgba(49,46,129,0.35);
  display: flex; align-items: center; justify-content: center;
}
.scroll-top.visible { opacity: 1; visibility: visible; }
.scroll-top:hover { transform: translateY(-4px); }

@media (max-width: 768px) {
  .whatsapp-float { width: 52px; height: 52px; font-size: 1.45rem; bottom: 82px; left: 18px; }
  .scroll-top { width: 44px; height: 44px; font-size: 1.05rem; bottom: 82px; right: 18px; }
}

/* ============ STICKY CTA (MOBILE) ============ */
.sticky-cta {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #ffffff;
  padding: 14px 20px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  z-index: 1001;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 -6px 24px rgba(18,18,43,0.25);
}
.sticky-cta a { color: #ffffff; text-decoration: none; font-weight: 700; }
@media (max-width: 768px) { .sticky-cta { display: flex; } }

/* ============ FOOTER ============ */
.footer {
  position: relative;
  background: linear-gradient(180deg, #12122b 0%, #0d0d20 100%);
  color: #cfd2e8;
  padding: 72px 20px 30px;
}
.footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-light), var(--accent), var(--primary-light));
  background-size: 200% 100%;
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 44px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-brand .logo {
  background: linear-gradient(135deg, #ffffff, var(--primary-glow));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 16px;
  display: inline-flex;
  font-size: 1.4rem;
}
.footer-brand p { color: rgba(230,232,245,0.88); font-size: 0.95rem; line-height: 1.75; margin-bottom: 16px; }

.footer-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #ffffff !important;
  padding: 11px 22px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: 6px;
  box-shadow: 0 4px 16px rgba(34,197,94,0.3);
}
.footer-whatsapp:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(34,197,94,0.45); }

.footer-trust { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.footer-trust-item {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 6px 13px;
  border-radius: 50px;
  font-size: 0.78rem;
  color: #e8eaf6;
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-col h4, .footer-col h2 {
  font-size: 0.95rem !important;
  font-weight: 700;
  margin-bottom: 20px;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 11px; }
.footer-col a {
  color: rgba(224,226,240,0.85);
  font-size: 0.93rem;
  display: inline-block;
  transition: var(--transition);
}
.footer-col a:hover { color: var(--primary-glow); transform: translateX(4px); }

.footer-social { display: flex; gap: 12px; margin-top: 22px; }
.footer-social a {
  width: 44px; height: 44px;
  border-radius: 14px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  color: #ffffff;
  transition: var(--transition);
}
.footer-social a:hover {
  transform: translateY(-4px);
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(79,70,229,0.35);
}

.footer-bottom { max-width: 1200px; margin: 0 auto; padding-top: 28px; text-align: center; }
.footer-bottom p { color: rgba(224,226,240,0.8); font-size: 0.88rem; margin-bottom: 6px; }
.footer-bottom .trust-text { color: #4ade80; font-size: 0.83rem; margin-top: 10px; }

@media (max-width: 1024px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; } }
@media (max-width: 640px) { .footer-grid { grid-template-columns: 1fr; gap: 34px; } }

/* ============ LANGUAGE SWITCHER (light navbar) ============ */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: rgba(49,46,129,0.06);
  border: 1px solid rgba(49,46,129,0.12);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0 10px;
}
.lang-switcher .lang-btn,
.lang-switcher a {
  color: var(--gray);
  text-decoration: none;
  padding: 6px 13px;
  border-radius: 50px;
  transition: all 0.25s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border: 1px solid transparent;
}
.lang-switcher .lang-btn:hover,
.lang-switcher a:hover { background: rgba(79,70,229,0.1); color: var(--primary); }
.lang-switcher .lang-btn.active,
.lang-switcher a.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #ffffff !important;
  box-shadow: 0 3px 10px rgba(49,46,129,0.3);
}
html[dir="rtl"] .lang-switcher { direction: rtl; }

/* Language switcher inside mobile menu */
.nav-links li.nav-lang-item { display: none; }
@media (max-width: 900px) {
  .navbar .nav-container > .lang-switcher { display: none; }
  .nav-links li.nav-lang-item { display: block; list-style: none; }
  .nav-links .lang-switcher { display: flex !important; margin: 14px 0 0; justify-content: center; align-self: center; }
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--primary-glow), var(--primary-light)); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }
* { scrollbar-width: thin; scrollbar-color: var(--primary-glow) var(--bg); }

/* ============ FOCUS & ACCESSIBILITY ============ */
:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 2px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-contrast: high) {
  .btn-primary { background: #000 !important; color: #fff !important; border: 2px solid #fff !important; }
}

/* ============ PRINT ============ */
@media print {
  .navbar, .whatsapp-float, .scroll-top, .sticky-cta, .nav-overlay, .footer-social { display: none !important; }
  .hero { padding: 40px 20px !important; background: white !important; color: black !important; }
  a { text-decoration: underline !important; color: #000 !important; }
}

/* ============ SKELETON ============ */
.skeleton {
  background: linear-gradient(90deg, var(--bg) 25%, #e3e6f5 50%, var(--bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}


/* ===== RTL adaptations ===== */
[dir="rtl"] .avis-card::before{left:auto;right:0}
[dir="rtl"] .story-text .highlight-text{border-left:none;border-right:4px solid var(--accent)}
[dir="rtl"] .legal-block .highlight{border-left:none;border-right:4px solid var(--accent)}
[dir="rtl"] .legal-block .warning{border-left:none;border-right:4px solid #f59e0b}
[dir="rtl"] .pricing-features li{text-align:right}
[dir="rtl"] .faq-question{text-align:right}
[dir="rtl"] .legal-table th,[dir="rtl"] .legal-table td{text-align:right}
[dir="rtl"] .legal-block ul li{padding-left:0;padding-right:24px}
[dir="rtl"] .legal-block ul li::before{left:auto;right:2px}
[dir="rtl"] .timeline{padding-left:0;padding-right:40px}
[dir="rtl"] .timeline::before{left:auto;right:13px}
[dir="rtl"] .timeline-item{padding-left:0;padding-right:34px}
[dir="rtl"] .timeline-item::before{left:auto;right:-33px}
[dir="rtl"] .contact-method:hover{transform:translateX(-4px)}
[dir="rtl"] .footer-col a:hover{transform:translateX(-4px)}
[dir="rtl"] .whatsapp-float{left:auto;right:26px}
[dir="rtl"] .scroll-top{right:auto;left:26px}
@media(max-width:900px){[dir="rtl"] .nav-links{right:auto;left:-100%;transition:left .35s cubic-bezier(.4,0,.2,1);box-shadow:8px 0 32px rgba(18,18,43,.14)}[dir="rtl"] .nav-links.active{right:auto;left:0}}
@media(max-width:768px){[dir="rtl"] .whatsapp-float{left:auto;right:18px}[dir="rtl"] .scroll-top{right:auto;left:18px}}
