/* ========================================
   BAASI DESIGN SYSTEM
   Primary: #033769 | Secondary: #FF8B00
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;1,300&family=Tajawal:wght@300;400;500;700;800&display=swap');

:root {
  --primary: #033769;
  --primary-light: #0a4d8f;
  --primary-dark: #021f3d;
  --secondary: #FF8B00;
  --secondary-light: #ffab40;
  --secondary-dark: #cc6f00;
  --white: #ffffff;
  --off-white: #f8f9fe;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --glass: rgba(255,255,255,0.07);
  --glass-border: rgba(255,255,255,0.15);
  --surface: rgba(3,55,105,0.04);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --shadow: 0 20px 60px rgba(3,55,105,0.15);
  --shadow-orange: 0 10px 40px rgba(255,139,0,0.3);
  --transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
}

[lang="ar"], .lang-ar {
  font-family: 'Tajawal', sans-serif;
  direction: rtl;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: var(--off-white);
  overflow-x: hidden;
  line-height: 1.6;
}

body.lang-ar {
  font-family: 'Tajawal', sans-serif;
  direction: rtl;
}

/* ---- NAVBAR ---- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 0 5%;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #033769;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: var(--transition);
}

.navbar.scrolled {
  box-shadow: 0 4px 30px rgba(0,0,0,0.25);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.nav-logo img {
  height: 38px;
}

.nav-logo span {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: #fff;
  letter-spacing: -0.5px;
}

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

.nav-links a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-links a:hover, .nav-links a.active {
  color: #fff;
  background: rgba(255,139,0,0.2);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-toggle {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 4px;
  gap: 2px;
}

.lang-btn {
  padding: 5px 12px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.7);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 16px;
  transition: var(--transition);
  font-family: inherit;
}

.lang-btn.active {
  background: var(--secondary);
  color: #fff;
}

.nav-cta {
  background: var(--secondary);
  color: #fff !important;
  border-radius: 10px !important;
  padding: 9px 20px !important;
  font-weight: 600 !important;
  box-shadow: var(--shadow-orange);
}

.nav-cta:hover {
  background: var(--secondary-light) !important;
  transform: translateY(-1px);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 12px;
  min-width: 48px;
  min-height: 48px;
  justify-content: center;
  align-items: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: var(--transition);
}

/* ---- SECTION COMMON ---- */
section {
  padding: 100px 5%;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,139,0,0.12);
  color: var(--secondary-dark);
  border: 1px solid rgba(255,139,0,0.25);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.section-title {
  font-family: 'Sora', sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -1px;
}

.section-title .highlight {
  color: var(--secondary);
  position: relative;
  display: inline-block;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 580px;
  line-height: 1.7;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 30px rgba(3,55,105,0.35);
}

.btn-primary:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(3,55,105,0.4);
}

.btn-secondary {
  background: var(--secondary);
  color: #fff;
  box-shadow: var(--shadow-orange);
}

.btn-secondary:hover {
  background: var(--secondary-light);
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(255,139,0,0.4);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
}

/* ════════════════════════════════════════════════════
   STORE BADGES
   Works with real images AND styled text fallbacks.
════════════════════════════════════════════════════ */
.store-badges { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.store-badges-center { justify-content:center; }

.badge-link {
  display: inline-block;
  text-decoration: none;
  border-radius: 11px;
  overflow: hidden;
  flex-shrink: 0;
  line-height: 0;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.badge-link:hover { transform:translateY(-2px); box-shadow:0 8px 22px rgba(0,0,0,0.22); }

/* Image */
.badge-img {
  display: block;
  height: 46px;
  width: auto;
  max-width: 152px;
  min-width: 110px;
  object-fit: contain;
  border-radius: 11px;
}
/* badge-img-light: no inversion — official store badges look correct on dark backgrounds as-is */
.badge-img-light { opacity:0.95; background:transparent; }
.store-badges-light .badge-link:hover .badge-img-light { opacity:1; }

/* Fallback — hidden until onerror fires */
.badge-fallback {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  height: 46px;
  min-width: 140px;
  max-width: 160px;
  background: #1a1a2e;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 11px;
  color: #fff;
  font-family: inherit;
  line-height: 1;
  white-space: nowrap;
}
.badge-fallback-light {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.25);
}
.badge-link:hover .badge-fallback       { background:#2a2a40; }
.badge-link:hover .badge-fallback-light { background:rgba(255,255,255,0.2); }

.badge-fb-icon { display:flex; align-items:center; flex-shrink:0; opacity:0.9; }
.badge-fb-en, .badge-fb-ar { display:flex; flex-direction:column; line-height:1.25; }
.badge-fb-en small, .badge-fb-ar small { font-size:0.6rem; opacity:0.65; font-weight:400; }
.badge-fb-en strong, .badge-fb-ar strong { font-size:0.9rem; font-weight:700; }

/* RTL */
body.lang-ar .store-badges    { direction:rtl; flex-direction:row; }
body.lang-ar .badge-fb-en     { display:none !important; }
body.lang-ar .badge-fb-ar     { display:flex !important; direction:rtl; }
/* The official App Store / Google Play / AppGallery badges stay in English on
   the Arabic site — that is what the store guidelines show and what users
   recognise. store_badges.php will pick up images/stores/<name>_ar.png
   automatically if Arabic artwork is ever dropped in; until then the English
   badge is shown in both languages. */
body.lang-ar .badge-fallback          { flex-direction:row; }

/* Mobile */
@media (max-width:480px) {
  .badge-img { height:40px; max-width:136px; min-width:100px; }
  .badge-fallback { height:40px; min-width:120px; padding:0 10px; gap:7px; }
  .badge-fb-en strong, .badge-fb-ar strong { font-size:0.82rem; }
  .store-badges { gap:8px; }
}



/* ---- CARD ---- */
.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: 0 4px 24px rgba(3,55,105,0.08);
  border: 1px solid rgba(3,55,105,0.06);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(3,55,105,0.15);
}

/* ---- FOOTER ---- */
.footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.8);
  padding: 70px 5% 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 50px;
}

.footer-brand .nav-logo img { height: 36px; }
.footer-brand p {
  margin-top: 16px;
  font-size: 0.9rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.6);
  max-width: 280px;
}

.footer-col h4 {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col ul a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 0.88rem;
  transition: var(--transition);
}

.footer-col ul a:hover {
  color: var(--secondary);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-bottom p {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.4);
}

.social-links {
  display: flex;
  gap: 10px;
}

.social-link {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: rgba(255,255,255,0.7);
  transition: var(--transition);
  flex-shrink: 0;
}

.social-link svg {
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
}

.social-link:hover {
  background: var(--secondary);
  border-color: var(--secondary);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(255,139,0,0.35);
}

/* Instagram gradient on hover */
.social-link[aria-label="Instagram"]:hover {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(220,39,67,0.4);
}

/* X / Twitter on hover */
.social-link[aria-label="X (Twitter)"]:hover {
  background: #000;
  border-color: #000;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

/* TikTok on hover */
.social-link[aria-label="TikTok"]:hover {
  background: #010101;
  border-color: #010101;
  box-shadow: 0 8px 20px rgba(1,1,1,0.5);
}

/* LinkedIn on hover */
.social-link[aria-label="LinkedIn"]:hover {
  background: #0a66c2;
  border-color: #0a66c2;
  box-shadow: 0 8px 20px rgba(10,102,194,0.4);
}

/* Footer legal links */
.footer-legal-links {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
}

.footer-legal-links a {
  color: rgba(255,255,255,0.4);
  text-decoration: none;
  transition: var(--transition);
}

.footer-legal-links a:hover {
  color: var(--secondary);
}

.footer-legal-links span {
  color: rgba(255,255,255,0.2);
}

/* ---- MOBILE NAV ---- */
.mobile-menu {
  position: fixed;
  top: 72px; left: 0; right: 0;
  background: var(--primary-dark);
  padding: 8px 5% 16px;
  flex-direction: column;
  gap: 2px;
  z-index: 999;
  border-bottom: 2px solid rgba(255,255,255,0.12);
  display: flex;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
  pointer-events: none;
}
.mobile-menu.open {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: auto;
}
.mobile-menu a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  padding: 13px 16px;
  border-radius: 10px;
  font-size: 0.95rem;
  min-height: 48px;
  display: flex;
  align-items: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.mobile-menu a:active {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

/* ---- UTILITIES ---- */
.text-center { text-align: center; }
.text-center .section-subtitle { margin: 0 auto; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

/* ---- ANIMATIONS ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,139,0,0); }
  50% { box-shadow: 0 0 0 12px rgba(255,139,0,0.15); }
}

.fade-up { animation: fadeUp 0.7s ease forwards; opacity: 1; }
.fade-up-1 { animation-delay: 0.1s; }
.fade-up-2 { animation-delay: 0.2s; }
.fade-up-3 { animation-delay: 0.3s; }
.fade-up-4 { animation-delay: 0.4s; }

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  section { padding: 70px 5%; }
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .nav-cta { display: none; }
}

@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
  .section-title { font-size: 1.8rem; }
}

/* ════════════════════════════════════════════════════════
   ARABIC (RTL) — Comprehensive overrides
   Applied when <body class="lang-ar"> / <html dir="rtl">
════════════════════════════════════════════════════════ */

/* Global direction on the whole page */
body.lang-ar {
  font-family: 'Tajawal', sans-serif;
  direction: rtl;
  text-align: right;
}

/* Base text elements.
   Only `direction` is forced here. `text-align` is deliberately left alone:
   body.lang-ar above already right-aligns everything by inheritance, and a
   blanket `text-align: right` on every p/h1-h5 would override the `center`
   that centred blocks (hero CTAs, section intros, banners) set on their
   container — which is what used to push those headings off-centre in Arabic. */
body.lang-ar p,
body.lang-ar li,
body.lang-ar label,
body.lang-ar span:not(.badge-dot):not(.store-btn-icon):not(.team-avatar) {
  direction: rtl;
}

body.lang-ar h1,
body.lang-ar h2,
body.lang-ar h3,
body.lang-ar h4,
body.lang-ar h5 {
  direction: rtl;
}

/* Centred headings stay centred */
body.lang-ar .text-center h1,
body.lang-ar .text-center h2,
body.lang-ar .text-center h3,
body.lang-ar .text-center p,
body.lang-ar .text-center .section-subtitle,
body.lang-ar .section-title.text-center,
body.lang-ar .stu-cta h2,
body.lang-ar .stu-cta p,
body.lang-ar .ph-dl-cta h2,
body.lang-ar .ph-dl-cta p {
  text-align: center;
}

/* ── Navbar ──
   <html dir="rtl"> already flips every `flex-direction: row` container,
   so `row-reverse` here would flip it a second time and leave the bar
   reading left-to-right. Keep `row` and let the document direction mirror
   the logo, the links and the language toggle in one pass. */
body.lang-ar .navbar,
body.lang-ar .nav-links,
body.lang-ar .nav-right,
body.lang-ar .lang-toggle {
  direction: rtl;
  flex-direction: row !important;
}
body.lang-ar .nav-links a {
  text-align: center;
}
body.lang-ar .mobile-menu {
  direction: rtl;
  text-align: right;
}
body.lang-ar .mobile-menu a {
  justify-content: flex-start;
}

/* ── Section tags & badges ── */
body.lang-ar .section-tag {
  direction: rtl;
  flex-direction: row;
}

/* ── Section subtitles ── */
body.lang-ar .section-subtitle {
  text-align: right;
}

/* ── Footer ── */
body.lang-ar .footer {
  direction: rtl;
}
body.lang-ar .footer-grid {
  direction: rtl;
  text-align: right;
}
body.lang-ar .footer-brand p { text-align: right; }
body.lang-ar .footer-col h4  { text-align: right; }
body.lang-ar .footer-col ul  { text-align: right; }
body.lang-ar .footer-bottom  {
  direction: rtl;
  flex-direction: row;
}
body.lang-ar .footer-legal-links {
  flex-direction: row;
}
body.lang-ar .social-links {
  flex-direction: row;
}

/* ── Buttons & CTAs ── */
body.lang-ar .btn {
  flex-direction: row;
}
body.lang-ar .hero-actions {
  flex-direction: row;
  justify-content: flex-start;
}
/* ── Cards & Lists ── */
body.lang-ar .card { text-align: right; }
body.lang-ar .perk-item {
  flex-direction: row;
  text-align: right;
}
body.lang-ar .perk-item > div { text-align: right; }
body.lang-ar .ci-item {
  flex-direction: row;
  text-align: right;
}

/* ── Forms ── */
body.lang-ar input,
body.lang-ar textarea,
body.lang-ar select {
  direction: rtl;
  text-align: right;
}
body.lang-ar .form-group label {
  text-align: right;
}

/* ── Hero stats row ── */
body.lang-ar .hero-stats {
  flex-direction: row;
}

/* ── How it works steps ── */
body.lang-ar .steps-container {
  flex-direction: row;
}
body.lang-ar .step-card {
  text-align: right;
}
body.lang-ar .step-number {
  right: auto;
  left: 16px;
}

/* ── App cards (home) ── */
body.lang-ar .app-feature-card {
  text-align: right;
}
body.lang-ar .app-card-features {
  flex-direction: row;
}

/* ── Waitlist section ── */
body.lang-ar .waitlist-inner {
  direction: rtl;
}
body.lang-ar .waitlist-perks {
  text-align: right;
}
body.lang-ar .perk-item {
  flex-direction: row;
}

/* ── Feature rows (student/partner pages) ── */
/* In RTL, "row-reverse" becomes "normal" and vice-versa,
   the JS handles class toggling — here we ensure text column is right-aligned */
body.lang-ar .feat-txt-col,
body.lang-ar .pf-txt-col {
  text-align: right;
  align-items: flex-start;
}
body.lang-ar .feat-tag,
body.lang-ar .pf-tag,
body.lang-ar .feat-bar,
body.lang-ar .pf-bar,
body.lang-ar .pf-who-tag {
  margin-left: 0;
  margin-right: 0;
}

/* ── Student hero ── */
body.lang-ar .stu-hero-text {
  text-align: right;
}
body.lang-ar .stu-rating {
  flex-direction: row;
  justify-content: flex-end;
}

/* ── Partner hero ── */
body.lang-ar .ph-text {
  text-align: right;
}
body.lang-ar .ph-who {
  flex-direction: row;
}

/* ── Contact page ── */
body.lang-ar .contact-grid {
  direction: rtl;
}
body.lang-ar .contact-info-list { direction: rtl; }
body.lang-ar .contact-form-box  { direction: rtl; text-align: right; }

/* ── About page ── */
body.lang-ar .lifestyle-pillars { flex-direction: row; }
body.lang-ar .about-cta-btns { flex-direction: row; }

/* ── TOC (legal pages) ── */
body.lang-ar .legal-toc   { text-align: right; direction: rtl; }
body.lang-ar .legal-content { text-align: right; direction: rtl; }
body.lang-ar #tocList li a { border-left: none; border-right: 2px solid transparent; padding-left: 10px; padding-right: 10px; }
body.lang-ar #tocList li a:hover,
body.lang-ar #tocList li a.toc-active { border-right-color: var(--secondary); }
body.lang-ar .legal-h2::before { left: auto; right: 0; }
body.lang-ar .legal-list li { padding-left: 14px; padding-right: 38px; border-left: none; border-right: 3px solid var(--secondary); }
body.lang-ar .legal-list li::before { left: auto; right: 12px; content: '←'; }

/* ═══════════════════════════════════
   MOBILE PERFORMANCE
   ═══════════════════════════════════ */
/* Disable heavy animations on mobile */
@media (max-width: 768px) {
  #baasi-scene { display: none !important; }
  .hero-orb, .stu-orb, .ph-orb { display: none !important; }
  .hero-img-wrap, .ph-img-wrap, .hero-screenshot-frame,
  .floating-card, .stu-float, .ph-float { animation: none !important; will-change: auto !important; }
  /* Kill ALL animations and opacity tricks — elements always visible */
  .animate-on-scroll,
  .fade-up, .fade-up-2, .fade-up-3, .fade-up-4,
  .ph-text, .ph-visual, .stu-hero-text, .stu-hero-screen,
  .hero-content, .hero-visual {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    visibility: visible !important;
  }
}
/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.1ms !important;
  }
  #baasi-scene { display: none !important; }
  .animate-on-scroll { opacity: 1 !important; transform: none !important; }
}
/* Lang buttons - proper touch target */
.lang-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-height: 36px;
}

/* ═══════════════════════════════════════════════════════════════
   COMPREHENSIVE MOBILE RESPONSIVE — covers all pages
   Breakpoints: 768px (tablet/landscape), 480px (portrait phone)
   ═══════════════════════════════════════════════════════════════ */

/* ── Global box-sizing safety ── */
*, *::before, *::after { box-sizing: border-box; }
img, video, iframe, embed, object { max-width: 100%; height: auto; }
body { overflow-x: hidden; }

/* ── Fluid typography ── */
@media (max-width: 768px) {
  html { font-size: 15px; }

  /* Sections */
  section { padding: 56px 5%; }

  /* Headings */
  .section-title { font-size: clamp(1.5rem, 6vw, 2rem); letter-spacing: -0.5px; }
  .section-subtitle { font-size: 0.9rem; }

  /* ── NAVBAR ── */
  .navbar { padding: 0 4%; }
  .nav-links, .nav-cta { display: none; }
  .hamburger { display: flex; }
  .nav-logo img { height: 32px; }

  /* ── HERO (homepage) ── */
  .hero-container {
    grid-template-columns: 1fr !important;
    text-align: center;
    gap: 32px;
  }
  .hero-visual { display: none !important; }
  .hero-title { font-size: clamp(1.8rem, 8vw, 2.8rem); letter-spacing: -1px; }
  .hero-subtitle { font-size: 0.95rem; max-width: 100%; margin: 0 auto 28px; }
  .hero-actions { justify-content: center; flex-direction: column; gap: 12px; align-items: stretch; }
  .hero-actions a { width: 100%; text-align: center; justify-content: center; }
  .hero-stats { justify-content: center; gap: 16px; }
  .hero-badge { margin: 0 auto 20px; }

  /* ── HOW IT WORKS (steps) ── */
  .steps-container {
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
  }
  .step-arrow { display: none !important; }
  .step-card { padding: 20px 16px 18px; }
  .step-number { font-size: 2rem; }
  .step-card h3 { font-size: 0.9rem; }
  .step-card p { font-size: 0.82rem; }

  /* ── TWO APP CARDS ── */
  .apps-grid { grid-template-columns: 1fr !important; gap: 16px !important; }
  .app-feature-card { padding: 32px 24px; }
  .app-card-title { font-size: 1.6rem; }
  .app-card-features { flex-wrap: wrap; gap: 8px; }

  /* ── DOWNLOAD SECTION ── */
  .download-inner { grid-template-columns: 1fr !important; gap: 16px !important; }
  .dl-card { padding: 28px 22px; }

  /* ── STUDENT PAGE ── */
  .stu-hero-inner { grid-template-columns: 1fr !important; gap: 32px; }
  .stu-hero-screen { display: none !important; }
  .stu-title { font-size: clamp(1.8rem, 7vw, 2.8rem); }
  .stu-sub { font-size: 0.93rem; }
  .feat-row {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
    margin-bottom: 60px;
  }
  .feat-rev .feat-img-col, .feat-rev .feat-txt-col { order: unset !important; }
  .feat-img-col { order: -1 !important; justify-content: center; }
  .feat-screenshot, .feat-ph { width: clamp(160px, 50vw, 220px) !important; }
  .feat-glow { width: 160px !important; height: 160px !important; }
  .feat-h { font-size: 1.3rem; }
  .feat-p { max-width: 100%; font-size: 0.9rem; }

  /* ── PARTNER PAGE ── */
  .ph-inner { grid-template-columns: 1fr !important; gap: 32px; }
  .ph-visual { display: none !important; }
  .ph-title { font-size: clamp(1.8rem, 7vw, 2.8rem); }
  .pf-row {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
    margin-bottom: 60px;
  }
  .pf-rev .pf-img-col, .pf-rev .pf-txt-col { order: unset !important; }
  .pf-img-col { order: -1 !important; justify-content: center; }
  .pf-screenshot, .pf-ph { width: clamp(160px, 50vw, 220px) !important; }
  .pf-glow { width: 160px !important; height: 160px !important; }
  .pf-h { font-size: 1.3rem; }
  .pf-p { max-width: 100%; font-size: 0.9rem; }
  .ph-who { flex-wrap: wrap; gap: 6px; }

  /* ── ABOUT PAGE ── */
  .about-hero-inner { grid-template-columns: 1fr !important; text-align: center; }
  .about-prob-inner { grid-template-columns: 1fr !important; }
  .about-mission-inner { grid-template-columns: 1fr !important; gap: 24px; }
  .values-grid { grid-template-columns: 1fr 1fr !important; gap: 16px; }
  .team-grid { grid-template-columns: 1fr 1fr !important; gap: 20px; }
  .stats-row { grid-template-columns: 1fr 1fr !important; gap: 16px; }
  .lp-items { flex-wrap: wrap; gap: 8px; justify-content: center; }

  /* ── CONTACT PAGE ── */
  .contact-grid { grid-template-columns: 1fr !important; gap: 32px; }
  .contact-form-box { padding: 24px 20px; }
  .form-row-grid { grid-template-columns: 1fr !important; }
  .map-info-row { grid-template-columns: 1fr 1fr !important; gap: 12px; }
  .map-container iframe { height: 280px !important; }

  /* ── LEGAL PAGES ── */
  .legal-layout { grid-template-columns: 1fr !important; }
  .legal-toc { position: static !important; max-height: none !important; }
  .toc-list { flex-direction: row !important; flex-wrap: wrap !important; gap: 6px !important; }
  .toc-list li a { padding: 5px 10px; font-size: 0.75rem; border-left: none !important; border-radius: 20px; background: rgba(3,55,105,0.06); }
  .legal-content { padding: 24px 18px; }
  .legal-hero { padding: 100px 5% 48px; }
  .legal-page-title { font-size: 1.8rem; }

  /* ── FOOTER ── */
  .footer-grid { grid-template-columns: 1fr !important; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 10px; text-align: center; }

  /* ── STORE BADGES ── */
  .store-badges { flex-wrap: wrap; gap: 8px; }
  .badge-img { height: 40px; max-width: 136px; }
  .badge-fallback { height: 40px; min-width: 120px; }

  /* ── BUTTONS ── */
  .btn { font-size: 0.9rem; padding: 12px 20px; }

  /* ── CARD GRIDS ── */
  .grid-2 { grid-template-columns: 1fr !important; }
  .grid-3 { grid-template-columns: 1fr !important; }
  .grid-4 { grid-template-columns: 1fr 1fr !important; }
}

/* ── Small phones (portrait, 480px and below) ── */
@media (max-width: 480px) {
  html { font-size: 14px; }
  section { padding: 48px 4%; }

  .hero-title { font-size: clamp(1.6rem, 9vw, 2.2rem); }
  .stu-title, .ph-title { font-size: clamp(1.6rem, 8vw, 2.2rem); }

  .steps-container { grid-template-columns: 1fr !important; gap: 10px !important; }

  .values-grid { grid-template-columns: 1fr !important; }
  .team-grid { grid-template-columns: 1fr !important; }
  .stats-row { grid-template-columns: 1fr 1fr !important; }
  .grid-4 { grid-template-columns: 1fr !important; }

  .map-info-row { grid-template-columns: 1fr !important; }
  .map-container iframe { height: 240px !important; }

  .apps-grid, .download-inner { grid-template-columns: 1fr !important; }

  .app-card-title { font-size: 1.4rem; }
  .dl-card-title { font-size: 1.4rem; }

  .section-title { font-size: clamp(1.4rem, 7vw, 1.8rem); }
  .legal-page-title { font-size: 1.5rem; }

  .contact-form-box { padding: 20px 16px; }
  .legal-content { padding: 20px 14px; }
}

/* ── Landscape phone fix ── */
@media (max-width: 768px) and (orientation: landscape) {
  .hero-section, .stu-hero, .ph-hero {
    min-height: auto !important;
    padding-top: 90px;
    padding-bottom: 48px;
  }
  .steps-container { grid-template-columns: 1fr 1fr 1fr 1fr !important; gap: 8px !important; }
  .step-arrow { display: none !important; }
  .step-card { padding: 16px 12px; }
}


/* ── About page extra mobile fixes ── */
@media (max-width: 768px) {
  .about-stat { padding: 14px 20px; }
  .stat-sep { display: none; }
  .stats-inner { gap: 4px; }
  .lp-items { flex-direction: column; gap: 8px; }
  .lp-item { font-size: 0.88rem; }
}

/* ── Prevent any element exceeding viewport ── */
@media (max-width: 768px) {
  .hero-container, .about-hero-inner, .ph-inner,
  .stu-hero-inner, .feat-row, .pf-row,
  .contact-grid, .apps-grid, .download-inner {
    width: 100% !important;
    max-width: 100% !important;
  }
  /* Fix any overflowing images */
  .feat-screenshot, .pf-screenshot, .hero-app-img, .ph-app-img {
    max-width: min(240px, 80vw) !important;
    width: min(240px, 80vw) !important;
  }
  /* Prevent CTA buttons overflowing */
  .btn { max-width: 100%; white-space: normal; }
  /* Fix store badges overflow */
  .store-badges { max-width: 100%; }
  .badge-img { max-width: min(140px, 42vw); }
}

/* ════════════════════════════════════════════════════
   SHARED FORM STYLES  (.baasi-form)
   The contact page carries its own copy of these scoped to
   .contact-form-box; this generic version is what any other
   page with a form (account deletion, future forms) uses.
════════════════════════════════════════════════════ */
.baasi-form .form-row-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.baasi-form .form-group    { display:flex; flex-direction:column; gap:6px; margin-bottom:16px; }
.baasi-form label          { font-size:.82rem; font-weight:600; color:var(--primary-dark); }
.baasi-form input,
.baasi-form select,
.baasi-form textarea {
  width:100%;
  padding:12px 16px;
  border:1.5px solid rgba(3,55,105,.15);
  border-radius:10px;
  font-size:.92rem;
  font-family:inherit;
  color:var(--text);
  background:#fff;
  transition:var(--transition);
  outline:none;
}
.baasi-form input:focus,
.baasi-form select:focus,
.baasi-form textarea:focus { border-color:var(--primary); box-shadow:0 0 0 3px rgba(3,55,105,.08); }
.baasi-form textarea { resize:vertical; min-height:96px; }

.form-error {
  background:rgba(220,38,38,.07);
  border:1px solid rgba(220,38,38,.22);
  color:#991b1b;
  border-radius:var(--radius-sm);
  padding:12px 16px;
  font-size:.88rem;
  line-height:1.6;
  margin-bottom:18px;
}

body.lang-ar .baasi-form { direction:rtl; text-align:right; }
body.lang-ar .baasi-form .form-row-grid { direction:rtl; }
body.lang-ar .baasi-form label { display:block; }

@media (max-width:600px) {
  .baasi-form .form-row-grid { grid-template-columns:1fr; gap:0; }
}
