/* ===================================================================
   TrueCodeSpace — Dark Slate Theme / Command Center Aesthetic
   Base #0A0D14 | Glassmorphism slate-900/60 | Blue glow behind form |
   Gold glow behind headline | Faded 36px circuit grid + vignette
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&display=swap');

/* --- Tokens --- */
:root {
  --obsidian:        #0A0E17;
  --surface:         #141925;
  --glass:           rgba(15, 23, 42, 0.6);   /* slate-900/60 */
  --glass-border:    rgba(255, 255, 255, 0.10);
  --border:          #1E293B;
  --border-hover:    #334155;
  --cyber-blue:      #2563EB;                 /* blue-600 */
  --cyber-blue-glow: rgba(37, 99, 235, 0.35);
  --cyber-blue-dim:  rgba(37, 99, 235, 0.12);
  --python-gold:     #F5B301;                 /* amber-500 */
  --gold-glow:       rgba(245, 179, 1, 0.30);
  --gold-dim:        rgba(245, 179, 1, 0.10);
  --white:           #FFFFFF;
  --muted:           #94A3B8;
  --muted-light:     #CBD5E1;
  --danger:          #EF4444;
  --success:         #22C55E;
  --radius:          12px;
  --radius-sm:       8px;
  --radius-lg:       16px;
  --blur:            20px;
  --transition:      all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font:            'Tajawal', sans-serif;
}

/* --- Fluid type scale: clamp(min, preferred, max) ---
   Used by major text to stay responsive on all screens. */
:root {
  --fs-xl: clamp(28px, 4.2vw, 44px);
  --fs-lg: clamp(17px, 1.8vw, 19px);
  --fs-md: clamp(15px, 1.4vw, 17px);
  --fs-sm: clamp(12px, 1vw, 14px);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: hidden; }

body {
  font-family: var(--font);
  background: var(--obsidian);
  color: var(--white);
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Direction is driven by the active language (html dir attribute),
   so author CSS never pins one direction over the whole page. */
html[dir="rtl"] body { direction: rtl; }
html[dir="ltr"] body { direction: ltr; }

/* --- Ambient glow blobs ---
   Gold (#amber-500/10) behind the headline area, Blue (#blue-600/15) behind
   the form card. Positioned in view; non-interactive. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(500px 400px at 18% 40%, rgba(245, 179, 1, 0.10), transparent 70%),
    radial-gradient(600px 520px at 78% 38%, rgba(37, 99, 235, 0.15), transparent 70%),
    radial-gradient(900px 700px at 50% 120%, rgba(37, 99, 235, 0.12), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* --- Faded 36px circuit grid, centre radial vignette mask --- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.045) 1px, transparent 1px);
  background-size: 36px 36px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

/* Dark Slate Base */
.hero-container {
  position: relative;
  background-color: #080B11;
  overflow: hidden;
}

/* Real Circuit Vector Traces Overlay (No Lighting, No Simple Grids) */
.hero-bg-circuits {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.15;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 50%, black 50%, transparent 95%);
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 50%, black 50%, transparent 95%);
}

/* Full-width, non-repeating PCB trace SVG overlay */
.hero-circuit-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;

  /* 1. Drop opacity so circuits sit softly in the background */
  opacity: 0.08;

  /* 2. Mask out lines directly behind the text & form areas */
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, transparent 25%, black 85%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, transparent 25%, black 85%);
}

a { color: var(--cyber-blue); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--python-gold); }
img { max-width: 100%; display: block; }
::selection { background: var(--cyber-blue); color: var(--white); }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--obsidian); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--cyber-blue); }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.hidden { display: none !important; }

/* ===================================================================
   NAVBAR
   =================================================================== */
.navbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1000;
  width: 100%;
  display: block; /* navbar is NOT the flex; nav-container inside owns the layout */
  padding: 24px 0;
  background: transparent;
  transition: var(--transition);
}

/* STATIC NAVBAR — LOCKED LTR, NEVER FLIPS.
   Logo ALWAYS left, Lang switcher ALWAYS right, in every language. */
.navbar, .nav-container {
  direction: ltr !important;
}

/* Guarantee child order never reverses with document direction */
.nav-container .logo-wrapper { order: 1 !important; }
.nav-container .lang-switcher { order: 2 !important; }

.navbar.scrolled {
  padding: 10px 0;
  background: rgba(10, 12, 16, 0.95);
}

/* CENTERED NAV LAYOUT — push logo far left, switcher far right */
.nav-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  direction: ltr !important; /* Forces logo on far left, switcher on far right always */
}

/* Logo Wrapper — flex-direction row forces icon LEFT of text in all dirs */
.logo-wrapper {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  background: transparent !important;
  text-decoration: none;
  direction: ltr;
}

.brand-logo-img, .brand-icon {
  height: 42px !important;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-name {
  font-size: 1.4rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.5px;
}

/* ===================================================================
   LOGO & BRAND TEXT VERTICAL ALIGNMENT
   =================================================================== */
.navbar-brand,
.logo-container,
.brand-logo,
.logo-wrapper {
  display: inline-flex !important;
  align-items: center !important; /* Forces vertical centering */
  gap: 10px !important; /* Exact spacing between icon and text */
  text-decoration: none !important;
  line-height: 1 !important;
  flex-direction: row;
  direction: ltr;
  background: transparent !important;
}

.navbar-brand img,
.navbar-brand svg,
.logo-container img,
.logo-icon,
.brand-logo-img,
.brand-icon {
  height: 32px !important;
  width: auto !important;
  display: block !important;
  object-fit: contain;
  flex-shrink: 0;
}

.navbar-brand span,
.logo-text,
.brand-name {
  font-size: 1.25rem !important; /* 20px */
  font-weight: 800 !important;
  color: #FFFFFF !important;
  line-height: 1 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-block !important;
  transform: translateY(-1px); /* Optical baseline alignment fix */
  letter-spacing: -0.5px;
}

/* Language Switcher — Compact Pill */
.lang-switcher,
.language-selector {
  display: inline-flex !important;
  align-items: center !important;
  height: 36px !important;
  padding: 3px !important;
  gap: 2px !important;
  background-color: #0B111D !important; /* Dark slate base */
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 9999px !important;
  box-shadow: none !important;
}

/* Common Link/Button Base Style */
.lang-switcher a,
.lang-switcher button,
.lang-switcher [data-lang] {
  font-family: 'Cairo', 'Tajawal', 'IBM Plex Sans Arabic', system-ui, sans-serif !important;
  height: 100% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 9999px !important;
  text-decoration: none !important;
  border: none !important;
  outline: none !important;
  transition: all 0.2s ease !important;
}

/* Active Yellow Pill (Clean, Ultra-Bold, Compact) */
.lang-switcher .active,
.lang-switcher [data-lang].active,
.lang-switcher a.active,
.lang-switcher button.active {
  background-color: #FFC700 !important;
  color: #0A0E17 !important; /* Rich black text */
  font-weight: 800 !important; /* Extra bold text matching reference */
  font-size: 13px !important;
  padding: 0 16px !important;
  line-height: 1 !important;
  box-shadow: none !important;
  border: none !important;
  -webkit-appearance: none !important;
}

/* Remove any pseudo-element rings */
.lang-switcher .active::before,
.lang-switcher .active::after {
  display: none !important;
  content: none !important;
}

/* Inactive Items (EN, FR, العربية) */
.lang-switcher a:not(.active),
.lang-switcher button:not(.active),
.lang-switcher [data-lang]:not(.active) {
  background: transparent !important;
  color: #8E9BAE !important; /* Crisp muted light slate */
  font-weight: 700 !important;
  font-size: 13px !important;
  padding: 0 12px !important;
  line-height: 1 !important;
  opacity: 0.75 !important;
  border-radius: 9999px !important;
}

.lang-switcher a:not(.active):hover,
.lang-switcher button:not(.active):hover {
  color: #FFFFFF !important;
  opacity: 1 !important;
}

/* ===================================================================
   HERO SECTION
   =================================================================== */
.hero {
  padding: 140px 0 80px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
}

/* HERO CONTAINER — Lock container flow to avoid browser flex bugs
   Direction locked to LTR so order:1 is ALWAYS LEFT and order:2 ALWAYS RIGHT,
   independent of the document language/direction. */
.hero-grid {
  display: flex !important;
  direction: ltr !important;
  align-items: center;
  justify-content: space-between;
  gap: 3.5rem;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}

/* Form card — full healthy width, never squished */
.hero-form-card {
  width: 100% !important;
  max-width: 480px !important;
  flex-shrink: 0 !important;
}

/* Text block — takes remaining space */
.hero-text-block {
  flex: 1 !important;
}

/* ENGLISH & FRENCH (LTR): Text on LEFT (order 1), Form on RIGHT (order 2) */
html[dir="ltr"] .hero-text-block {
  order: 1 !important;
  text-align: left !important;
  direction: ltr !important;
}
html[dir="ltr"] .hero-form-card {
  order: 2 !important;
  direction: ltr !important;
}

/* ARABIC (RTL): Text on RIGHT, Form on LEFT —
   order:2 (form) is the LAST item = far LEFT in the LTR-locked container */
html[dir="rtl"] .hero-text-block {
  order: 2 !important;
  text-align: right !important;
  direction: rtl !important;
}
html[dir="rtl"] .hero-form-card {
  order: 1 !important;
  direction: rtl !important;
}

/* Column vertical balance */
.hero-content,
.hero-text-col,
.hero-left-col {
  max-width: 600px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start !important;
  gap: 1rem !important;
  align-items: flex-start !important; /* prevent flex items from stretching */
}

/* Live Status Badge */
/* Force top status badge to wrap tightly around text */
.hero-badge,
.status-badge,
.announcement-badge,
.hero-content .badge,
.live-status-badge {
  width: fit-content !important;
  max-width: max-content !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 6px 16px !important;
  border-radius: 9999px !important; /* Compact pill shape */
  background: rgba(15, 23, 42, 0.6) !important;
  border: 1px solid rgba(255, 199, 0, 0.25) !important;
  margin-bottom: 1rem !important;
  font-size: 13px;
  font-weight: 600;
  color: var(--python-gold);
  animation: fadeInUp 0.6s ease;
}

.pulse-indicator {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}

.pulse-indicator::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--success);
  animation: pulseRing 2s ease-in-out infinite;
}

@keyframes pulseRing {
  0%   { transform: scale(1); opacity: 0.8; }
  70%  { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Headline: Balanced 2-3 line layout */
.hero-title {
  font-size: 2.25rem !important; /* 36px desktop */
  line-height: 1.25 !important;
  max-width: 680px !important;
  font-weight: 800 !important;
  color: var(--white);
  margin-bottom: 20px;
  animation: fadeInUp 0.6s ease 0.1s both;
}

.hero-title .highlight {
  color: var(--python-gold);
  position: relative;
}

.hero-title .highlight::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--python-gold), transparent);
  border-radius: 2px;
}

/* Subhead: High-contrast light slate */
.hero-subtitle,
.hero-subhead {
  color: #CBD5E1 !important;
  font-size: 1rem !important; /* 16px */
  line-height: 1.6 !important;
  opacity: 1 !important;
  margin-bottom: 0.5rem !important; /* eliminate large bottom margin */
  animation: fadeInUp 0.6s ease 0.2s both;
}

/* Hero Credibility Text — Vertical Stack with Right Accent Bars (RTL) */
.hero-credibility,
.credibility-bar,
.hero-stats {
  display: flex !important;
  flex-direction: column !important; /* Clean vertical stack */
  gap: 0.5rem !important;        /* Snug vertical spacing between items */
  align-items: flex-start !important; /* Align right in RTL */
  margin-top: 0.75rem !important; /* Drastically reduced top space */
  width: 100% !important;
}

/* Dynamic Accent Border (Right in AR, Left in EN/FR) */
.credibility-item,
.hero-stats .stat-item,
.hero-stat {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
  color: #FFC700 !important; /* Solid vibrant yellow */
  font-weight: 700 !important;
  font-size: 1rem !important;
  line-height: 1.4 !important;
  background: rgba(255, 255, 255, 0.02) !important;
  border-right: none !important;
  border-left: none !important;
  border-inline-start: 3px solid #FFC700 !important; /* Automatic LTR/RTL mirror */
  padding: 6px 14px 6px 10px !important;
  padding-inline-start: 12px !important;
  padding-inline-end: 14px !important;
  border-radius: 4px !important;
  white-space: nowrap !important;
}

/* Force left text alignment for LTR languages */
html[lang="en"] .credibility-item,
html[lang="fr"] .credibility-item,
[dir="ltr"] .credibility-item {
  text-align: left !important;
  direction: ltr !important;
}

/* Force LTR isolation on alphanumeric badges inside RTL context */
.credibility-item span[dir="ltr"],
.stat-item span[dir="ltr"] {
  display: inline-block !important;
  direction: ltr !important;
  unicode-bidi: isolate !important;
}

.hero-stats {
  display: flex;
  gap: 32px;
  animation: fadeInUp 0.6s ease 0.3s both;
}

.hero-stat { text-align: center; }

.hero-stat .number {
  display: block;
  font-size: 28px;
  font-weight: 900;
  color: var(--python-gold);
  line-height: 1.2;
}

.hero-stat .label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

/* ===================================================================
   LEAD FORM CARD
   =================================================================== */
.lead-form-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 36px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.6s ease 0.4s both;
}

.lead-form-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cyber-blue), var(--python-gold));
}

.form-header {
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-header::before {
  content: '';
  width: 4px;
  height: 24px;
  background: var(--cyber-blue);
  border-radius: 2px;
}

.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted-light);
  margin-bottom: 6px;
}

.form-card input,
.form-card select,
.form-group input,
.form-group select {
  width: 100%;
  padding: 14px 16px;
  background-color: #0A0E17 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: var(--radius-sm);
  color: #FFFFFF !important;
  font-family: var(--font);
  font-size: 15px;
  transition: var(--transition);
  outline: none;
  -webkit-appearance: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Chrome/Safari Autofill Active State */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-text-fill-color: #FFFFFF !important;
  -webkit-box-shadow: 0 0 0px 1000px #0A0E17 inset !important;
  transition: background-color 5000s ease-in-out 0s !important;
  color: #FFFFFF !important;
}

/* Chrome/Safari Autofill Hover Preview State */
input:-webkit-autofill-preview {
  -webkit-text-fill-color: #FFFFFF !important;
  color: #FFFFFF !important;
}

/* Text inputs follow the document direction.
   EN/FR (LTR) => writing starts left. AR (RTL) => writing starts right. */
html[dir="ltr"] .form-group input,
html[dir="ltr"] .form-group select {
  direction: ltr !important;
  text-align: left !important;
}

/* Phone number and email ALWAYS write LTR, in every language */
.form-group input[type="tel"],
.form-group input[type="email"],
.phone-row input {
  direction: ltr !important;
  text-align: left !important;
}

.form-group input::placeholder { color: #64748b; }

.form-group input:focus,
.form-group select:focus {
  border-color: var(--cyber-blue);
  box-shadow: 0 0 0 3px var(--cyber-blue-glow);
}

.form-group input.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
  display: none;
}

.form-error.visible { display: block; }

/* Phone Row */
.phone-row {
  display: flex;
  gap: 8px;
  align-items: center;
  direction: ltr;
}

.phone-row select {
  width: 120px;
  flex-shrink: 0;
  padding: 14px 12px;
  font-size: 15px;
  font-family: var(--font);
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  background-color: rgba(10, 12, 16, 0.6);
  color: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394A3B8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 10px center;
  padding-left: 28px;
}

.phone-row select:focus {
  border-color: var(--cyber-blue);
  box-shadow: 0 0 0 3px var(--cyber-blue-glow);
}

.phone-row input[type="tel"] {
  flex: 1;
  min-width: 0;
}

/* CTA */
.btn-cta {
  width: 100%;
  padding: 16px 24px;
  background: var(--cyber-blue);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  margin-top: 8px;
}

.btn-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left 0.5s ease;
}

.btn-cta:hover {
  background: #1D4ED8;
  box-shadow: 0 0 24px var(--cyber-blue-glow);
  transform: translateY(-1px);
}

.btn-cta:hover::before { left: 100%; }
.btn-cta:active { transform: translateY(0); }
.btn-cta:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Hero booking CTA (replaces the old inline form) */
.btn-cta-hero {
  padding: 20px 24px;
  font-size: 17px;
}

/* Mobile sticky "Book now" bar — always visible in the first viewport */
.mobile-cta-bar {
  display: none;
}

@media (max-width: 640px) {
  .mobile-cta-bar {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1500;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(6, 10, 19, 0), rgba(6, 10, 19, 0.92) 40%);
    pointer-events: none;
  }
  .mobile-cta-bar .btn-cta {
    margin-top: 0;
    pointer-events: auto;
  }
}

/* ===================================================================
   QUIZ MODAL
   =================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
  position: relative;
  transform: translateY(30px) scale(0.95);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Top row: X exit on the far left, step indicator on the far right. */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 0;
}

.modal-body {
  padding: 24px 32px 32px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Language-driven modal direction & alignment.
   The modal wrapper gets dir + rtl-container/ltr-container from app.js. */
#quiz-modal.rtl-container .modal,
#quiz-modal.rtl-container .modal-body,
#quiz-modal.rtl-container .quiz-question,
#quiz-modal.rtl-container .quiz-option { direction: rtl; text-align: right; }

#quiz-modal.ltr-container .modal,
#quiz-modal.ltr-container .modal-body,
#quiz-modal.ltr-container .quiz-question,
#quiz-modal.ltr-container .quiz-option { direction: ltr; text-align: left; }

#quiz-modal.rtl-container .quiz-option .option-icon { margin-right: 0; }
#quiz-modal.ltr-container .quiz-option .option-icon { margin-left: 0; }

.modal-body::-webkit-scrollbar { width: 4px; }
.modal-body::-webkit-scrollbar-track { background: transparent; }
.modal-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.modal-close {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: var(--transition);
  z-index: 10;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

/* Progress */
.progress-step {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted-light);
  white-space: nowrap;
}

.progress-step .gold { color: var(--python-gold); }

/* First three steps: keep the progress bar, hide the step counter text. */
.progress-step.hidden-step-text { visibility: hidden; }

/* Booking step (9/9): give the Calendly widget a bit more room. */
#quiz-modal.wide .modal { max-width: 720px; }

.progress-bar-track {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 16px;
  flex-shrink: 0;
}

.progress-bar-fill {
  height: 100%;
  background: var(--python-gold);
  border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px var(--gold-glow);
}

/* Quiz */
.quiz-question {
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 24px;
  line-height: 1.5;
}

/* Sleek Executive Framing Banner */
.quiz-step-banner,
.quiz-banner-box {
  background: rgba(255, 255, 255, 0.03) !important;
  border: none !important;
  border-inline-start: 3px solid #FFC700 !important; /* Subtle accent line */
  border-radius: 6px !important;
  color: #CBD5E1 !important; /* Crisp light slate text */
  font-size: 0.9rem !important;
  line-height: 1.5 !important;
  padding: 10px 16px !important;
  margin-bottom: 1.25rem !important;
  font-weight: 600;
}

/* Important remarks / intros above every question — flat yellow shade, no glow */
.quiz-intro {
  background: rgba(255, 199, 0, 0.14) !important;
  border: 1px solid rgba(255, 199, 0, 0.50) !important;
  border-inline-start-width: 4px !important;
  border-inline-start-color: #FFC700 !important;
  border-radius: 8px !important;
  color: #FFE9A8 !important;
  font-size: 0.9rem !important;
  line-height: 1.55 !important;
  padding: 10px 14px !important;
  margin-bottom: 1.25rem !important;
  font-weight: 700;
}

.quiz-question .step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--python-gold);
  color: var(--obsidian);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
  margin-inline-end: 10px;
  vertical-align: middle;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: rgba(10, 12, 16, 0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted-light);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-align: start;
  width: 100%;
}

.quiz-option .option-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cyber-blue-dim);
  border-radius: var(--radius-sm);
  font-size: 18px;
  flex-shrink: 0;
  transition: var(--transition);
}

.quiz-option:hover {
  border-color: var(--cyber-blue);
  background: var(--cyber-blue-dim);
  color: var(--white);
  box-shadow: 0 0 20px var(--cyber-blue-glow);
}

.quiz-option:hover .option-icon {
  background: var(--cyber-blue);
  color: var(--white);
}

.quiz-option.selected {
  border-color: var(--cyber-blue);
  background: var(--cyber-blue-dim);
  color: var(--white);
  box-shadow: 0 0 20px var(--cyber-blue-glow);
}

.quiz-option.selected .option-icon {
  background: var(--cyber-blue);
  color: var(--white);
}

/* Disqualifier options share the neutral dark container + neutral icon badge */
.quiz-option[data-disq="true"],
.quiz-option[data-disqualify="true"] {
  background-color: #1E293B !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.quiz-option[data-disq="true"] .option-icon,
.quiz-option[data-disq="true"] .icon-box,
.quiz-option[data-disqualify="true"] .option-icon,
.quiz-option[data-disqualify="true"] .icon-box {
  background-color: rgba(255, 255, 255, 0.05) !important;
  color: #FFFFFF !important;
}

/* ==================================================================
   DISQUALIFICATION OPTION VISUAL UNIFICATION
   Force ALL option cards to be 100% visually indistinguishable
   ================================================================== */
.quiz-option,
.quiz-option[data-disqualify="true"],
.quiz-option[data-eliminatory="true"],
.quiz-option.disqualify,
.quiz-option[data-disq="true"],
.quiz-option:last-child {
  background: #0F172A !important; /* Exact match to standard option card fill */
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #FFFFFF !important;
  opacity: 1 !important;
  box-shadow: none !important;
}

/* Standardize number/icon badge containers inside all option cards */
.quiz-option .option-number,
.quiz-option .icon-box,
.quiz-option .option-icon,
.quiz-option[data-disqualify="true"] .option-number,
.quiz-option[data-disqualify="true"] .icon-box,
.quiz-option[data-disqualify="true"] .option-icon,
.quiz-option[data-disq="true"] .option-number,
.quiz-option[data-disq="true"] .option-icon {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #FFFFFF !important;
}

/* First-question status icons: modern line SVGs in brand gold */
.quiz-option .option-icon svg {
  width: 22px;
  height: 22px;
  color: #F5B301;
  flex-shrink: 0;
  transition: var(--transition);
}
.quiz-option .option-icon.is-status {
  background: rgba(245, 179, 1, 0.10) !important;
  border: 1px solid rgba(245, 179, 1, 0.30) !important;
}
.quiz-option[data-disq="true"] .option-icon.is-status,
.quiz-option[data-disqualify="true"] .option-icon.is-status {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
.quiz-option[data-disq="true"] .option-icon svg,
.quiz-option[data-disqualify="true"] .option-icon svg {
  color: #FFFFFF !important;
}

/* Standardize hover & active focus states across all options */
.quiz-option:hover,
.quiz-option[data-disqualify="true"]:hover,
.quiz-option[data-disq="true"]:hover {
  background: #1E293B !important;
  border-color: rgba(255, 199, 0, 0.4) !important; /* Subtle yellow focus border */
}

.quiz-step-enter {
  animation: slideInRight 0.4s ease forwards;
}

/* ===================================================================
   QUALIFIED SCREEN
   =================================================================== */
.qualified-screen { padding: 24px 12px 32px; }

.qualified-header {
  text-align: center;
  margin-bottom: 20px;
}

.qualified-check {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--success);
}

.qualified-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
}

.qualified-header p {
  font-size: 14px;
  color: var(--muted);
}

/* Calendly booking embed must never force the modal wider than the phone.
   min-width removed; constrain to container and center vertically-stacked. */
.calendly-widget-container,
#calendly-embed {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 auto;
}

/* ===================================================================
   DISQUALIFIED SCREEN
   =================================================================== */
.disqualified-screen {
  padding: 40px 32px;
  text-align: center;
}

.disq-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.disqualified-screen .btn-instagram {
  max-width: 340px;
  margin: 0 auto;
}

.disqualified-screen h3 {
  font-size: 20px;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 16px;
  line-height: 1.4;
}

.disqualified-screen p {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 28px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.btn-instagram,
.confirmation-card .cta-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px !important;
  width: 100% !important;
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%) !important;
  color: #FFFFFF !important;
  font-weight: 800 !important;
  border: none !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 15px rgba(220, 39, 67, 0.35) !important;
  cursor: pointer !important;
  font-family: var(--font);
  font-size: 15px;
  transition: var(--transition);
}

.btn-instagram:hover,
.confirmation-card .cta-button:hover {
  transform: translateY(-2px);
  color: #FFFFFF !important;
}

/* ===================================================================
   POST-BOOKING CONFIRMATION SCREEN
   ================================================================== */
.booking-screen {
  padding: 32px;
  text-align: center;
}

.booking-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  padding: 8px 22px;
  background: rgba(255, 199, 0, 0.1);
  border: 1px solid #FFC700;
  border-radius: 999px;
  color: #FFC700;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.booking-screen h3 {
  font-size: 22px;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 12px;
  line-height: 1.4;
}

.booking-sub {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 24px;
}

.booking-box {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.booking-box-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--python-gold);
  margin-bottom: 10px;
}

.booking-box p {
  font-size: 14px;
  color: var(--muted-light);
  line-height: 1.8;
  margin-bottom: 16px;
}

.booking-follow {
  font-weight: 600;
  color: var(--white);
}

.booking-box .btn-instagram {
  margin-top: 4px;
  margin-left: auto;
  margin-right: auto;
}

/* ===================================================================
   FOOTER
   =================================================================== */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  position: relative;
  z-index: 1;
}

.footer p {
  font-size: 13px;
  color: var(--muted);
}

.footer .brand {
  color: var(--python-gold);
  font-weight: 700;
}

/* ===================================================================
   ANIMATIONS
   =================================================================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ===================================================================
   RESPONSIVE
   =================================================================== */
@media (max-width: 968px) {
  .hero-grid {
    flex-direction: column !important;
    gap: 40px;
  }

  /* On mobile: text block shows first (on top), form below — for all dirs */
  html[dir="ltr"] .hero-text-block,
  html[dir="rtl"] .hero-text-block {
    order: 1 !important;
    text-align: center !important;
    max-width: 100%;
  }
  html[dir="ltr"] .hero-form-card,
  html[dir="rtl"] .hero-form-card {
    order: 2 !important;
  }

  .hero-stats { justify-content: center; }

  .lead-form-card {
    max-width: 480px;
    margin: 0 auto;
  }
}

@media (max-width: 640px) {
  .hero { padding: 120px 0 60px; }

  .hero-title { font-size: 24px; }

  .hero-stats {
    gap: 20px;
    flex-wrap: wrap;
  }

  .lead-form-card { padding: 24px; }

  .modal-body { padding: 24px 20px; }

  .qualified-screen { padding: 20px 4px 24px; }

  .disqualified-screen { padding: 32px 20px; }

  .booking-screen { padding: 24px 16px; }

  .quiz-option { padding: 14px 16px; }

  .phone-row {
    flex-direction: column;
    gap: 8px;
  }

  .phone-row select { width: 100%; }

  .lang-switcher { gap: 2px; padding: 3px; }
}

/* ===================================================================
   MOBILE RESPONSIVE OVERHAUL (@media max-width: 640px)
   =================================================================== */

/* 48px touch targets regardless of page zoom */
.quiz-option,
.btn-cta,
.btn-instagram,
.form-card input,
.form-card select,
.form-group input,
.form-group select {
  min-height: 48px;
}

@media (max-width: 640px) {
  /* 1. Force Full Viewport Width & Minimal Side Padding */
  .navbar,
  header,
  .header-container,
  .nav-container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 12px !important;  /* Push logo closer to left edge */
    padding-right: 12px !important; /* Push lang switcher closer to right edge */
    padding-top: 12px !important;
    padding-bottom: 12px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    box-sizing: border-box !important;
  }

  /* 2. Reset Any Outer Margins on Brand/Logo Container */
  .navbar-brand,
  .logo-container,
  .brand-logo,
  .logo-wrapper {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* 3. Reset Any Outer Margins on Language Switcher */
  .lang-switcher,
  .language-selector {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* 2. Brand Logo Container & Icon Scaling */
  .navbar-brand,
  .logo-container,
  .brand-logo,
  .logo-wrapper {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important; /* Compact gap between icon and text */
    text-decoration: none !important;
    direction: ltr;
  }

  .navbar-brand img,
  .navbar-brand svg,
  .logo-icon,
  .brand-logo-img,
  .brand-icon {
    height: 30px !important; /* Prominent, properly scaled icon */
    width: auto !important;
    display: block !important;
    object-fit: contain;
    flex-shrink: 0;
  }

  /* 3. Scaled Mobile Brand Text (Visible & Proportional) */
  .navbar-brand span,
  .logo-text,
  .brand-name {
    display: inline-block !important; /* Ensure text remains visible */
    font-size: 0.92rem !important; /* ~14.5px compact font size */
    font-weight: 800 !important;
    color: #FFFFFF !important;
    line-height: 1 !important;
    letter-spacing: -0.3px !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: translateY(-1px);
  }

  /* 3. Compact Mobile Language Switcher */
  .lang-switcher,
  .language-selector {
    height: 30px !important;
    padding: 2px !important;
    gap: 2px !important;
  }

  .lang-switcher .active,
  .lang-switcher [data-lang].active {
    padding: 3px 10px !important;
    font-size: 11px !important;
  }

  .lang-switcher a:not(.active),
  .lang-switcher button:not(.active) {
    padding: 3px 6px !important;
    font-size: 11px !important;
  }

  /* 4. Mobile Hero Headline Typography Scale */
  .hero-title {
    font-size: 1.5rem !important; /* ~24px for clean 3-line wrap */
    line-height: 1.35 !important;
    text-align: center !important;
    margin-top: 1rem !important;
  }

  .hero-subhead,
  .hero-subtitle {
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
    text-align: center !important;
    padding: 0 8px !important;
  }

  .hero-content {
    align-items: center !important; /* Centered structure on mobile */
  }

  /* Hero credibility items — centered vertical stack on mobile */
  .hero-credibility,
  .credibility-bar {
    align-items: center !important; /* Center stack on mobile */
  }

  .credibility-item,
  .hero-stats .stat-item {
    font-size: 0.88rem !important;
    padding: 6px 14px 6px 10px !important;
    padding-inline-start: 12px !important;
    padding-inline-end: 14px !important;
  }
}

/* Smooth language switch opacity dip */
body {
  transition: opacity 0.15s ease;
}
html.lang-switching body {
  opacity: 0.4;
}
