/* Qimma brand Arabic typeface (LBC) */
@font-face {
  font-family: 'Qimma Arabic';
  src: url('assets/lbc-regular.otf') format('opentype');
  font-weight: 100 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Qimma Arabic';
  src: url('assets/lbc-bold.ttf') format('truetype');
  font-weight: 600 900;
  font-style: normal;
  font-display: swap;
}

/* ============================================================
   Qimma HR — global stylesheet
   Brand primary: #21776A (deep teal)
   Modern SaaS feel; bilingual EN / AR (RTL).
   ============================================================ */

:root {
  /* Brand */
  --qm-green-900: #13473F;
  --qm-green-800: #144A43;
  --qm-green-700: #1B5C53;
  --qm-green-600: #21776A;   /* primary */
  --qm-green-500: #2D9181;
  --qm-green-400: #4FB1A1;
  --qm-green-300: #8DD3C7;
  --qm-green-200: #C7EAE3;
  --qm-green-100: #E6F4F0;
  --qm-green-50:  #F2FAF7;

  /* Neutrals (warm, slightly green tinted to harmonize) */
  --qm-ink-900: #0B1A18;
  --qm-ink-800: #14201E;
  --qm-ink-700: #2A3633;
  --qm-ink-600: #4A5754;
  --qm-ink-500: #6B7572;
  --qm-ink-400: #95A09C;
  --qm-ink-300: #C4CCC9;
  --qm-ink-200: #E2E7E5;
  --qm-ink-100: #F1F4F2;
  --qm-ink-50:  #F8FAF9;
  --qm-white:   #FFFFFF;

  /* Accents */
  --qm-amber: #E89A3C;     /* Civil ID expiry / warning warmth */
  --qm-coral: #E86A4D;     /* highlight */
  --qm-sand:  #F5EDE0;     /* warm panel */
  --qm-cream: #FBF7F0;     /* hero alt bg */

  /* Type */
  --font-en: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-ar: 'Noto Naskh Arabic', 'Segoe UI', Tahoma, 'Arial', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  /* Radius / shadow */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 32px;
  --shadow-sm: 0 1px 2px rgba(11,26,24,0.05), 0 1px 1px rgba(11,26,24,0.04);
  --shadow-md: 0 8px 24px -8px rgba(11,26,24,0.12), 0 2px 6px rgba(11,26,24,0.05);
  --shadow-lg: 0 24px 60px -20px rgba(15,63,57,0.25), 0 6px 18px rgba(11,26,24,0.06);
  --shadow-xl: 0 40px 100px -30px rgba(15,63,57,0.35);

  /* Layout */
  --max-w: 1200px;
  --gutter: clamp(20px, 4vw, 40px);
  --header-h: 72px;
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-en);
  font-size: 17px;
  line-height: 1.55;
  color: var(--qm-ink-800);
  background: var(--qm-white);
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }

/* ========== Type scale ========== */
.h-eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--qm-green-600);
}

h1, .h1 {
  font-family: var(--font-en);
  font-size: clamp(36px, 4.4vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin: 0 0 24px;
  color: var(--qm-ink-900);
  text-wrap: balance;
}

h2, .h2 {
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin: 0 0 20px;
  color: var(--qm-ink-900);
  text-wrap: balance;
}

h3, .h3 {
  font-size: clamp(20px, 1.9vw, 23px);
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 650;
  margin: 0 0 12px;
  color: var(--qm-ink-900);
}

h4, .h4 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 0 0 8px;
  color: var(--qm-ink-900);
}

.lead {
  font-size: clamp(16px, 1.25vw, 18px);
  line-height: 1.55;
  color: var(--qm-ink-600);
  max-width: 60ch;
  text-wrap: pretty;
}

.mono { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }

/* ========== Layout helpers ========== */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gutter); }
.container-wide { max-width: 1320px; margin: 0 auto; padding: 0 var(--gutter); }

section { padding: clamp(48px, 6vw, 88px) 0; }
section.tight { padding: clamp(32px, 4vw, 60px) 0; }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 900px) {
  .grid-3, .grid-4, .grid-6 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .grid-3, .grid-4, .grid-6 { grid-template-columns: 1fr; }
}

.flex { display: flex; }
.stack { display: flex; flex-direction: column; }
.center { align-items: center; justify-content: center; }
.between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }
.gap-48 { gap: 48px; }

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.005em;
  transition: all 0.2s ease;
  white-space: nowrap;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--qm-green-600);
  color: var(--qm-white);
}
.btn-primary:hover {
  background: var(--qm-green-700);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-secondary {
  background: var(--qm-white);
  color: var(--qm-ink-900);
  border-color: var(--qm-ink-200);
}
.btn-secondary:hover {
  border-color: var(--qm-green-900);
  background: var(--qm-green-900);
  color: var(--qm-white);
}
.btn-ghost {
  background: transparent;
  color: var(--qm-ink-900);
}
.btn-ghost:hover { background: var(--qm-ink-100); }
.btn-lg { padding: 14px 26px; font-size: 15px; }
.btn-sm { padding: 10px 18px; font-size: 14px; }
.btn .arrow { transition: transform 0.2s; }
.btn:hover .arrow { transform: translateX(3px); }

/* ========== Header ========== */
.qm-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid rgba(11,26,24,0.06);
}
.qm-header-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 32px;
}
.qm-logo { display: flex; align-items: center; gap: 10px; }
.qm-logo img { height: 28px; width: auto; }
.qm-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.qm-nav-item {
  position: relative;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--qm-ink-700);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.qm-nav-item:hover { background: var(--qm-ink-100); color: var(--qm-ink-900); }
.qm-nav-item .chev { transition: transform 0.2s; opacity: 0.6; }
.qm-nav-item:hover .chev, .qm-nav-item.open .chev { transform: rotate(180deg); }

.qm-mega {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--qm-white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--qm-ink-200);
  padding: 24px;
  min-width: 480px;
  display: none;
  z-index: 100;
}
.qm-nav-item.has-mega::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 14px;
}
.qm-nav-item:hover .qm-mega, .qm-nav-item.open .qm-mega { display: block; }
.qm-mega-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.qm-mega-link {
  padding: 10px 12px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.qm-mega-link:hover { background: var(--qm-green-50); }
.qm-mega-link strong { font-size: 14px; font-weight: 600; color: var(--qm-ink-900); }
.qm-mega-link span { font-size: 12.5px; color: var(--qm-ink-500); }

.qm-header-cta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qm-mobile-toggle { display: none; padding: 10px; margin: -10px -10px -10px 0; border-radius: 10px; color: var(--qm-ink-900); }
.qm-mobile-toggle:active { background: var(--qm-ink-100); }
@media (max-width: 980px) {
  .qm-nav, .qm-header-cta .btn { display: none; }
  .qm-mobile-toggle { display: inline-flex; }
  .qm-header-inner { justify-content: space-between; gap: 14px; }
}

/* ========== Footer ========== */
.qm-footer {
  background: var(--qm-green-900);
  color: var(--qm-ink-300);
  padding: 80px 0 40px;
}
.qm-footer h5 {
  color: var(--qm-white);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 18px;
}
.qm-footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.qm-footer-links a { color: var(--qm-ink-300); font-size: 14px; transition: color 0.15s; }
.qm-footer-links a:hover { color: var(--qm-white); }
.qm-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 60px;
}
@media (max-width: 900px) {
  .qm-footer-grid { grid-template-columns: 1fr 1fr; }
}
.qm-footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--qm-ink-400);
}
.qm-footer-bottom a:hover { color: var(--qm-white); }
.qm-footer-tagline { font-size: 14px; line-height: 1.6; max-width: 32ch; color: var(--qm-ink-400); margin: 12px 0 24px; }
.qm-footer-social { display: flex; gap: 10px; }
.qm-footer-social a {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12);
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.qm-footer-social a:hover { background: var(--qm-green-600); border-color: var(--qm-green-600); }

/* ========== Reusable cards ========== */
.qm-card {
  background: var(--qm-white);
  border: 1px solid var(--qm-ink-200);
  border-radius: var(--r-lg);
  padding: 28px;
  transition: all 0.2s ease;
}
.qm-card:hover {
  border-color: var(--qm-green-300);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.qm-card .icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--qm-green-100);
  color: var(--qm-green-600);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}

.qm-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--qm-green-100);
  color: var(--qm-green-700);
  font-size: 13px;
  font-weight: 600;
}
.qm-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ========== Hero ========== */
.qm-hero {
  position: relative;
  padding: clamp(60px, 8vw, 110px) 0 clamp(60px, 6vw, 80px);
  overflow: hidden;
}
.qm-hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 90% 0%, var(--qm-green-100) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 0% 100%, var(--qm-green-50) 0%, transparent 60%),
    var(--qm-white);
  z-index: -1;
}
.qm-hero h1 .accent {
  background: linear-gradient(110deg, var(--qm-green-600) 30%, var(--qm-green-400) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ========== Product preview frame ========== */
.qm-app-frame {
  background: linear-gradient(180deg, var(--qm-white), var(--qm-ink-50));
  border: 1px solid var(--qm-ink-200);
  border-radius: 30px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  position: relative;
}
.qm-app-chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--qm-ink-100);
  border-bottom: 1px solid var(--qm-ink-200);
}
.qm-app-chrome .dots { display: flex; gap: 6px; }
.qm-app-chrome .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--qm-ink-300); }
.qm-app-chrome .url {
  flex: 1; text-align: center; font-size: 12px; color: var(--qm-ink-500);
  font-family: var(--font-mono);
}

/* ========== Industry chip strip ========== */
.qm-industry-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  border: 1px solid var(--qm-ink-200);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--qm-ink-700);
  background: var(--qm-white);
  transition: all 0.2s;
}
.qm-industry-chip:hover {
  border-color: var(--qm-green-600);
  color: var(--qm-green-700);
  background: var(--qm-green-50);
}

/* ========== Big CTA banner ========== */
.qm-cta-banner {
  background:
    radial-gradient(ellipse 80% 80% at 80% 20%, rgba(143,211,199,0.2) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 10% 90%, rgba(45,145,129,0.25) 0%, transparent 60%),
    var(--qm-green-900);
  color: var(--qm-white);
  border-radius: var(--r-xl);
  padding: clamp(28px, 3.5vw, 44px) clamp(28px, 4vw, 56px);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px 40px;
  flex-wrap: wrap;
}
.qm-cta-banner h2 { color: var(--qm-white); font-size: clamp(21px, 2.3vw, 30px); margin: 0; }
.qm-cta-banner .lead { color: rgba(255,255,255,0.75); font-size: 15px; margin: 8px 0 0; }
.qm-cta-copy { max-width: 640px; }
.qm-cta-banner .btn-lg { padding: 13px 24px; font-size: 14.5px; }

/* ========== Stats row ========== */
.qm-stat .num {
  font-size: clamp(30px, 3vw, 42px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--qm-green-600);
  line-height: 1;
  margin-bottom: 10px;
}
.qm-stat .lbl { font-size: 14px; color: var(--qm-ink-600); max-width: 22ch; }

/* ========== Tab nav (product pages) ========== */
.qm-tabs { display: flex; gap: 8px; flex-wrap: wrap; border-bottom: 1px solid var(--qm-ink-200); padding-bottom: 0; }
.qm-tab {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--qm-ink-500);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.qm-tab.active { color: var(--qm-green-600); border-color: var(--qm-green-600); }
.qm-tab:hover { color: var(--qm-ink-900); }

/* ========== Pricing ========== */
.qm-price-card {
  background: var(--qm-white);
  border: 1px solid var(--qm-ink-200);
  border-radius: var(--r-lg);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
}
.qm-price-card.featured {
  background: var(--qm-green-900);
  color: var(--qm-white);
  border-color: var(--qm-green-900);
  transform: scale(1.04);
  z-index: 2;
}
.qm-price-card.featured h3, .qm-price-card.featured .price { color: var(--qm-white); }
.qm-price-card .price {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--qm-ink-900);
  line-height: 1;
}
.qm-price-card .price small { font-size: 16px; font-weight: 500; color: var(--qm-ink-500); }
.qm-price-card.featured .price small { color: rgba(255,255,255,0.6); }
.qm-price-features { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; font-size: 14.5px; }
.qm-price-features li { display: flex; gap: 10px; align-items: flex-start; }
.qm-price-features svg { flex: 0 0 18px; margin-top: 3px; color: var(--qm-green-600); }
.qm-price-card.featured .qm-price-features svg { color: var(--qm-green-300); }
.qm-price-card.featured .badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--qm-green-400); color: var(--qm-ink-900);
  padding: 5px 14px; border-radius: 999px; font-size: 12px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
}

/* ========== Forms ========== */
.qm-input, .qm-textarea, .qm-select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--qm-ink-200);
  border-radius: var(--r-sm);
  font-size: 15px;
  background: var(--qm-white);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.qm-input:focus, .qm-textarea:focus, .qm-select:focus {
  outline: 0;
  border-color: var(--qm-green-600);
  box-shadow: 0 0 0 3px var(--qm-green-100);
}
.qm-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--qm-ink-700);
  margin-bottom: 6px;
}

/* ========== Image placeholders (for screenshots user will swap in Webflow) ========== */
.qm-screenshot {
  background:
    repeating-linear-gradient(
      135deg,
      var(--qm-green-50) 0 12px,
      var(--qm-green-100) 12px 24px
    );
  border-radius: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--qm-green-700);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 24px;
  min-height: 240px;
  border: 1px dashed var(--qm-green-300);
}

/* ========== Misc utilities ========== */
.text-muted { color: var(--qm-ink-500); }
.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; } .mt-48 { margin-top: 48px; } .mt-64 { margin-top: 64px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; } .mb-48 { margin-bottom: 48px; }
.max-60 { max-width: 60ch; }
.max-50 { max-width: 50ch; }


/* Print/Webflow-friendly: avoid pseudo-element decorations that don't translate */

/* Mobile menu — full-height sheet anchored under the sticky header.
   (absolute, not fixed: the header's backdrop-filter makes the header
   the containing block for fixed descendants, which collapsed the old
   menu into a zero-height scrolling strip.) */
.qm-mobile-menu { display: none; }
html.qm-menu-open { overflow: hidden; }
@media (max-width: 980px) {
  .qm-mobile-menu {
    position: absolute;
    top: 100%; left: 0; right: 0;
    height: calc(100vh - var(--header-h));
    height: calc(100dvh - var(--header-h));
    background: var(--qm-white);
    display: flex;
    flex-direction: column;
    padding: 4px 20px calc(18px + env(safe-area-inset-bottom));
    overflow-y: auto;
    border-top: 1px solid var(--qm-ink-100);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
  }
  .qm-mobile-menu.open { opacity: 1; visibility: visible; transform: none; }
}
.qm-mm-label { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--qm-ink-400); padding: 20px 2px 4px; }
.qm-mm-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 2px; min-height: 48px; border-bottom: 1px solid var(--qm-ink-100); color: var(--qm-ink-900); }
.qm-mm-item > svg { color: var(--qm-ink-300); flex-shrink: 0; }
.qm-mm-txt { display: flex; flex-direction: column; gap: 1px; }
.qm-mm-txt strong { font-size: 16.5px; font-weight: 600; letter-spacing: -0.01em; }
.qm-mm-txt small { font-size: 12.5px; color: var(--qm-ink-500); }
.qm-mm-actions { margin-top: auto; padding-top: 24px; display: flex; flex-direction: column; gap: 10px; }
.qm-mm-actions .btn { width: 100%; justify-content: center; padding: 16px 24px; font-size: 16px; }

/* ============================================================
   RESPONSIVE / MOBILE PASS
   ============================================================ */

/* Never allow the page itself to scroll sideways (clip keeps the
   sticky header working, unlike overflow:hidden). */
html, body { overflow-x: clip; }

/* Desktop-composed dashboard mockups vs. mobile-designed variants.
   Dense desktop mockups (.only-d) are replaced below 880px by
   phone-designed equivalents (.only-m) — never shrunk or scrolled. */
@media (max-width: 880px) { .only-d { display: none !important; } }
@media (min-width: 880.02px) { .only-m { display: none !important; } }

@media (max-width: 880px) {
  /* Recruiting kanban: 4 stage columns become a 2×2 grid */
  .qm-kanban { grid-template-columns: 1fr 1fr !important; }
}

/* Phone-scale layout, typography and components. */
@media (max-width: 560px) {
  :root { --header-h: 64px; }

  /* Marketing headlines: clamp()'s floor is still too big at 360–390 */
  h1, .h1 { font-size: 34px; }
  h2, .h2 { font-size: 27px; }
  .lead { font-size: 16px; }

  /* Primary actions read as full-width bars on phones */
  .qm-hero .btn-lg, .qm-cta-banner .btn-lg { width: 100%; justify-content: center; }

  /* Stat bands: 2×2 instead of a tall single column */
  .grid-4:has(.qm-stat) { grid-template-columns: 1fr 1fr; gap: 30px 18px; }
  .qm-stat .num { font-size: 34px; }
  .qm-stat .lbl { font-size: 13px; }

  /* Grids that should stay two-up on phones (logo tiles etc.) */
  .grid-3.keep-2col, .grid-4.keep-2col { grid-template-columns: 1fr 1fr; }

  /* Footer: brand block spans full width above the link columns */
  .qm-footer { padding: 56px 0 32px; }
  .qm-footer-grid { gap: 36px 24px; margin-bottom: 44px; }
  .qm-footer-grid > div:first-child { grid-column: 1 / -1; }

  /* Browser-chrome URL never forces width */
  .qm-app-chrome .url { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* Payroll runs table: drop the headcount column on phones */
  .qm-run-row { grid-template-columns: 1.2fr 1.3fr 0.8fr !important; }
  .qm-run-row > :nth-child(2) { display: none; }

  /* Attendance: 5 KPI tiles wrap 3+2; shift table drops duration col */
  .qm-stats5 { grid-template-columns: repeat(3, 1fr) !important; }
  .qm-shift-row { grid-template-columns: 1.3fr 1.6fr 1.6fr !important; }
  .qm-shift-row > :nth-child(2) { display: none; }

  /* Never scale-transform cards on phones */
  .qm-price-card.featured { transform: none; }
}

/* Phone-scale spacing + tap targets. */
@media (max-width: 560px) {
  section { padding: 56px 0; }
  section.tight { padding: 36px 0; }
  .qm-cta-banner { padding: 26px 22px; }
  .btn-lg { padding: 13px 22px; font-size: 14.5px; }
  .qm-card { padding: 24px; }
  /* Bilingual payslip preview (home): stack the two payslips */
  .qm-pay-mocks { grid-template-columns: 1fr !important; padding: 26px !important; }
}

@media (max-width: 400px) {
  .qm-logo img { height: 24px; }
}

/* Payroll hero table: drop the Total Salary column when the frame narrows (880-1200 band) */
@media (max-width: 1200px) {
  .qm-prw { grid-template-columns: minmax(0,1.5fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1.05fr) !important; }
  .qm-prw > :nth-child(2) { display: none; }
}


/* Homepage hero only: Comfortable (2b) scale — rest of site is Compact (2c) */
section.qm-hero-home { padding: clamp(52px, 7vw, 100px) 0; }
.qm-hero-home h1 { font-size: clamp(38px, 5vw, 64px); }
.qm-hero-home .lead { font-size: clamp(17px, 1.3vw, 19px); }
.qm-hero-home .btn-lg { padding: 16px 28px; font-size: 15.5px; }
@media (max-width: 880px) {
  .qm-hero-home h1 { font-size: 35px; }
  .qm-hero-home .lead { font-size: 16.5px; }
}

/* Product-page hero: deepened green gradient (light theme) */
.qm-hero-green .qm-hero-bg {
  background:
    linear-gradient(180deg, rgba(255,255,255,0) 55%, #FFFFFF 96%),
    radial-gradient(ellipse 70% 65% at 90% 0%, rgba(33,119,106,0.5) 0%, transparent 65%),
    radial-gradient(ellipse 58% 55% at 0% 100%, rgba(143,211,199,0.7) 0%, transparent 65%),
    linear-gradient(180deg, #C3DFD4 0%, #E3F0EA 100%);
}

/* ===== Homepage: phone-only section treatments (<=560px) ===== */
@media (max-width: 560px) {
  /* Industries: dense tag cloud instead of sparse ovals */
  #industries .flex { gap: 8px; }
  #industries .qm-industry-chip { padding: 8px 14px; font-size: 12.5px; }

  /* Why Qimma: cards become compact icon rows */
  #why-qimma .grid.gap-16 { display: flex; flex-direction: column; gap: 0; }
  #why-qimma .qm-card { background: none; border: none; border-radius: 0; box-shadow: none; padding: 16px 0; display: grid; grid-template-columns: 42px 1fr; column-gap: 14px; border-bottom: 1px solid var(--qm-ink-200); }
  #why-qimma .qm-card:first-child { padding-top: 4px; }
  #why-qimma .qm-card:last-child { border-bottom: none; padding-bottom: 4px; }
  #why-qimma .qm-card:hover { transform: none; box-shadow: none; border-color: var(--qm-ink-200); }
  #why-qimma .qm-card .icon { width: 32px; height: 32px; border-radius: 9px; margin: 0; grid-row: 1 / span 2; }
  #why-qimma .qm-card .icon svg { width: 16px; height: 16px; }
  #why-qimma .qm-card h4 { margin: 0 0 3px; font-size: 15.5px; }
  #why-qimma .qm-card p { font-size: 13.5px !important; }

  /* Personas: numbered divider list instead of big boxes */
  #personas .grid-3 { display: flex; flex-direction: column; gap: 0; }
  #personas .grid-3 > div { background: none !important; border: none !important; border-radius: 0 !important; padding: 15px 0 !important; display: grid !important; grid-template-columns: 44px 1fr; align-items: baseline; border-bottom: 1px solid rgba(255,255,255,0.14) !important; }
  #personas .grid-3 > div:last-child { border-bottom: none !important; }
  #personas .grid-3 > div .mono { grid-row: 1 / span 2; font-size: 13px; }
  #personas .grid-3 > div h4 { margin: 0 0 3px !important; font-size: 15.5px; }
  #personas .grid-3 > div p { font-size: 13.5px !important; margin: 0 !important; }

  /* Integrations: logo tiles become a chip cloud */
  #integrations .keep-2col { display: flex; flex-wrap: wrap; gap: 8px; }
  #integrations .keep-2col > div { height: auto !important; padding: 9px 15px !important; border-radius: 999px !important; font-size: 12.5px !important; }
}

/* ===== Phone-only: card grids collapse to compact icon rows ===== */
@media (max-width: 560px) {
  .qm-industry-chip { padding: 8px 14px; font-size: 12.5px; }

  .grid.m-rows { display: flex; flex-direction: column; gap: 0; }
  .m-rows > .qm-card { background: none; border: none; border-radius: 0; box-shadow: none; padding: 15px 0 !important; display: grid; grid-template-columns: 42px 1fr; column-gap: 14px; border-bottom: 1px solid var(--qm-ink-200); }
  .m-rows > .qm-card:first-child { padding-top: 4px !important; }
  .m-rows > .qm-card:last-child { border-bottom: none; padding-bottom: 4px !important; }
  .m-rows > .qm-card:hover { transform: none; box-shadow: none; border-color: var(--qm-ink-200); }
  .m-rows > .qm-card .icon { width: 32px !important; height: 32px !important; border-radius: 9px !important; margin: 0 !important; grid-row: 1 / span 6; }
  .m-rows > .qm-card .icon svg { width: 16px; height: 16px; }
  .m-rows > .qm-card > :not(.icon) { grid-column: 2; }
  .m-rows > .qm-card h4 { margin: 0 0 3px; font-size: 15.5px; }
  .m-rows > .qm-card p { font-size: 13.5px !important; margin: 0 0 6px !important; }

  /* Dark feature boxes collapse to a divider list */
  .grid.m-dark-rows { display: flex; flex-direction: column; gap: 0; }
  .m-dark-rows > div { background: none !important; border: none !important; border-radius: 0 !important; padding: 13px 0 !important; border-bottom: 1px solid rgba(255,255,255,0.14) !important; }
  .m-dark-rows > div:last-child { border-bottom: none !important; }
}

/* ===== Phone-only: light phone frames + pay-row wrapping ===== */
@media (max-width: 560px) {
  /* Phone mockups: no bezel at all — just the screen with a hairline edge */
  [style*="background:#0B0B0C;border-radius:30px"] { background: none !important; border: none; padding: 0 !important; box-shadow: none !important; }
  [style*="background:#0B0B0C;border-radius:30px"] > div { border: 1px solid var(--qm-ink-200); box-shadow: var(--shadow-lg); }
  /* Pay-step method rows: wrap instead of crushing the label */
  .m-payrow { flex-wrap: wrap; }
  .m-payrow > div:nth-child(2) { flex: 1 1 calc(100% - 52px) !important; }
  .m-payrow > div:nth-child(3) { text-align: left !important; margin-left: 52px; }
  .m-payrow > div:nth-child(4) { margin-left: auto; }
}

/* Stacked (phone/tablet): text column before the product image */
@media (max-width: 900px) {
  .m-text-first > :first-child { order: 2; }
}

/* Phone: overtime rate cards compact */
@media (max-width: 560px) {
  .m-ot { gap: 10px !important; }
  .m-ot > div { padding: 16px !important; border-radius: 14px !important; }
  .m-ot div[style*="font-size:48px"] { font-size: 28px !important; }
  .m-ot div[style*="font-size:48px"] span { font-size: 15px !important; }
  .m-ot > div > div[style*="font-size:13px"] { font-size: 12px !important; }
}

/* ============================================================
   BILINGUAL — LANGUAGE SWITCHER + ARABIC (RTL)
   ============================================================ */

/* ----- Language switcher pill (injected into the header) ----- */
.qm-lang {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--qm-ink-200);
  border-radius: 999px;
  background: var(--qm-white);
  flex-shrink: 0;
}
.qm-lang button {
  min-width: 32px;
  height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  color: var(--qm-ink-500);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease, color .15s ease;
}
.qm-lang button[data-lang-btn="ar"] { font-size: 16px; font-family: var(--font-ar); }
.qm-lang button.is-active { background: var(--qm-green-600); color: #fff; }
.qm-lang button:not(.is-active):hover { color: var(--qm-ink-900); background: var(--qm-ink-100); }
@media (max-width: 400px) {
  .qm-lang button { min-width: 28px; padding: 0 7px; }
}

/* ----- Arabic type system -----
   Redefining --font-en under RTL cascades to the many inline
   font-family:var(--font-en) usages inside the product mockups,
   so the whole UI reflows in Arabic type with no per-node edits. */
html[dir="rtl"] { --font-en: var(--font-ar); }
html[dir="rtl"] body { font-family: var(--font-ar); }

/* Negative tracking / letter-spacing break Arabic letter-joining */
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3, html[dir="rtl"] h4,
html[dir="rtl"] .h1, html[dir="rtl"] .h2, html[dir="rtl"] .h3, html[dir="rtl"] .h4,
html[dir="rtl"] .btn, html[dir="rtl"] .h-eyebrow, html[dir="rtl"] .mono { letter-spacing: 0; }
html[dir="rtl"] h1, html[dir="rtl"] .h1 { line-height: 1.16; }
html[dir="rtl"] h2, html[dir="rtl"] .h2 { line-height: 1.22; }
html[dir="rtl"] .lead { line-height: 1.7; }
/* Eyebrows + the mega label carry Arabic text → use the Arabic face */
html[dir="rtl"] .h-eyebrow,
html[dir="rtl"] .qm-mega .mono { font-family: var(--font-ar); }
html[dir="rtl"] .qm-mega .mono { text-transform: none; }

/* ----- Directional fixes ----- */
/* Mega-menu docks to the start (right) edge */
html[dir="rtl"] .qm-mega { left: auto; right: 0; }
/* Forward arrows / chevrons point the other way */
html[dir="rtl"] .btn .arrow,
html[dir="rtl"] .qm-mm-item > svg { transform: scaleX(-1); }
html[dir="rtl"] .btn:hover .arrow { transform: scaleX(-1) translateX(3px); }

/* Hero glow mirrored to the opposite corner */
html[dir="rtl"] .qm-hero-bg {
  background:
    radial-gradient(ellipse 60% 50% at 10% 0%, var(--qm-green-100) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 100% 100%, var(--qm-green-50) 0%, transparent 60%),
    var(--qm-white);
}
html[dir="rtl"] .qm-hero-green .qm-hero-bg {
  background:
    linear-gradient(180deg, rgba(255,255,255,0) 55%, #FFFFFF 96%),
    radial-gradient(ellipse 70% 65% at 10% 0%, rgba(33,119,106,0.5) 0%, transparent 65%),
    radial-gradient(ellipse 58% 55% at 100% 100%, rgba(143,211,199,0.7) 0%, transparent 65%),
    linear-gradient(180deg, #C3DFD4 0%, #E3F0EA 100%);
}
/* Big CTA banner glow mirror */
html[dir="rtl"] .qm-cta-banner {
  background:
    radial-gradient(ellipse 80% 80% at 20% 20%, rgba(143,211,199,0.2) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 90% 90%, rgba(45,145,129,0.25) 0%, transparent 60%),
    var(--qm-green-900);
}

/* Inline-styled mockups: flip the panel divider borders that don't
   auto-mirror (grid/flex order already mirrors from dir=rtl). */
html[dir="rtl"] [style*="border-right:1px solid #eeece9"] {
  border-right: 0 !important;
  border-left: 1px solid #eeece9;
}
html[dir="rtl"] [style*="border-left:1px solid #eeece9"] {
  border-left: 0 !important;
  border-right: 1px solid #eeece9;
}
/* Phone-only payroll method row: mirror the physical offsets */
@media (max-width: 560px) {
  html[dir="rtl"] .m-payrow > div:nth-child(3) { text-align: right !important; margin-left: 0; margin-right: 52px; }
  html[dir="rtl"] .m-payrow > div:nth-child(4) { margin-left: 0; margin-right: auto; }
}

/* --- fixes --- */
a[href^="tel:"]{unicode-bidi:isolate;direction:ltr;display:inline-block;}
.text-center .lead{margin-inline:auto;}
