﻿/* =============================================
   INSPIRE TECH — ANIMATION STYLESHEET
   ============================================= */

/* ---- Global Icon Color ---- */
/* (0,1,1) beats Tailwind utilities (0,1,0) so this always wins */
span.material-symbols-outlined {
  color: #1D3BB9;
}
/* Explicitly white icons on dark cards */
span.material-symbols-outlined.text-white {
  color: #ffffff;
}
/* Icons inside dark gradient panels get white */
[class*="bg-gradient-to"] span.material-symbols-outlined:not(.text-white),
[class*="bg-deep-navy"] span.material-symbols-outlined:not(.text-white) {
  color: #ffffff;
}

/* ---- Page Load Overlay ---- */
#page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#page-loader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-logo {
  font-family: 'Montserrat', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: #1D3BB9;
  position: relative;
  overflow: hidden;
}
.loader-logo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
  animation: shimmerLoader 1.2s infinite;
}
@keyframes shimmerLoader {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ---- KEYFRAMES ---- */
@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33%       { transform: translateY(-18px) rotate(1deg); }
  66%       { transform: translateY(-8px) rotate(-1deg); }
}

@keyframes floatFast {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-12px); }
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0px) scale(1); }
  50%       { transform: translateY(-24px) scale(1.02); }
}

@keyframes blobMove {
  0%, 100% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    transform: translate(0, 0) scale(1);
  }
  33% {
    border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    transform: translate(40px, -30px) scale(1.08);
  }
  66% {
    border-radius: 20% 60% 40% 80% / 70% 30% 60% 40%;
    transform: translate(-20px, 15px) scale(0.95);
  }
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes pulseGlow {
  0%   { box-shadow: 0 0 0 0 rgba(24, 190, 158, 0.35); }
  70%  { box-shadow: 0 0 0 18px rgba(24, 190, 158, 0); }
  100% { box-shadow: 0 0 0 0 rgba(24, 190, 158, 0); }
}

@keyframes pulseGlowPrimary {
  0%   { box-shadow: 0 0 0 0 rgba(29, 59, 185, 0.4); }
  70%  { box-shadow: 0 0 0 16px rgba(29, 59, 185, 0); }
  100% { box-shadow: 0 0 0 0 rgba(29, 59, 185, 0); }
}

@keyframes shimmerBadge {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes wordReveal {
  from { opacity: 0; transform: translateY(28px); filter: blur(4px); }
  to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes drawLine {
  from { height: 0; opacity: 0; }
  to   { height: 100%; opacity: 0.2; }
}

@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}

@keyframes badgePop {
  0%   { opacity: 0; transform: scale(0.6) translateY(-10px); }
  70%  { transform: scale(1.08) translateY(0); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes rotateIn {
  from { opacity: 0; transform: rotate(-8deg) scale(0.9); }
  to   { opacity: 1; transform: rotate(0) scale(1); }
}

@keyframes counterPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* ---- HERO BACKGROUND BLOBS ---- */
.hero-blobs {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: blobMove 10s ease-in-out infinite;
  will-change: transform;
}

.blob-1 {
  width: 700px;
  height: 700px;
  background: radial-gradient(circle at 30% 50%, rgba(29, 59, 185,0.12), rgba(24, 190, 158,0.06));
  top: -250px;
  right: -150px;
  animation-duration: 12s;
  animation-delay: 0s;
}

.blob-2 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(107, 79, 168, 0.08), rgba(24, 190, 158,0.04));
  bottom: -100px;
  left: -80px;
  animation-duration: 9s;
  animation-delay: -3s;
}

.blob-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(184, 188, 252, 0.18), transparent);
  top: 40%;
  left: 35%;
  animation-duration: 14s;
  animation-delay: -6s;
}

/* Hero canvas particles */
#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
}

/* ---- FLOATING ELEMENT ---- */
.animate-float {
  animation: float 6s ease-in-out infinite;
}
.animate-float-fast {
  animation: floatFast 3.5s ease-in-out infinite;
}
.animate-float-slow {
  animation: floatSlow 8s ease-in-out infinite;
}

/* ---- HERO TEXT STAGGER ---- */
.hero-word {
  display: inline-block;
  opacity: 0;
  animation: wordReveal 0.7s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

/* ---- ANIMATED BADGE ---- */
.badge-animate {
  opacity: 0;
  animation: badgePop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s forwards;
  position: relative;
  overflow: hidden;
}
.badge-animate::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.6) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmerBadge 2.5s ease 1.2s infinite;
}

/* ---- GRADIENT ANIMATED TEXT ---- */
.gradient-text-animate {
  background: linear-gradient(135deg, #18BE9E 0%, #00D9B8 45%, #74E8D4 70%, #18BE9E 100%);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease infinite;
}
/* When JS wraps words in .hero-word spans, propagate the gradient to each child */
.gradient-text-animate .hero-word {
  background: linear-gradient(135deg, #18BE9E 0%, #00D9B8 45%, #74E8D4 70%, #18BE9E 100%);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: wordReveal 0.7s cubic-bezier(0.23, 1, 0.32, 1) forwards,
             gradientShift 4s ease infinite;
}

/* ---- HERO BUTTONS ---- */
.btn-hero-primary {
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.8s ease 0.9s both;
}
.btn-hero-primary::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}
.btn-hero-primary:hover::before {
  width: 300px;
  height: 300px;
}
.btn-hero-primary.pulse {
  animation: fadeInUp 0.8s ease 0.9s both, pulseGlowPrimary 2.5s ease 2s infinite;
}
.btn-hero-secondary {
  animation: fadeInUp 0.8s ease 1.1s both;
}

/* ---- COUNTER ANIMATION ---- */
.counter {
  display: inline-block;
  transition: transform 0.15s ease;
}
.counter.counting {
  animation: counterPop 0.3s ease;
}

/* ---- RIPPLE BUTTON EFFECT ---- */
.btn-ripple {
  position: relative;
  overflow: hidden;
}
.ripple-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

/* ---- PULSING CTA BUTTON ---- */
.btn-pulse {
  animation: pulseGlow 2.5s ease infinite;
}
.btn-pulse-primary {
  animation: pulseGlowPrimary 2.5s ease infinite;
}

/* ---- SECTION HEADING REVEAL ---- */
.section-title-reveal {
  opacity: 0;
  animation: fadeInLeft 0.8s ease forwards;
}

/* ---- STAGGERED GRID ITEMS (AOS fallback) ---- */
.stagger-item { opacity: 1; }

/* ---- CARD HOVER 3D (enhanced) ---- */
.card-3d {
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1),
              box-shadow 0.4s ease;
  transform-style: preserve-3d;
  will-change: transform;
}
.card-3d:hover {
  box-shadow: 0 30px 60px -10px rgba(29, 59, 185, 0.15);
}

/* ---- UNDERLINE HOVER EFFECT ---- */
.hover-underline {
  position: relative;
}
.hover-underline::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 2px;
  background: currentColor;
  transition: width 0.3s ease;
}
.hover-underline:hover::after {
  width: 100%;
}

/* ---- ANIMATED GRADIENT BACKGROUNDS ---- */
.bg-gradient-animate {
  background: linear-gradient(135deg, #1D3BB9, #18BE9E, #6B4FA8, #1D3BB9);
  background-size: 300% 300%;
  animation: gradientShift 8s ease infinite;
}

/* ---- NUMBER COUNTER VISUAL ---- */
.stat-number {
  display: inline-block;
  position: relative;
}

/* ---- TIMELINE DRAW LINE ---- */
.timeline-animated {
  position: relative;
}
.timeline-animated .timeline-line {
  animation: drawLine 1.5s ease 0.5s both;
  transform-origin: top center;
}

/* ---- ICON BOUNCE ON HOVER ---- */
.icon-bounce:hover .material-symbols-outlined {
  animation: floatFast 0.6s ease 1;
}

/* ---- IMAGE REVEAL ---- */
.img-reveal {
  overflow: hidden;
}
.img-reveal img {
  transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}
.img-reveal:hover img {
  transform: scale(1.07);
}

/* ---- GLASSMORPHISM CARD GLOW ---- */
.glass-glow {
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.glass-glow:hover {
  box-shadow: 0 0 0 1px rgba(29, 59, 185,0.12),
              0 40px 80px -20px rgba(29, 59, 185,0.12),
              inset 0 1px 0 rgba(255,255,255,0.5);
}

/* ---- SCROLL PROGRESS BAR ---- */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, #1D3BB9, #18BE9E, #74E8D4);
  z-index: 9998;
  transition: width 0.1s linear;
  width: 0%;
}

/* ---- FLOATING SHAPES ---- */
.floating-shape {
  position: absolute;
  opacity: 0.06;
  pointer-events: none;
  animation: float 8s ease-in-out infinite;
}
.floating-shape.shape-circle {
  border-radius: 50%;
  background: #1D3BB9;
}
.floating-shape.shape-square {
  border-radius: 8px;
  background: #18BE9E;
  transform: rotate(45deg);
}
.floating-shape.shape-ring {
  border-radius: 50%;
  border: 3px solid #1D3BB9;
  background: transparent;
  opacity: 0.08;
}

/* ---- NAV ACTIVE LINK ---- */
nav a.active-nav {
  color: #1D3BB9;
  border-bottom: 2px solid #1D3BB9;
}

/* ---- INTERSECTION OBSERVER FADE-IN (for elements without AOS) ---- */
.js-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.js-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.js-reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.js-reveal-left.is-visible {
  opacity: 1;
  transform: translateX(0);
}
.js-reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.js-reveal-right.is-visible {
  opacity: 1;
  transform: translateX(0);
}
.js-reveal-scale {
  opacity: 0;
  transform: scale(0.88);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.js-reveal-scale.is-visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger delay helpers */
.delay-100 { transition-delay: 0.1s !important; }
.delay-200 { transition-delay: 0.2s !important; }
.delay-300 { transition-delay: 0.3s !important; }
.delay-400 { transition-delay: 0.4s !important; }
.delay-500 { transition-delay: 0.5s !important; }
.delay-600 { transition-delay: 0.6s !important; }

/* ---- MOBILE: reduce animations ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* =============================================
   FEATURE ADDITIONS
   ============================================= */

/* ---- BACK TO TOP ---- */
#back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 900;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #1D3BB9;
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease, box-shadow 0.2s ease;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(29, 59, 185,0.35);
}
#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#back-to-top:hover {
  background: #18BE9E;
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(29, 59, 185,0.4);
}

/* ---- CURSOR GLOW ---- */
#cursor-glow {
  position: fixed;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(24, 190, 158,0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
  left: -999px;
  top: -999px;
  transition: left 0.15s ease, top 0.15s ease;
  mix-blend-mode: multiply;
}
@media (hover: none) { #cursor-glow { display: none; } }

/* ---- DARK MODE TOGGLE ---- */
#dark-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid rgba(29, 59, 185,0.15);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1D3BB9;
  transition: background 0.25s, border-color 0.25s, transform 0.25s;
  flex-shrink: 0;
}
#dark-toggle:hover {
  background: rgba(29, 59, 185,0.07);
  border-color: rgba(29, 59, 185,0.3);
  transform: rotate(20deg);
}
.dark #dark-toggle { color: #74E8D4; border-color: rgba(162,201,255,0.25); }
.dark #dark-toggle:hover { background: rgba(162,201,255,0.09); }

/* --- Dark mode overrides --- */
.dark body { background: #0d1117 !important; color: #e6edf3; }
.dark nav {
  background: rgba(13,17,23,0.88) !important;
  border-color: rgba(255,255,255,0.07) !important;
}
.dark nav a { color: #8b949e; }
.dark nav a:hover, .dark nav a.text-primary { color: #74E8D4 !important; }
.dark .glass-card {
  background: rgba(22,27,34,0.85) !important;
  border-color: rgba(255,255,255,0.07) !important;
}
.dark .bg-white { background: #161b22 !important; }
.dark .bg-surface, .dark .bg-background,
.dark .bg-surface-container-low, .dark .bg-surface-container-lowest { background: #0d1117 !important; }
.dark .bg-surface-container { background: #161b22 !important; }
.dark .bg-surface-container-high { background: #1c2128 !important; }
.dark .text-on-surface-variant { color: #8b949e !important; }
.dark .text-on-surface { color: #e6edf3 !important; }
.dark .text-primary { color: #74E8D4 !important; }
.dark .border-outline-variant { border-color: rgba(255,255,255,0.08) !important; }
.dark section { background-color: inherit; }
.dark .hero-gradient { background: none; }
.dark footer { background: #010409 !important; }
.dark #page-loader { background: #0d1117; }
.dark .loader-logo { color: #74E8D4; }
.dark .marquee-logo { background: #161b22 !important; border-color: rgba(255,255,255,0.07) !important; color: #8b949e; }
.dark .testimonial-card { background: #161b22 !important; border-color: rgba(255,255,255,0.07) !important; }
.dark .faq-item { border-color: rgba(255,255,255,0.07); }
.dark .faq-question { color: #e6edf3; }
.dark .cs-modal { background: #161b22; color: #e6edf3; }
.dark .cs-modal-close { background: rgba(255,255,255,0.07); color: #e6edf3; }

/* ---- LOGO MARQUEE ---- */
.marquee-wrapper {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 8%, black 92%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, black 8%, black 92%, transparent 100%);
}
.marquee-track {
  display: flex;
  gap: 20px;
  width: max-content;
  animation: marqueeScroll 32s linear infinite;
}
.marquee-track:hover { animation-play-state: paused; }
.marquee-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 12px;
  border: 1px solid rgba(29, 59, 185,0.08);
  background: white;
  white-space: nowrap;
  font-weight: 600;
  font-size: 14px;
  color: #42474f;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  user-select: none;
  flex-shrink: 0;
  cursor: default;
}
.marquee-logo:hover {
  border-color: rgba(29, 59, 185,0.2);
  box-shadow: 0 4px 16px rgba(29, 59, 185,0.07);
}
.marquee-logo .material-symbols-outlined { font-size: 20px; color: #18BE9E; }
@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---- TESTIMONIALS ---- */
.testimonials-viewport { overflow: hidden; }
.testimonials-track {
  display: flex;
  transition: transform 0.65s cubic-bezier(0.23, 1, 0.32, 1);
}
.testimonial-slide { flex-shrink: 0; width: 100%; }
.testimonial-card {
  background: white;
  border: 1px solid rgba(29, 59, 185,0.07);
  border-radius: 24px;
  padding: 48px;
  position: relative;
}
.testimonial-quote-mark {
  font-size: 80px;
  line-height: 0.8;
  color: #18BE9E;
  opacity: 0.18;
  font-family: Georgia, serif;
  display: block;
  margin-bottom: 16px;
  user-select: none;
}
.testimonial-stars { color: #f59e0b; letter-spacing: 2px; font-size: 18px; margin-bottom: 20px; }
.testimonial-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #c2c7d1;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
}
.testimonial-dot.active { background: #18BE9E; width: 24px; border-radius: 4px; }
.testimonials-arrow {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1.5px solid rgba(29, 59, 185,0.12);
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1D3BB9;
  transition: all 0.25s ease;
  flex-shrink: 0;
}
.testimonials-arrow:hover {
  background: #1D3BB9;
  color: white;
  border-color: #1D3BB9;
  transform: scale(1.08);
}

/* ---- HOW WE WORK / PROCESS ---- */
.process-step-num {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1D3BB9, #18BE9E);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700;
  font-family: 'Montserrat', sans-serif;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(29, 59, 185,0.28);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.process-card:hover .process-step-num {
  transform: scale(1.1);
  box-shadow: 0 12px 32px rgba(29, 59, 185,0.38);
}
.process-connector {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, rgba(24, 190, 158,0.35), rgba(24, 190, 158,0.08));
  margin-top: -30px;
  position: relative;
  top: 0;
}
.process-connector::after {
  content: '';
  position: absolute;
  right: -1px; top: -3px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(24, 190, 158,0.25);
}
@media (max-width: 767px) { .process-connector { display: none; } }

/* ---- FAQ ACCORDION ---- */
.faq-item { border-bottom: 1px solid rgba(29, 59, 185,0.08); }
.faq-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  background: none; border: none;
  cursor: pointer; text-align: left;
  gap: 16px;
  color: inherit;
}
.faq-icon {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1.5px solid rgba(29, 59, 185,0.15);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: #1D3BB9;
}
.faq-item.open .faq-icon {
  background: #1D3BB9; color: white;
  border-color: #1D3BB9;
  transform: rotate(45deg);
}
.faq-answer {
  max-height: 0; overflow: hidden;
  transition: max-height 0.45s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.3s ease;
  opacity: 0;
}
.faq-item.open .faq-answer { max-height: 400px; opacity: 1; padding-bottom: 24px; }

/* ---- CASE STUDY MODAL ---- */
.cs-modal-overlay {
  position: fixed; inset: 0; z-index: 9900;
  background: rgba(0,8,20,0.72);
  backdrop-filter: blur(10px);
  opacity: 0; visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.cs-modal-overlay.open { opacity: 1; visibility: visible; }
.cs-modal {
  background: white; border-radius: 24px;
  max-width: 760px; width: 100%;
  max-height: 88vh; overflow-y: auto;
  transform: translateY(50px) scale(0.94);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}
.cs-modal-overlay.open .cs-modal { transform: translateY(0) scale(1); }
.cs-modal-close {
  position: sticky; top: 16px; left: 100%;
  margin-right: 16px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
  z-index: 10;
  float: right;
}
.cs-modal-close:hover { background: white; transform: rotate(90deg); }

/* ---- FORM VALIDATION ---- */
.field-wrap { position: relative; }
.field-error input,
.field-error select,
.field-error textarea {
  box-shadow: 0 0 0 2px #ba1a1a !important;
  background: #fff8f7 !important;
}
.field-error-msg {
  display: none;
  color: #ba1a1a;
  font-size: 12px;
  margin-top: 5px;
  font-weight: 500;
}
.field-error .field-error-msg { display: block; }
.form-success-state {
  text-align: center;
  padding: 64px 24px;
  animation: fadeInUp 0.5s ease both;
}
.form-success-icon {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e6f4ea, #c8e6c9);
  color: #2e7d32;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
  animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  font-size: 40px;
}

/* ---- WhatsApp Floating Button ---- */
#whatsapp-btn {
  position: fixed;
  bottom: 88px;
  left: 24px;
  z-index: 998;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  box-shadow: 0 4px 20px rgba(37,211,102,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.25s ease;
  animation: waPop 0.5s cubic-bezier(0.34,1.56,0.64,1) 1.2s both;
}
#whatsapp-btn:hover {
  transform: scale(1.12);
  box-shadow: 0 6px 28px rgba(37,211,102,0.6);
}
#whatsapp-btn svg { width: 30px; height: 30px; }
#whatsapp-btn .wa-tooltip {
  position: absolute;
  left: 64px;
  background: #111827;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
#whatsapp-btn .wa-tooltip::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: #111827;
}
#whatsapp-btn:hover .wa-tooltip {
  opacity: 1;
  transform: translateX(0);
}
/* Pulse ring */
#whatsapp-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid #25D366;
  animation: waPulse 2.4s ease-out 2s infinite;
}
@keyframes waPop {
  from { opacity: 0; transform: scale(0.4); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes waPulse {
  0%   { transform: scale(1);   opacity: 0.7; }
  70%  { transform: scale(1.7); opacity: 0; }
  100% { transform: scale(1.7); opacity: 0; }
}
@media (hover: none) {
  #whatsapp-btn .wa-tooltip { display: none; }
}


/* ============================================================
   RESPONSIVE — MOBILE FIRST OVERRIDES
   ============================================================ */

/* ---- Prevent horizontal overflow ---- */
html, body { overflow-x: hidden; }

/* ---- Container padding: 20px on mobile, 64px on desktop ---- */
@media (max-width: 767px) {
  .px-margin-desktop {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
  .py-section-gap {
    padding-top: 60px !important;
    padding-bottom: 60px !important;
  }
  .pb-section-gap { padding-bottom: 60px !important; }
  .pt-section-gap { padding-top: 60px !important; }

  /* ---- Typography: scale down for mobile ---- */
  .text-display-lg,
  [class~="text-display-lg"] {
    font-size: 36px !important;
    line-height: 44px !important;
    letter-spacing: -0.01em !important;
  }
  .text-headline-xl,
  [class~="text-headline-xl"] {
    font-size: 30px !important;
    line-height: 38px !important;
  }
  .text-headline-lg,
  [class~="text-headline-lg"] {
    font-size: 22px !important;
    line-height: 30px !important;
  }
  .text-body-xl,
  [class~="text-body-xl"] {
    font-size: 17px !important;
    line-height: 26px !important;
  }

  /* ---- Bento / multi-column grids: single column on mobile ---- */
  [class*="lg:col-span-"],
  [class*="md:col-span-"] {
    grid-column: 1 / -1 !important;
  }

  /* ---- Section gap spacing ---- */
  .gap-gutter { gap: 16px !important; }
  .mb-16 { margin-bottom: 32px !important; }
  .mb-20 { margin-bottom: 40px !important; }

  /* ---- Hero section ---- */
  .min-h-screen { min-height: 100svh; }
  section[data-hero-shapes] .py-20 { padding-top: 40px; padding-bottom: 40px; }

  /* ---- Cards: reduce internal padding on mobile ---- */
  .glass-card .p-10,
  .rounded-3xl.p-10 { padding: 24px !important; }
  .rounded-3xl.p-8  { padding: 20px !important; }

  /* ---- Stats / counter row: wrap ---- */
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr) !important; }
  .grid-cols-3 { grid-template-columns: repeat(1, 1fr) !important; }

  /* ---- Bento card inner 2-col grids: stack on mobile ---- */
  .grid.md\:grid-cols-2 { grid-template-columns: 1fr !important; }
  .grid.md\:grid-cols-5 { grid-template-columns: 1fr !important; }

  /* ---- Hero CTA buttons: full width ---- */
  .btn-hero-primary, .btn-hero-secondary {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  /* ---- Section title max-width ---- */
  .max-w-2xl, .max-w-3xl, .max-w-xl { max-width: 100% !important; }

  /* ---- Footer grid ---- */
  .footer-grid { grid-template-columns: 1fr !important; }

  /* ---- Marquee ---- */
  .marquee-wrapper { overflow: hidden; }

  /* ---- Hide decorative oversized icons ---- */
  .text-\[200px\], .text-\[120px\] {
    font-size: 80px !important;
  }

  /* ---- nav padding ---- */
  nav .max-w-container-max {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}

/* ---- Tablet (768px – 1023px) mid-range tweaks ---- */
@media (min-width: 768px) and (max-width: 1023px) {
  .px-margin-desktop {
    padding-left: 32px !important;
    padding-right: 32px !important;
  }
  .text-display-lg,
  [class~="text-display-lg"] {
    font-size: 48px !important;
    line-height: 58px !important;
  }
}

/* =============================================================
   GLOBAL TYPOGRAPHY  (Libre Franklin — matches foreground.ae)
   ============================================================= */
:root { --font-sans: 'Libre Franklin', 'Segoe UI', Arial, sans-serif; }

body,
input, textarea, select, button {
  font-family: var(--font-sans);
}
/* Tailwind maps font-* utilities to Inter / Montserrat — override them all
   (but never the icon font). */
[class*="font-"]:not(.material-symbols-outlined) {
  font-family: var(--font-sans) !important;
}
.material-symbols-outlined { font-family: 'Material Symbols Outlined' !important; }

/* headings a touch heavier, like the reference site */
h1, h2, h3,
[class*="font-display"], [class*="font-headline"] { font-weight: 700; letter-spacing: -0.01em; }

/* =============================================================
   LANGUAGE TOGGLE + ARABIC (RTL) SUPPORT
   ============================================================= */

/* ---- language toggle button (matches #dark-toggle) ---- */
#lang-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid rgba(29, 59, 185, 0.15);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1D3BB9;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  font-family: 'Libre Franklin', 'Segoe UI', Arial, sans-serif;
  transition: background 0.25s, border-color 0.25s, transform 0.25s;
  flex-shrink: 0;
}
#lang-toggle:hover {
  background: rgba(29, 59, 185, 0.07);
  border-color: rgba(29, 59, 185, 0.3);
  transform: scale(1.06);
}
.dark #lang-toggle { color: #74E8D4; border-color: rgba(162, 201, 255, 0.25); }
.dark #lang-toggle:hover { background: rgba(162, 201, 255, 0.09); }
html[dir="rtl"] #lang-toggle { font-family: 'Libre Franklin', sans-serif; }

/* ---- Arabic typeface (IBM Plex Sans Arabic — matches foreground.ae) ---- */
html.lang-ar,
html.lang-ar body,
html.lang-ar input,
html.lang-ar textarea,
html.lang-ar select,
html.lang-ar button,
html.lang-ar [class*="font-"]:not(.material-symbols-outlined) {
  font-family: 'IBM Plex Sans Arabic', 'Segoe UI', 'Tahoma', 'Arial', sans-serif !important;
}

/* ---- base direction ---- */
html[dir="rtl"] body { direction: rtl; text-align: right; }
html[dir="rtl"] .text-center { text-align: center; }

/* Arabic: uppercase + wide tracking are Latin-only conventions */
html.lang-ar .uppercase { text-transform: none !important; }
html.lang-ar [class*="tracking-"] { letter-spacing: normal !important; }

/* ---- logical flipping of common Tailwind directional utilities ---- */
html[dir="rtl"] .ml-1 { margin-left: 0; margin-right: 0.25rem; }
html[dir="rtl"] .ml-2 { margin-left: 0; margin-right: 0.5rem; }
html[dir="rtl"] .ml-3 { margin-left: 0; margin-right: 0.75rem; }
html[dir="rtl"] .mr-1 { margin-right: 0; margin-left: 0.25rem; }
html[dir="rtl"] .mr-2 { margin-right: 0; margin-left: 0.5rem; }
html[dir="rtl"] .mr-3 { margin-right: 0; margin-left: 0.75rem; }
html[dir="rtl"] .text-left { text-align: right; }
html[dir="rtl"] .text-right { text-align: left; }

/* space-x-* helpers reverse in RTL */
html[dir="rtl"] [class*="space-x-"] > :not([hidden]) ~ :not([hidden]) {
  --tw-space-x-reverse: 1;
}

/* absolutely-positioned decorations pinned to an edge */
html[dir="rtl"] .left-8  { left: auto; right: 2rem; }
html[dir="rtl"] .right-8 { right: auto; left: 2rem; }
html[dir="rtl"] .left-6  { left: auto; right: 1.5rem; }
html[dir="rtl"] .right-6 { right: auto; left: 1.5rem; }
html[dir="rtl"] .bottom-8.left-1\/2 { /* scroll indicator stays centered */ }

/* border accents that mark the start edge */
html[dir="rtl"] .border-l,
html[dir="rtl"] .border-l-2,
html[dir="rtl"] .border-l-4 {
  border-left-width: 0;
  border-right-width: 4px;
}

/* icon arrows that imply "forward" should point the RTL way */
html[dir="rtl"] .material-symbols-outlined.rtl-flip,
html[dir="rtl"] .rtl-flip { transform: scaleX(-1); }

/* nav: keep the toggle cluster tidy in RTL */
html[dir="rtl"] nav .gap-4 { gap: 0.75rem; }

/* forms */
html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select { text-align: right; direction: rtl; }
html[dir="rtl"] input[type="email"] { text-align: right; }

/* typed-text cursor sits on the trailing (left) edge in RTL */
html[dir="rtl"] [data-typed] { border-right: 0 !important; border-left: 2px solid #0060a8; padding-right: 0 !important; padding-left: 2px; }
