/* ──────────────────────────────────────────────────────────────────────────
   طبقة الجوال — تجربة iOS مصقولة
   تُحمَّل بعد styles.css في كل الصفحات العامّة. سطحُ المكتب لا يتغيّر:
   كلُّ ما هنا إمّا خاصٌّ بالشاشات اللمسيّة أو محصورٌ تحت 760px.

   المبادئ (Apple HIG):
   • أهدافُ لمسٍ ≥ 44pt، وحقولُ إدخالٍ بخطّ 16px (أقلّ منه يُكبّر Safari الصفحةَ).
   • لا hover عالقٌ بعد اللمس — الضغطُ يعطي ردَّ فعلٍ «انضغاط» بدلًا منه.
   • احترامُ المنطقة الآمنة (النوتش وشريط الـHome) في كلّ حافّة ثابتة.
   • قوائمُ أفقيّةٌ بالتمرير والالتقاط (snap) بدل أعمدةٍ طويلةٍ لا تنتهي.
   • القوائمُ والنوافذُ أوراقٌ (sheets) تصعد من الأسفل في متناول الإبهام.
   ────────────────────────────────────────────────────────────────────────── */

/* ── لمسٌ عامّ (كل المقاسات) ─────────────────────────────────────────────── */
html { -webkit-tap-highlight-color:transparent; }
body { -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale; }
h1, h2, h3, .display { text-wrap:balance; }
p { text-wrap:pretty; }

/* hover على الأجهزة اللمسيّة يعلق بعد النقر (البطاقة تبقى مرفوعة) — نُلغيه
   ونستبدله بانضغاطٍ لحظيٍّ أثناء اللمس، كأزرار iOS. */
@media (hover:none) {
  .btn:hover, .fab:hover, .offer-card:hover, .course:hover, .feature:hover { transform:none; }
  .offer-card:hover, .course:hover, .feature:hover { box-shadow:var(--shadow-sm); }
  .course:hover { border-color:var(--line); }
  .course:hover .course-thumb img { transform:none; }
  .partner-row figure:hover img { filter:grayscale(1); opacity:.62; }
  .fab:hover .fab-shimmer { transform:translateX(-100%); }

  .btn, .icon-btn, .nav-links a, .fab, .m-row, .m-cta a { transition:transform .16s cubic-bezier(.2,.8,.2,1), background .16s ease, opacity .16s ease; }
  .btn:active, .icon-btn:active, .m-cta a:active { transform:scale(.96); }
  .fab:active { transform:scale(.9); }
  .offer-card:active, .course:active, .feature:active, .story:active { transform:scale(.985); transition:transform .12s ease; }
  .m-row:active { background:var(--brand-50); }
}

/* ── قائمة الجوال: ورقةٌ تصعد من الأسفل (تُبنى في script.js) ─────────────── */
.m-sheet { position:fixed; inset:0; z-index:200; visibility:hidden; pointer-events:none; }
.m-sheet.open { visibility:visible; pointer-events:auto; }
.m-scrim { position:absolute; inset:0; background:rgba(0, 12, 36,.38); opacity:0; transition:opacity .32s ease;
  -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px); }
.m-sheet.open .m-scrim { opacity:1; }
.m-panel { position:absolute; inset-inline:0; bottom:0; max-height:calc(100dvh - max(env(safe-area-inset-top,0px),20px) - 12px);
  display:flex; flex-direction:column; background:rgba(235, 235, 251,.96); border-radius:28px 28px 0 0;
  -webkit-backdrop-filter:saturate(180%) blur(24px); backdrop-filter:saturate(180%) blur(24px);
  box-shadow:0 -18px 50px -20px rgba(0, 12, 36,.45);
  transform:translateY(100%); transition:transform .42s cubic-bezier(.32,.72,0,1); will-change:transform; }
.m-sheet.open .m-panel { transform:translateY(0); }
.m-sheet.dragging .m-panel { transition:none; }
.m-grab { flex:none; padding:10px 0 4px; display:grid; place-items:center; cursor:grab; touch-action:none; }
.m-grab::before { content:""; width:38px; height:5px; border-radius:3px; background:rgba(60, 60, 67,.3); }
.m-head { flex:none; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:4px 20px 12px; touch-action:none; }
.m-head .brand img { width:38px; height:38px; }
.m-head .brand-text strong { font-size:15px; }
.m-head .brand-text small { font-size:11.5px; }
.m-close { width:32px; height:32px; border-radius:50%; display:grid; place-items:center; background:rgba(118, 118, 128,.14); color:rgba(60, 60, 67,.75); }
.m-body { overflow-y:auto; overscroll-behavior:contain; -webkit-overflow-scrolling:touch;
  padding:0 16px calc(env(safe-area-inset-bottom,0px) + 20px); }
.m-group { background:#ffffff; border-radius:14px; overflow:hidden; margin-bottom:18px; }
.m-label { margin:0 16px 7px; font-size:12.5px; font-weight:500; color:rgba(60, 60, 67,.6); }
.m-row { display:flex; align-items:center; gap:13px; min-height:50px; padding:0 16px; font-size:16px; color:var(--ink); position:relative; }
.m-row + .m-row::before { content:""; position:absolute; top:0; inset-inline-start:58px; inset-inline-end:0; height:.5px; background:rgba(60, 60, 67,.22); }
.m-row .m-ic { width:30px; height:30px; flex:none; border-radius:8px; display:grid; place-items:center; color:#ffffff; background:var(--brand-700); }
.m-row .m-ic svg { width:17px; height:17px; }
.m-row span { flex:1; }
.m-row .m-chev { width:8px; height:13px; color:rgba(60, 60, 67,.3); transform:scaleX(-1); }
.m-row small { color:rgba(60, 60, 67,.6); font-size:14px; direction:ltr; }
.m-row.on { font-weight:700; color:var(--brand-900); }
.m-cta { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:18px; }
.m-cta a { display:flex; align-items:center; justify-content:center; min-height:50px; border-radius:14px; font-weight:700; font-size:16px; }
.m-cta .gold { background:var(--gold-500); color:#ffffff; box-shadow:0 8px 20px -8px rgba(117, 88, 13,.6); }
.m-cta .ghost { background:#ffffff; color:var(--brand-900); }
.m-note { text-align:center; font-size:12.5px; color:rgba(60, 60, 67,.55); margin:0; }
html.m-locked, html.m-locked body { overflow:hidden; }

/* ── الهاتف (≤ 760px) ────────────────────────────────────────────────────── */
@media (max-width:760px) {
  html { scroll-padding-top:72px; }
  body { font-size:16px; }
  .container { padding-inline:max(20px, env(safe-area-inset-left,0px)) max(20px, env(safe-area-inset-right,0px)); }

  /* شريطُ التنبيه أخفّ، والشريطُ العلويّ يُطوى — الهاتفُ والتواصلُ في القائمة والتذييل */
  /* صفٌّ واحد: الشارة | النصّ (يُقصّ بنقاطٍ، أو يتحرّك إن طال — mobile.js) | الزرّ */
  .announce { font-size:12.5px; padding:8px 12px; }
  .announce-in { display:flex; flex-wrap:nowrap; align-items:center; gap:8px; width:100%; max-width:100%; }
  .announce-badge { flex:none; font-size:11px; padding:2px 9px; white-space:nowrap; }
  .announce-text { flex:1 1 auto; min-width:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; text-align:start; }
  .announce .announce-cta { flex:none; white-space:nowrap; font-size:11px; padding:2px 10px; }
  .announce-text.is-marq { text-overflow:clip; -webkit-mask-image:linear-gradient(90deg,transparent,#000000 10px,#000000 calc(100% - 10px),transparent); mask-image:linear-gradient(90deg,transparent,#000000 10px,#000000 calc(100% - 10px),transparent); }
  .announce-text.is-marq > span { display:inline-block; padding-inline-start:100%; animation:annMarq var(--marq-dur,12s) linear infinite; }
  @keyframes annMarq { from { transform:translateX(0); } to { transform:translateX(100%); } }
  @media (prefers-reduced-motion: reduce) { .announce-text.is-marq > span { animation:none; padding-inline-start:0; } .announce-text.is-marq { text-overflow:ellipsis; } }
  .topbar { display:none; }

  /* الشريط: زجاجٌ مُعتّمٌ بارتفاع 60 كشريط تنقّل iOS، وزرّان فقط */
  .nav { background:rgba(255, 255, 255,.78); -webkit-backdrop-filter:saturate(180%) blur(20px); backdrop-filter:saturate(180%) blur(20px);
    border-bottom:.5px solid rgba(60, 60, 67,.18); padding-top:env(safe-area-inset-top,0px); }
  .nav .container { height:60px; gap:10px; }
  .brand { gap:10px; min-width:0; }
  .brand img { width:38px; height:38px; flex:none; }
  .brand-text { min-width:0; }
  .brand-text strong { font-size:15px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .brand-text small { font-size:11.5px; white-space:nowrap; }
  .nav-actions { margin-inline-start:auto; gap:8px; }
  .nav-actions .btn { display:none; }
  .icon-btn { width:44px; height:44px; border:0; background:var(--brand-50); }
  .nav-toggle { display:grid; }

  /* البنر: النصُّ أوّلًا (ما يُقرأ فوق الطيّة)، ثمّ الصورة */
  .hero::before { width:360px; height:360px; top:-120px; inset-inline-end:-140px; }
  .hero .container { gap:30px; padding-block:26px 46px; }
  .hero-visual { order:0; }
  .hero .eyebrow { font-size:13px; margin-bottom:10px; }
  .hero h1 { font-size:clamp(31px, 8.6vw, 38px); line-height:1.32; margin-bottom:14px; }
  .hero-sub { font-size:16.5px; line-height:1.85; margin-bottom:22px; }

  .hero-search { display:grid; grid-template-columns:1fr auto; gap:0; padding:6px; border-radius:20px; }
  .hero-search select { grid-column:1 / -1; width:100%; min-height:46px; font-size:16px; padding:0 12px;
    border-inline-end:0; border-bottom:.5px solid var(--line); border-radius:0;
    -webkit-appearance:none; appearance:none;
    background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E") no-repeat left 12px center; }
  .hero-search input { font-size:16px; min-height:48px; padding:0 12px; }
  .hero-search .btn { min-height:44px; margin:2px; padding-inline:16px; }

  .hero-cta { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:16px; }
  .hero-cta .btn { min-height:50px; padding-inline:12px; font-size:15px; }
  .live-trainees { margin-top:22px; }
  .avatars span { width:34px; height:34px; font-size:12.5px; margin-inline-start:-10px; }
  .live-trainees p { font-size:14px; }

  .hero-visual img { border-radius:24px; aspect-ratio:4/3; object-fit:cover; }
  .hero-badge { inset-inline-start:12px; inset-inline-end:auto; inset-block-end:12px; max-width:calc(100% - 24px);
    padding:10px 14px; border-radius:16px; background:rgba(255, 255, 255,.88);
    -webkit-backdrop-filter:saturate(180%) blur(16px); backdrop-filter:saturate(180%) blur(16px); }
  .hero-badge .tick { width:34px; height:34px; border-radius:10px; }
  .hero-badge strong { font-size:13.5px; }
  .hero-badge small { font-size:12px; line-height:1.5; display:block; }

  /* الأرقام: شبكةٌ 2×2 بفواصل رفيعة */
  .stats .container { grid-template-columns:1fr 1fr; gap:0; padding-block:22px 24px; }
  .stat { padding:14px 4px; text-align:center; }
  .stat:nth-child(odd) { border-inline-end:.5px solid rgba(255, 255, 255,.14); }
  .stat:nth-child(-n+2) { border-bottom:.5px solid rgba(255, 255, 255,.14); }
  .stat b { font-size:28px; }
  .stat span { font-size:13.5px; }
  .accredit { margin-top:16px; padding:12px 14px; border-radius:16px; }
  .accredit img { width:42px; height:42px; }

  /* الأقسام */
  .section { padding:52px 0; }
  .section-tight { padding:44px 0; }
  .section-head { margin-bottom:22px; }
  .section-head h2 { font-size:clamp(25px, 7vw, 30px); margin-bottom:8px; }
  .section-head p { font-size:15.5px; }
  .eyebrow { font-size:13px; margin-bottom:8px; }
  .eyebrow::before { width:24px; }
  .head-row { align-items:flex-start; gap:14px; }
  .head-row > .btn { padding:8px 14px; font-size:13.5px; min-height:38px; }

  /* العدّ التنازليّ: أربعُ خاناتٍ بعرض الشاشة */
  .countdown { display:grid; grid-template-columns:repeat(4,1fr); width:100%; gap:8px; }
  .countdown .unit { min-width:0; padding:9px 4px; border-radius:14px; }
  .countdown .unit b { font-size:22px; }

  /* قوائمُ أفقيّةٌ بالتمرير والالتقاط — بطاقةٌ تُطلّ منها التالية (peek) كمتجر التطبيقات */
  .offer-grid, .card-grid, .card-grid.four, .story-grid {
    display:grid; grid-auto-flow:column; grid-template-columns:none; gap:14px;
    overflow-x:auto; overscroll-behavior-x:contain; -webkit-overflow-scrolling:touch;
    scroll-snap-type:x mandatory; scroll-padding-inline:20px;
    margin-inline:-20px; padding:4px 20px 18px; scrollbar-width:none;
  }
  .offer-grid::-webkit-scrollbar, .card-grid::-webkit-scrollbar, .story-grid::-webkit-scrollbar { display:none; }
  .offer-grid { grid-auto-columns:78%; }
  .card-grid, .card-grid.four { grid-auto-columns:82%; }
  .story-grid { grid-auto-columns:86%; }
  .offer-card, .course, .story { scroll-snap-align:start; scroll-snap-stop:always; }

  .offer-card { min-height:360px; border-radius:22px; }
  .offer-body { padding:18px; }
  .offer-body h3 { font-size:19px; }
  .offer-body .btn { min-height:46px; }
  .discount { top:14px; inset-inline-start:14px; }

  .course { border-radius:20px; }
  .course-body { padding:16px 16px 18px; }
  .course-body h3 { font-size:17px; }
  .course-body p { font-size:14px; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
  .meta { gap:12px; flex-wrap:wrap; }
  .course-foot .btn { min-height:40px; }

  .story { padding:22px; border-radius:20px; }
  .story p { font-size:15px; }
  .placeholder-note { font-size:12.5px; }

  /* الشركاء */
  .partner-row { gap:22px 26px; }
  .partner-row img { height:52px; }
  .partner-row figcaption { font-size:12px; margin-top:8px; }

  /* انضمّي إلينا */
  .join-grid { gap:14px; }
  .join { padding:26px 22px; border-radius:22px; }
  .join h3 { font-size:23px; }
  .join > p, .join li { font-size:15px; }
  .join .btn { width:100%; min-height:50px; }

  /* لماذا نحن: صفوفٌ مدمجةٌ (أيقونةٌ بجانب النص) بدل بطاقاتٍ طويلة */
  .feature-grid { grid-template-columns:1fr; gap:10px; margin-bottom:22px; }
  .feature { display:grid; grid-template-columns:46px 1fr; column-gap:14px; align-items:start; padding:16px; border-radius:18px; }
  .feature .ico { width:46px; height:46px; border-radius:13px; margin:0; grid-row:span 2; }
  .feature h3 { font-size:16.5px; margin:2px 0 4px; }
  .feature p { font-size:14px; line-height:1.75; }
  .mini-stats { grid-template-columns:1fr 1fr; gap:18px 10px; padding:22px 14px; border-radius:20px; }
  .mini-stats b { font-size:27px; }
  .mini-stats span { font-size:13px; }

  /* من نحن */
  .about .container { gap:26px; }
  .about-media { border-radius:22px; }
  .about-media img { aspect-ratio:16/11; object-fit:cover; width:100%; }
  .about p { font-size:16px; }
  .about-points li { font-size:15px; }
  .about .hero-cta { display:grid; grid-template-columns:1fr 1fr; }

  /* التذييل */
  .footer-trust { padding:26px 20px; }
  .footer-trust ul { gap:18px 30px; }
  .footer-trust img { height:32px; }
  .footer-main { padding:40px 20px 24px; }
  .footer-cols { gap:32px; }
  .footer-grid { grid-template-columns:1fr 1fr; gap:28px 18px; }
  .footer-col ul { gap:0; font-size:14.5px; }
  .footer-col li a, .footer-col li > span { display:inline-flex; align-items:center; min-height:44px; }
  .footer-watermark p { padding-bottom:12px; }
  /* مساحةٌ لشريط الـHome ولعمود الأزرار العائمة كي لا يغطّي آخرَ سطر */
  .footer-bottom { padding:18px 20px calc(env(safe-area-inset-bottom,0px) + 84px); }
  .footer-bottom .inner { flex-direction:column-reverse; text-align:center; gap:12px; }

  /* الحركات أهدأ على الهاتف — مسافةُ ظهورٍ أقصر وبلا انزياح للصورة */
  @keyframes reveal-in { from { opacity:0; transform:translateY(14px); } to { opacity:1; transform:none; } }
  .hero-visual img { animation:none; }

  /* الأزرار العائمة: أصغر (48)، بلا هالةٍ نابضة، وتنزاح جانبًا أثناء التمرير لأسفل
     كشريط أدوات Safari ثمّ تعود عند الصعود أو التوقّف (mobile.js → html.fab-away).
     ثلاثةُ أزرارٍ ثابتةٌ على حافّة شاشةٍ عرضُها 390 كانت تغطّي البطاقاتِ والعدّاد. */
  :root { --fab-step:58px; }
  .fab-halo, .fab-glow { display:none; }
  .fab-label { display:none; }
  .wa .fab, .sw .sw-fab, .as .sw-fab { width:48px; min-width:48px; height:48px; }
  .sw .sw-fab .ic, .as .sw-fab .ic { width:48px; height:48px; }
  .wa .fab .glyph { width:22px; height:22px; }
  .sw, .as, .fab-wrap.wa { transition:transform .38s cubic-bezier(.32,.72,0,1), opacity .25s ease; }
  html.fab-away .sw:not(.open), html.fab-away .as:not(.open), html.fab-away .fab-wrap.wa {
    transform:translateX(calc(100% + 28px)); opacity:0; pointer-events:none; }

  /* صفحة الدخول (login.html) */
  .auth-brand { padding:calc(env(safe-area-inset-top,0px) + 22px) 20px 26px; }
  .auth-brand .mark img { width:42px; height:42px; }
  .auth-brand h1 { font-size:28px; margin:18px 0 8px; }
  .auth-brand .lead { font-size:15px; }
  .auth-back { display:inline-flex; align-items:center; min-height:44px; margin-top:10px; }
  .auth-form-side { padding:28px 20px calc(env(safe-area-inset-bottom,0px) + 40px); align-items:start; }
  .auth-card h2 { font-size:25px; }
  .auth-card input { font-size:16px; min-height:52px; border-radius:14px; }
  .auth-card .btn-block { min-height:52px; font-size:16px; }
  .pw-toggle { min-height:36px; }

  /* تذاكري (my-tickets.html) */
  .mt-top { padding:calc(env(safe-area-inset-top,0px) + 16px) 0 64px; }
  .mt-top .mt-head { margin-top:22px; }
  .mt-back { padding:8px 14px; font-size:13.5px; }
  .tk { padding:18px 16px; border-radius:20px; }
  .tk .ask { flex-direction:column; align-items:stretch; }
  .tk .ask .btn { min-height:46px; }
}

/* ── ورقتا الدعم والمساعد على الهاتف ─────────────────────────────────────
   تتحوّلان من نافذةٍ صغيرةٍ معلّقةٍ فوق الزرّ إلى ورقةٍ سفليّةٍ بعرض الشاشة
   مع خلفيّةٍ معتمة، وتُخفى الأزرارُ العائمة الأخرى كي لا تطفو فوقها.
   --kb = ارتفاع لوحة المفاتيح (assets/support/widget.js) فلا تُغطّي حقلَ الكتابة. */
@media (max-width:560px) {
  .sw.open::before, .as.open::before { content:""; position:fixed; inset:0; background:rgba(0, 12, 36,.38);
    -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px); animation:mFade .25s ease; }
  @keyframes mFade { from { opacity:0; } }
  /* المحدِّدات مسبوقةٌ بالجذر (.sw/.as): ملفّا الودجت يُحمَّلان آخرَ الصفحة، فبلا
     خصوصيّةٍ أعلى تغلبُ قواعدُهما هذه الطبقة. */
  .sw .sw-panel, .as .as-panel { position:fixed; inset-inline:8px; left:8px; right:8px; bottom:calc(var(--kb,0px) + env(safe-area-inset-bottom,0px) + 8px);
    width:auto; border-radius:26px; transform-origin:bottom center; animation:mUp .38s cubic-bezier(.32,.72,0,1); }
  @keyframes mUp { from { transform:translateY(40px); opacity:0; } }
  .sw .sw-panel { max-height:calc(100dvh - var(--kb,0px) - 70px); }
  .as .as-panel { height:auto; max-height:calc(100dvh - var(--kb,0px) - 70px); min-height:min(520px, calc(100dvh - var(--kb,0px) - 70px)); }
  .sw.open .sw-fab, .as.open .as-fab { display:none; }
  body:has(.sw.open) .as, body:has(.sw.open) .fab-wrap.wa,
  body:has(.as.open) .sw-fab, body:has(.as.open) .fab-wrap.wa { opacity:0; pointer-events:none; }
  html:has(.sw.open), html:has(.as.open) { overflow:hidden; }
  :is(.sw,.as) .sw-x { width:32px; height:32px; border-radius:50%; }
  :is(.sw,.as) :is(.sw-in,.sw-ta) { font-size:16px; }
  :is(.sw,.as) .sw-chip { padding:9px 14px; font-size:14px; }
  .sw .sw-send { min-height:50px; font-size:16px; }
  .as .as-send { width:48px; }
  .as .as-input .sw-in { min-height:46px; }
}

/* hero v2 on phones: LMS card above the image (as on desktop), image uncropped (its text reaches the edges), accreditation full width */
@media (max-width:620px) {
  .hero-visual img { aspect-ratio:auto; object-fit:initial; }
  .hero-visual .hero-lms { grid-template-columns:auto minmax(0,1fr); gap:10px 12px; padding:14px; margin:-34px 10px 0; border-radius:20px; }
  .hero-lms-ic { width:48px; height:48px; border-radius:15px; }
  .hero-lms-ic svg { width:23px; height:23px; }
  .hero-lms-go { grid-column:1 / -1; grid-template-columns:1fr auto; align-items:center; justify-items:stretch; }
  .hero-lms-btn { justify-content:center; padding:12px 16px; }
  .hero-accredit { display:flex; margin-top:20px; padding:12px 14px; }
}

/* hero logos on phones: three across, full width */
@media (max-width:620px) {
  .hero-logos { margin-top:22px; align-items:stretch; }
  .hero-logos ul { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
  .hero-logos li { height:64px; min-width:0; padding:8px; border-radius:14px; }
  .hero-logos img { height:40px; max-width:100%; }
}
