/* ═══════════════════════════════════════════════════════════════
   بطولة سابق ولاحق — Night Circuit Design System
   style.css — الخطوط، الرموز اللونية، الزجاجية، الحركات
   ═══════════════════════════════════════════════════════════════ */

/* ─── 1) الخطوط المستضافة محلياً ─── */
@font-face {
  font-family: 'Cairo';
  src: url('assets/fonts/Cairo-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Cairo';
  src: url('assets/fonts/Cairo-ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Cairo';
  src: url('assets/fonts/Cairo-Black.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Tajawal';
  src: url('assets/fonts/Tajawal-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Tajawal';
  src: url('assets/fonts/Tajawal-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Tajawal';
  src: url('assets/fonts/Tajawal-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ─── 2) الرموز اللونية ─── */
:root {
  --bg-deep: #05060A;
  --bg-night: #0B0F1A;
  --bg-raised: #121826;
  --steel: #3A4356;
  --metal: #A8B2C1;
  --neon: #00D4FF;
  --neon-dim: #0E7FA8;
  --flame: #FF6B1A;
  --flame-hot: #FF8A3D;
  --text-primary: #F4F7FB;
  --text-secondary: #CBD4E1;   /* مرفوع درجة لضمان التباين فوق الصور والتدرجات */
  --text-muted: #96A1B4;
  --success: #2EE6A6;
  --error: #FF4D5E;
  --ease-race: cubic-bezier(0.22, 1, 0.36, 1); /* دخول سريع وتوقف ناعم — إيقاع «فرملة السباق» */
}

/* ─── 3) الأساسيات ─── */
html {
  scroll-behavior: smooth;
}
/* :root (specificity 0-1-0) يتغلب على html في Preflight الذي يُحقن بعد هذا الملف؛
   وbody يرثها عبر line-height: inherit في Preflight */
:root {
  line-height: 1.7;             /* النص العربي يحتاج ارتفاع سطر أكبر */
  color-scheme: dark;           /* عناصر النظام (منتقي التاريخ، القوائم) بثيم داكن */
}
body {
  line-height: 1.7;
  letter-spacing: 0;            /* أي tracking يكسر اتصال الحروف العربية */
  background-color: var(--bg-deep);
}
/* توهجان محيطيان ثابتان يمنحان عمقاً لكامل الصفحة */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 600px at 85% -5%, rgba(0, 212, 255, 0.07), transparent 60%),
    radial-gradient(800px 600px at 10% 110%, rgba(255, 107, 26, 0.06), transparent 60%);
}
::selection {
  background: rgba(0, 212, 255, 0.35);
  color: #fff;
}
/* شريط تمرير داكن متناسق */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-night); }
::-webkit-scrollbar-thumb { background: var(--neon-dim); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--neon); }
html { scrollbar-color: var(--neon-dim) var(--bg-night); scrollbar-width: thin; }

.text-gradient {
  /* محطة وسطية فاتحة: الانتقال المباشر سيان→برتقالي يمر برمادي موحل يقتل التباين */
  background: linear-gradient(135deg, #35DDFF 0%, #A6EEFF 42%, #FFC46B 62%, #FF7A2E 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* text-shadow ممنوع هنا: مع الحروف الشفافة يُرسم الظل مكان الحرف فيسوّده.
     drop-shadow يتبع شكل الحروف المرسومة فيعطي العمق بلا إفساد */
  text-shadow: none;
  filter: drop-shadow(0 2px 10px rgba(5, 6, 10, 0.85));
}

/* ظل قراءة للنصوص فوق الصور والفيديو — يرفع التباين دون تعتيم المشهد كله */
.text-scrim {
  text-shadow:
    0 1px 3px rgba(5, 6, 10, 0.9),
    0 4px 28px rgba(5, 6, 10, 0.8);
}

/* عناوين الأقسام وعناوين التمهيد */
.section-title {
  font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  font-weight: 700;
  font-size: clamp(1.75rem, 2.5vw + 0.75rem, 2.75rem);
  line-height: 1.4;   /* خط Cairo له صواعد ونوازل عالية — أقل من هذا يسبب تلامس الأسطر */
  text-shadow: 0 1px 3px rgba(5, 6, 10, 0.7); /* قراءة مضمونة فوق الأقسام المصوّرة */
}
.eyebrow {
  font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--neon);
  margin-bottom: 0.5rem;
}

/* فاصل «خطوط سرعة» بين الأقسام — زخرفة CSS خالصة */
.section-shell::before {
  content: '';
  display: block;
  height: 1px;
  background: linear-gradient(to left, transparent, rgba(0, 212, 255, 0.35), transparent);
}

/* ═══════════════════════════════════════════════════════════════
   Visual Asset Prompt #07: glass & metal UI materials
   الخامات الزجاجية والمعدنية منفَّذة برمجياً بالوصفتين أدناه:
   لمعة الحافة العلوية (inset highlight) هي ما يبيع إحساس الزجاج.
   ═══════════════════════════════════════════════════════════════ */

/* ─── 4) الزجاجية Glassmorphism ─── */
.glass {
  background: rgba(18, 24, 38, 0.55);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.glass-card {
  background: rgba(18, 24, 38, 0.55);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s var(--ease-race);
}
.glass-strong {
  background: rgba(11, 15, 26, 0.62);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid rgba(0, 212, 255, 0.18);
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.55),
    0 0 32px -10px rgba(0, 212, 255, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.10);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .glass-card, .feature-card, .btn-ghost { background: rgba(18, 24, 38, 0.94); }
  .glass-strong { background: rgba(11, 15, 26, 0.96); }
}

/* ─── 5) الأزرار ─── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
  border-radius: 0.875rem;
  padding: 0.875rem 2.25rem;
  font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  font-weight: 700;
  color: var(--bg-night);                      /* نص داكن على برتقالي = تباين أعلى وإحساس أسخن */
  background: linear-gradient(135deg, var(--flame-hot), var(--flame));
  box-shadow: 0 8px 32px -8px rgba(255, 107, 26, 0.55);
  transition: transform 0.3s var(--ease-race), box-shadow 0.3s ease;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 40px -8px rgba(255, 107, 26, 0.7); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:focus-visible, .btn-ghost:focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: 3px;
}
/* لمعة قطرية تمسح الزر عند المرور */
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.35) 50%, transparent 65%);
  transform: translateX(150%);
  transition: transform 0.6s ease;
  pointer-events: none;
}
.btn-primary:hover::after { transform: translateX(-150%); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.875rem;
  padding: 0.875rem 2.25rem;
  font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  font-weight: 700;
  color: var(--neon);
  background: rgba(18, 24, 38, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 212, 255, 0.3);
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s var(--ease-race);
}
.btn-ghost:hover {
  background: rgba(0, 212, 255, 0.1);
  border-color: rgba(0, 212, 255, 0.55);
  transform: translateY(-2px);
}

/* شارات الـ Hero — بلا backdrop-filter عمداً: فوق فيديو حي مع parallax يكلف blur كل إطار */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 9999px;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: rgba(18, 24, 38, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.chip-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: var(--neon);
}

/* نقطة نبض «التسجيل مفتوح» */
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(46, 230, 166, 0.6);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(46, 230, 166, 0.6); }
  70% { box-shadow: 0 0 0 9px rgba(46, 230, 166, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 230, 166, 0); }
}

/* مؤشر التمرير أسفل الـ Hero */
.scroll-hint {
  display: block;
  width: 22px;
  height: 36px;
  border: 2px solid var(--steel);
  border-radius: 12px;
  position: relative;
}
.scroll-hint::after {
  content: '';
  position: absolute;
  top: 6px;
  inset-inline-start: 50%;
  margin-inline-start: -2px;
  width: 4px;
  height: 8px;
  border-radius: 4px;
  background: var(--neon);
  animation: scroll-hint 2s var(--ease-race) infinite;
}
@keyframes scroll-hint {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(12px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ─── 6) طبقة خطوط السرعة (asset #06) ─── */
.speedlines-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url('assets/img/speedlines.webp');
  background-size: cover;
  background-position: center;
  mix-blend-mode: screen;        /* الأسود يختفي وتبقى الخطوط الضوئية */
  opacity: 0.22;
  animation: speedlines-drift 14s linear infinite alternate;
}
@keyframes speedlines-drift {
  from { transform: translateX(-2.5%) scale(1.06); }
  to   { transform: translateX(2.5%) scale(1.06); }
}

/* ─── 7) بطاقات المميزات ─── */
.feature-card {
  position: relative;
  border-radius: 1rem;
  padding: 1.75rem;
  background: rgba(18, 24, 38, 0.55);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s var(--ease-race);
}
.feature-card:hover, .glass-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 212, 255, 0.35);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.5),
    0 0 40px -8px rgba(0, 212, 255, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1rem;
  border-radius: 0.75rem;
  color: var(--neon);
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.2);
}
.feature-icon svg { width: 1.5rem; height: 1.5rem; }

/* ─── 8) خط الزمن (خطوات التسجيل) ─── */
.steps { counter-reset: step; }
/* الخط الواصل: عمودي على الموبايل / أفقي على الديسكتوب — خصائص منطقية تدعم RTL تلقائياً */
.steps::before {
  content: '';
  position: absolute;
  background: linear-gradient(to bottom, var(--neon-dim), var(--flame));
  inset-inline-start: 1.375rem;
  top: 1.5rem;
  bottom: 1.5rem;
  width: 2px;
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 1s var(--ease-race) 0.2s;
}
.steps.is-visible::before { transform: scaleY(1); }
.step { padding-inline-start: 4rem; }
.step-dot {
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--neon);
  background: var(--bg-raised);
  border: 2px solid var(--neon-dim);
  box-shadow: 0 0 0 rgba(0, 212, 255, 0);
  transition: box-shadow 0.6s ease, border-color 0.6s ease;
}
.steps.is-visible .step-dot {
  border-color: var(--neon);
  box-shadow: 0 0 24px -4px rgba(0, 212, 255, 0.6);
}
@media (min-width: 768px) {
  .steps::before {
    inset-inline: 12.5%;
    top: 1.375rem;
    bottom: auto;
    width: auto;
    height: 2px;
    background: linear-gradient(to left, var(--neon-dim), var(--flame));
    transform: scaleX(0);
    transform-origin: right;    /* يُرسم من اليمين — اتجاه القراءة العربي */
  }
  .steps.is-visible::before { transform: scaleX(1); }
  .step { padding-inline-start: 0; padding-top: 4rem; }
  .step-dot { inset-inline-start: 50%; margin-inline-start: -1.375rem; }
}

/* ─── 9) حقول الفورم ─── */
.field-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.field legend { padding: 0; }
.req { color: var(--flame); }

.input-base {
  width: 100%;
  border-radius: 0.75rem;
  padding: 0.8rem 1rem;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.input-base::placeholder { color: var(--text-muted); }
.input-base:hover { border-color: rgba(255, 255, 255, 0.22); }
.input-base:focus {
  outline: none;
  border-color: var(--neon);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
}
/* إصلاح خلفية الإكمال التلقائي الفاتحة على الثيم الداكن */
.input-base:-webkit-autofill,
.input-base:-webkit-autofill:hover,
.input-base:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #121826 inset;
  -webkit-text-fill-color: var(--text-primary);
  caret-color: var(--text-primary);
  transition: background-color 9999s ease-out;
}
/* الحقول اللاتينية (هاتف/بريد) داخل التخطيط العربي */
.ltr-input { text-align: left; }

/* قائمة المدينة قبل اختيار المحافظة */
.input-base:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* أيقونة منتقي التاريخ في كروميوم — تُقلب للأبيض على الثيم الداكن */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.8);
  cursor: pointer;
}

/* حالة الخطأ */
.field.has-error .input-base,
.field.has-error .file-drop {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(255, 77, 94, 0.15);
}
.field.has-error .input-base { animation: shake 0.3s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(4px); }
  75% { transform: translateX(-4px); }
}
.field-error {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--error);
}

/* القائمة المنسدلة — سهم مخصص على اليسار (RTL) */
.select-base {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2300D4FF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 1rem center;
  /* السهم مرسوم على اليسار الفيزيائي = inline-end في RTL، فالتفريغ يكون هناك */
  padding-inline-end: 2.75rem;
  padding-inline-start: 1rem;
  cursor: pointer;
}
.select-base option {
  background: var(--bg-raised);
  color: var(--text-primary);
}
/* لون خيار الـ placeholder قبل الاختيار */
.select-base:invalid, .select-base option[value=""] { color: var(--text-muted); }
.select-base.has-value { color: var(--text-primary); }

/* أزرار الراديو بشكل Pills */
.radio-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.radio-pill {
  position: relative;
  cursor: pointer;
}
.radio-pill input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  inset: 0;
  cursor: pointer;
}
.radio-pill span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 9999px;
  padding: 0.6rem 1.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.25s ease;
}
/* دائرة اختيار صغيرة داخل الـ pill */
.radio-pill span::before {
  content: '';
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 9999px;
  border: 2px solid var(--steel);
  transition: all 0.25s ease;
}
.radio-pill input:checked + span {
  color: var(--text-primary);
  border-color: var(--neon);
  background: rgba(0, 212, 255, 0.1);
  box-shadow: 0 0 20px -6px rgba(0, 212, 255, 0.5);
}
.radio-pill input:checked + span::before {
  border-color: var(--neon);
  background: var(--neon);
  box-shadow: inset 0 0 0 2.5px var(--bg-raised);
}
.radio-pill input:focus-visible + span {
  outline: 2px solid var(--neon);
  outline-offset: 2px;
}
.radio-pill:hover span { border-color: rgba(255, 255, 255, 0.3); }

/* ─── 10) منطقة رفع الملفات المخصصة ─── */
.file-drop {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  border-radius: 0.875rem;
  border: 2px dashed rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
  padding: 1.75rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.file-drop:hover, .file-drop.is-dragover {
  border-color: var(--neon);
  background: rgba(0, 212, 255, 0.05);
}
.file-drop:focus-within {
  border-color: var(--neon);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.18);
}
.file-icon { width: 2rem; height: 2rem; color: var(--neon); }
.file-empty { color: var(--text-secondary); font-weight: 500; }
.file-hint { font-size: 0.8rem; color: var(--text-muted); }
.file-name { font-weight: 600; color: var(--neon); word-break: break-all; }
.file-clear {
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--error);
  transition: opacity 0.2s ease;
}
.file-clear:hover { opacity: 0.75; }
/* حالة وجود ملف مرفوع */
.file-drop.has-file {
  border-style: solid;
  border-color: rgba(46, 230, 166, 0.5);
  background: rgba(46, 230, 166, 0.05);
}
.file-drop.has-file .file-icon { color: var(--success); }

/* الحقول الشرطية — دخول ناعم عند الظهور */
.cond-field { overflow: hidden; }
.cond-field.is-shown { animation: cond-in 0.45s var(--ease-race); }
@keyframes cond-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── 11) زر الإرسال وحالة التحميل ─── */
.btn-spinner {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 9999px;
  border: 2.5px solid rgba(11, 15, 26, 0.3);
  border-top-color: var(--bg-night);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#submit-btn[disabled] { opacity: 0.75; cursor: wait; }

/* ─── 12) بطاقة النجاح ─── */
.success-card { padding: 2.5rem 1rem 1.5rem; position: relative; }
/* شريط علم الشطرنج أعلى البطاقة */
.checkered-strip {
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 10px;
  border-radius: 9999px;
  background: repeating-conic-gradient(#F4F7FB 0% 25%, #05060A 0% 50%) 0 0 / 20px 10px;
  opacity: 0.85;
  animation: checkered-slide 1.2s linear infinite;
}
@keyframes checkered-slide {
  from { background-position: 0 0; }
  to   { background-position: 20px 0; }
}
.success-ring { display: inline-block; width: 88px; height: 88px; margin-top: 1.5rem; }
.success-ring svg { width: 100%; height: 100%; }
.success-ring .ring {
  stroke: var(--success);
  stroke-width: 2.5;
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
}
.success-ring .check {
  stroke: var(--success);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
}
.success-card.play .ring { animation: draw 0.7s var(--ease-race) forwards; }
.success-card.play .check { animation: draw 0.45s var(--ease-race) 0.55s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ─── 13) الأكورديون (FAQ) ─── */
.accordion-item { overflow: hidden; }
.accordion-trigger {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.35rem;
  text-align: start;
  font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-primary);
  transition: color 0.25s ease;
}
.accordion-trigger:hover { color: var(--neon); }
.accordion-trigger:focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: -2px;
  border-radius: 1rem;
}
.accordion-icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--neon);
  transition: transform 0.3s var(--ease-race);
}
.accordion-item.is-open .accordion-icon { transform: rotate(180deg); }
/* أنيميشن الارتفاع بحيلة grid-template-rows — بدون قياس JS.
   visibility تُخفي المحتوى المطوي عن قارئات الشاشة بما يطابق aria-expanded */
.accordion-panel {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition: grid-template-rows 0.35s var(--ease-race), visibility 0s 0.35s;
}
.accordion-item.is-open .accordion-panel {
  grid-template-rows: 1fr;
  visibility: visible;
  transition: grid-template-rows 0.35s var(--ease-race), visibility 0s;
}
.accordion-inner { overflow: hidden; }
.accordion-inner p {
  padding: 0 1.35rem 1.25rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ─── 14) نظام الظهور عند التمرير ─── */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.65s var(--ease-race),
    transform 0.65s var(--ease-race);
  transition-delay: var(--reveal-delay, 0s);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ─── 15) الزر الثابت على الموبايل ─── */
.sticky-cta {
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--bg-night);
  background: linear-gradient(135deg, var(--flame-hot), var(--flame));
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.45);
  transform: translateY(0);
  transition: transform 0.35s var(--ease-race), visibility 0s;
}
/* visibility بعد انتهاء الانزلاق: يخرج من التركيز وقارئات الشاشة وهو مخفي */
.sticky-cta.is-hidden {
  transform: translateY(110%);
  visibility: hidden;
  transition: transform 0.35s var(--ease-race), visibility 0s 0.35s;
}

/* روابط الفوتر */
.footer-link { transition: color 0.2s ease; }
.footer-link:hover { color: var(--neon); }

/* ─── 16) رحلة السيارة ثلاثية الأبعاد — Scrollytelling ─── */
/* المقطع طويل والمسرح مثبّت: التمرير عبر الطول يقود الكاميرا والمشاهد */
.journey-track {
  height: 380vh;
}
.journey-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}
.journey-stage model-viewer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  --progress-bar-color: var(--neon);
  --progress-bar-height: 3px;
}
/* إضاءة سينمائية — توهجان كبيران تتغير شدتهما مع مراحل الرحلة (تُقاد من JS) */
.journey-glow {
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  border-radius: 9999px;
  filter: blur(90px);
  opacity: 0.3;
  pointer-events: none;
}
.glow-blue {
  background: radial-gradient(circle, rgba(0, 212, 255, 0.35), transparent 60%);
  top: -22vmax;
  inset-inline-end: -20vmax;
}
.glow-orange {
  background: radial-gradient(circle, rgba(255, 107, 26, 0.32), transparent 60%);
  bottom: -26vmax;
  inset-inline-start: -18vmax;
}
/* أرضية عرض متوهجة تحت السيارة */
.journey-floor {
  position: absolute;
  bottom: 9%;
  left: 50%;
  transform: translateX(-50%);
  width: min(78vw, 880px);
  height: 90px;
  border-radius: 9999px;
  background: radial-gradient(ellipse at center,
    rgba(0, 212, 255, 0.24),
    rgba(255, 107, 26, 0.08) 55%,
    transparent 75%);
  filter: blur(24px);
  pointer-events: none;
}
/* بطاقات المشاهد — الشفافية والإزاحة تُقادان من JS إطاراً بإطار */
.journey-card {
  position: absolute;
  opacity: 0;
  transform: translateY(34px);
  pointer-events: none;
  z-index: 2;
}
.jc-intro {
  inset-inline: 1.25rem;
  top: 12%;
  text-align: center;
}
.jc-final {
  inset-inline: 1.25rem;
  bottom: 11%;
  text-align: center;
  /* لوحة شبه صلبة: النص يمر فوق السيارة والتوهجات فلا نراهن على الحظ في التباين */
  margin-inline: auto;
  max-width: 34rem;
  padding: 1.5rem 1.25rem;
  border-radius: 1.25rem;
  background: rgba(5, 6, 10, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}
.jc-side {
  max-width: 24rem;
  padding: 1.5rem 1.75rem;
  border-radius: 1rem;
  background: rgba(11, 15, 26, 0.72);
  border: 1px solid rgba(0, 212, 255, 0.16);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.jc-start { inset-inline-start: max(5vw, 1.25rem); top: 26%; }
.jc-end   { inset-inline-end: max(5vw, 1.25rem); top: 30%; }
@media (max-width: 767px) {
  .jc-side {
    max-width: none;
    inset-inline: 1.25rem;
    top: auto;
    bottom: 13%;
  }
  .jc-intro { top: 9%; }
  .jc-final { bottom: 12%; padding: 1.25rem 1rem; }
  /* الزر اللاصق يغطي شريطاً سفلياً ثابتاً — نفسح للفوتر وآخر المحتوى */
  body { padding-bottom: 4.75rem; }
}
/* مؤشر مراحل الرحلة */
.journey-dots {
  position: absolute;
  inset-inline-end: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  gap: 0.6rem;
  z-index: 2;
}
.journey-dots span {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: var(--steel);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.journey-dots span.is-on {
  background: var(--neon);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.8);
}

/* ─── 17.4) مبدّل اللغة — مقطعان بمؤشر نيون منزلق ───
   عمودان متساويان (grid 1fr 1fr) ومؤشر مطلق يُوضَع بخصائص منطقية
   (inset-inline-start) فينزلق صحيحاً في RTL و LTR. */
.lang-seg {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  padding: 0.25rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(11, 15, 26, 0.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
/* المؤشر المنزلق — يغطي المقطع النشط ويتحرك بنعومة عند التبديل */
.lang-seg-thumb {
  position: absolute;
  z-index: 0;
  inset-block: 0.25rem;
  inset-inline-start: 0.25rem;
  inline-size: calc(50% - 0.25rem);
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--neon), var(--neon-dim));
  box-shadow: 0 0 18px -4px rgba(0, 212, 255, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: inset-inline-start 0.35s var(--ease-race);
}
/* اللغة الثانية (الإنجليزية) نشطة → المؤشر ينزلق للنصف الآخر */
.lang-seg[data-active="en"] .lang-seg-thumb {
  inset-inline-start: 50%;
}
.lang-seg-item {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.7rem;
  border-radius: 9999px;
  font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  line-height: 1;
  color: var(--text-muted);
  transition: color 0.3s ease;
}
.lang-seg-item.is-active {
  color: var(--bg-night); /* نص داكن فوق النيون = تباين عالٍ */
}
.lang-seg-item:not(.is-active):hover {
  color: var(--text-primary);
}
.lang-seg-item:focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: 2px;
}

/* ─── 17.5) دعم الاتجاه اللاتيني LTR (النسخة الإنجليزية) ───
   معظم التخطيط يعتمد خصائص منطقية (inset-inline/padding-inline/text-align:start)
   فينقلب تلقائياً؛ هنا فقط القواعد الفيزيائية التي لا تنقلب. */
/* سهم القائمة المنسدلة مرسوم يساراً (= inline-end في RTL) — ننقله لليمين في LTR */
[dir="ltr"] .select-base {
  background-position: right 1rem center;
}
/* عكس أفقي لخلفية الـ Hero (الفيديو + صورته الأساس) في LTR: يقلب وجهة السيارة
   ويعيد تأطيرها للجهة المقابلة كي تتّسق مع المحتوى المحاذى لليسار.
   نطبّقه على العنصرين لا على #hero-bg-layer لأن بارالاكس JS يكتب transform للأخير. */
[dir="ltr"] #hero-bg-layer img,
[dir="ltr"] #hero-video {
  transform: scaleX(-1);
}
/* خطوط السرعة: الـ transform يديره الأنيميشن، فنبدّل لنسخة معكوسة أفقياً في LTR.
   تحت «تقليل الحركة» تُجمَّد المدة (!important) فتستقر على الإطار الأخير المعكوس. */
[dir="ltr"] .speedlines-layer {
  animation-name: speedlines-drift-ltr;
}
@keyframes speedlines-drift-ltr {
  from { transform: translateX(-2.5%) scale(-1.06, 1.06); }
  to   { transform: translateX(2.5%) scale(-1.06, 1.06); }
}
/* خط الزمن الأفقي: يُرسم من اليسار في LTR (اتجاه القراءة) */
@media (min-width: 768px) {
  [dir="ltr"] .steps::before {
    background: linear-gradient(to right, var(--neon-dim), var(--flame));
    transform-origin: left;
  }
}
/* ارتفاع سطر أنسب قليلاً للنص اللاتيني */
[dir="ltr"] body {
  line-height: 1.65;
}

/* ─── 17) تقليل الحركة — تعطيل شامل ─── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .steps::before { transform: none; }
  .speedlines-layer { animation: none; }
  /* الرحلة تتحول لتخطيط ثابت: الموديل بارتفاع مريح والبطاقات كلها ظاهرة */
  .journey-track { height: auto; }
  .journey-stage { position: static; height: auto; padding: 4rem 1.25rem; }
  .journey-stage model-viewer { position: relative; height: 55vh; }
  .journey-card {
    position: static;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    margin: 1.25rem auto 0;
    max-width: 36rem;
    text-align: center;
  }
  .journey-dots { display: none; }
}
