/* =========================================================
   منصة مستر محمد مسعود - الفلسفة وعلم النفس
   ملف التنسيق الرئيسي
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Readex+Pro:wght@400;500;600;700&family=Tajawal:wght@400;500;700;800&family=Alexandria:wght@400;500;600;700;800&family=Poppins:wght@400;500;600;700&display=swap');

:root {
  /* ألوان أزرق مخضّر (تيل بلو) */
  --petrol-950: #03141f;
  --petrol-900: #061f2e;
  --petrol-800: #093048;
  --petrol-700: #0d4560;
  --petrol-600: #125c7d;
  --petrol-500: #17769e;
  --petrol-400: #2f9cc4;
  --petrol-300: #71c6e3;
  --petrol-100: #e2f4fa;

  /* أخضر فسفوري (لون النصوص المميزة والأزرار) */
  --accent-600: #12d99b;
  --accent-500: #2cf5b0;
  --accent-400: #7bffd3;
  --accent-100: #dffff2;
  /* نسخة أغمق من الأخضر الفسفوري لاستخدامها كنص فوق خلفية بيضاء/فاتحة (عشان الوضوح) */
  --accent-ink: #087a58;

  --white: #ffffff;
  --cream: #f4f8f9;
  --ink: #08161d;
  --ink-soft: #395c66;
  --line: rgba(6, 31, 46, 0.12);

  --shadow-sm: 0 2px 10px rgba(3, 20, 31, 0.08);
  --shadow-md: 0 10px 30px rgba(3, 20, 31, 0.14);
  --shadow-lg: 0 20px 55px rgba(3, 20, 31, 0.22);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 26px;

  --font-ar-display: 'Readex Pro', 'Tajawal', sans-serif;
  --font-ar-body: 'Tajawal', 'Segoe UI', sans-serif;
  --font-en-display: 'Alexandria', 'Readex Pro', sans-serif;
  --font-en-body: 'Poppins', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-ar-body);
  background: var(--cream);
  color: var(--ink);
  direction: rtl;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { font-family: var(--font-ar-display); margin: 0 0 .5em; line-height: 1.35; }
p { margin: 0 0 1em; }
button { font-family: inherit; cursor: pointer; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 90px 0; }
.section-alt { background: var(--white); }
.section-dark {
  background: linear-gradient(160deg, var(--petrol-950), var(--petrol-800) 60%, var(--petrol-700));
  color: var(--white);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-en-body);
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-ink);
  font-weight: 600;
  margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--accent-ink); display: inline-block; }
.section-dark .eyebrow { color: var(--accent-400); }
.section-dark .eyebrow::before { background: var(--accent-400); }

.section-title {
  font-size: clamp(28px, 4vw, 42px);
  color: var(--petrol-900);
}
.section-dark .section-title { color: var(--white); }
.section-sub {
  max-width: 640px;
  color: var(--ink-soft);
  font-size: 17px;
}
.section-dark .section-sub { color: rgba(255,255,255,.78); }

.center { text-align: center; margin-left: auto; margin-right: auto; }

/* ---------------- الأزرار ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 30px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  border: 2px solid transparent;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease, color .25s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-accent {
  background: linear-gradient(135deg, var(--accent-400), var(--accent-600));
  color: var(--petrol-950);
  box-shadow: 0 10px 24px rgba(18,217,155,.35);
}
.btn-accent:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(18,217,155,.45); }
.btn-outline {
  border-color: rgba(255,255,255,.55);
  color: var(--white);
  background: transparent;
}
.btn-outline:hover { background: rgba(255,255,255,.12); }
.btn-petrol {
  background: var(--petrol-700);
  color: var(--white);
  box-shadow: 0 10px 24px rgba(14, 83, 70, .3);
}
.btn-petrol:hover { background: var(--petrol-600); transform: translateY(-2px); }
.btn-ghost {
  border-color: var(--line);
  color: var(--petrol-800);
  background: var(--white);
}
.btn-ghost:hover { border-color: var(--petrol-500); color: var(--petrol-700); }
.btn-sm { padding: 9px 18px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-danger { background: #c94b3f; color: #fff; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------------- الهيدر ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(6, 43, 36, .96);
  color: var(--white);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  flex-wrap: nowrap;
  gap: 8px;
}
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-ar-display); min-width: 0; flex-shrink: 1; }
.brand-badge {
  height: 42px; width: auto;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-badge img { height: 100%; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; overflow: hidden; }
.brand-text strong { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text span { font-size: 12px; color: var(--accent-400); font-family: var(--font-ar-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  padding: 9px 16px; border-radius: 999px; font-size: 14.5px; font-weight: 500;
  color: rgba(255,255,255,.85);
  transition: background .2s, color .2s;
}
.nav-links a:hover, .nav-links a.active { background: rgba(255,255,255,.12); color: var(--white); }
.nav-cta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.nav-toggle { display: none; background: none; border: 0; color: #fff; font-size: 26px; flex-shrink: 0; }

@media (max-width: 900px) {
  .nav-links { position: fixed; inset: 76px 0 0 0; background: var(--petrol-900); flex-direction: column; align-items: stretch; padding: 20px; gap: 4px; transform: translateY(-110%); transition: transform .3s ease; }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { text-align: center; padding: 14px; }
  .nav-toggle { display: block; }
  .nav-cta .btn span.long { display: none; }
}
/* على الشاشات الصغيرة جدًا (الموبايل): الاسم والوصف بيضيقوا مكان الأزرار
   ويعملوا التفاف/تراكب، فبنقلل حجم الخط ونخفي الوصف الفرعي، وعلى أضيق
   الشاشات بنسيب الأيقونة بس عشان الهيدر يفضل سطر واحد مرتب. */
@media (max-width: 560px) {
  .brand-text span { display: none; }
  .brand-text strong { font-size: 15px; }
  .nav-cta { gap: 6px; }
  .nav-cta .btn-sm { padding: 8px 13px; font-size: 12.5px; }
}
@media (max-width: 400px) {
  .brand-text { display: none; }
}

/* ---------------- الهيرو ---------------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 70px 0 50px;
  background: linear-gradient(165deg, var(--petrol-950), var(--petrol-800) 55%, var(--petrol-700));
}
.hero-glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(600px 420px at 85% 15%, rgba(44,245,176,.22), transparent 60%),
    radial-gradient(700px 500px at 10% 90%, rgba(23,118,158,.4), transparent 60%);
  pointer-events: none;
}

/* ---------- أشكال متحركة تعبّر عن الفلسفة وعلم النفس (خلفية زخرفية شفافة) ---------- */
.hero-float-icons { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.float-icon {
  position: absolute;
  color: var(--accent-400);
  opacity: .13;
  line-height: 1;
  will-change: transform;
  animation: floatDrift ease-in-out infinite;
}
.float-icon.alt { color: var(--petrol-300); opacity: .16; }
.float-icon.psi { font-family: var(--font-en-display); font-style: italic; font-weight: 700; }
@keyframes floatDrift {
  0%   { transform: translateY(0) translateX(0) rotate(0deg); }
  25%  { transform: translateY(-16px) translateX(6px) rotate(4deg); }
  50%  { transform: translateY(6px) translateX(-8px) rotate(-3deg); }
  75%  { transform: translateY(-10px) translateX(-4px) rotate(2deg); }
  100% { transform: translateY(0) translateX(0) rotate(0deg); }
}
@media (max-width: 900px) { .hero-float-icons { display: none; } }
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
  gap: 40px;
}
.hero-copy { padding: 50px 0; }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(44,245,176,.14); border: 1px solid rgba(44,245,176,.35);
  color: var(--accent-400); padding: 8px 16px; border-radius: 999px;
  font-size: 13.5px; font-weight: 700; margin-bottom: 26px;
}
.hero-title {
  font-size: clamp(30px, 4.6vw, 50px);
  color: var(--white);
  margin-bottom: 18px;
}
.hero-title .hi { color: var(--accent-400); }
.hero-slogan {
  font-family: var(--font-ar-display);
  font-weight: 600;
  font-size: clamp(16px, 1.9vw, 20px);
  color: var(--accent-400);
  margin: 0 0 16px;
}
.hero-desc { color: rgba(255,255,255,.82); font-size: 18px; max-width: 520px; margin-bottom: 34px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 46px; }

.hero-stats { display: flex; gap: 30px; flex-wrap: wrap; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-family: var(--font-en-display); font-size: 26px; color: var(--white); }
.hero-stats span { font-size: 13px; color: rgba(255,255,255,.65); }

.hero-visual { position: relative; display: flex; justify-content: center; }
.hero-logo-mark {
  position: absolute;
  top: -8px; left: 50%;
  transform: translateX(-50%) translateX(-11%);
  height: clamp(64px, 13vw, 132px); width: auto;
  z-index: 2;
  filter: drop-shadow(0 4px 14px rgba(0,0,0,.35));
  clip-path: inset(0 100% 0 0);
  animation: heroLogoWriteOn 2.1s linear .3s forwards;
}
/* اللوجو دلوقتي توقيع واحد متصل بالكامل (M ماسعود بخط الإيد) فمفيش مسافة
   فاضية جوّاه، فالحركة بقت "كتابة" واحدة ناعمة من الشمال لليمين بسرعة
   ثابتة من أول ما يبدأ لحد ما يخلص. ظاهر ومتحرك على كل المقاسات (بما فيها
   الموبايل)، بس بمقاس أصغر يتناسب مع عرض الشاشة. */
@keyframes heroLogoWriteOn {
  0%   { clip-path: inset(0 100% 0 0); }
  100% { clip-path: inset(0 0% 0 0); }
}
.hero-photo {
  position: relative;
  display: inline-block;
  margin-top: clamp(78px, 17vw, 168px);
  transform: translateX(-11%);
}
.hero-photo img {
  position: relative;
  display: block;
  max-height: 690px;
  width: auto;
}
.brain-glow {
  position: absolute;
  top: 18%; left: 87%;
  width: 40px; height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(120,230,255,.95), rgba(44,245,176,.45) 55%, transparent 75%);
  filter: blur(2px);
  pointer-events: none;
  animation: brainPulse 2.6s ease-in-out infinite;
}
@keyframes brainPulse {
  0%, 100% { transform: scale(.8); opacity: .5; }
  50% { transform: scale(1.3); opacity: 1; }
}
.think-spark {
  position: absolute;
  color: var(--accent-400);
  font-size: 13px;
  pointer-events: none;
  animation: sparkTwinkle 3.2s ease-in-out infinite;
}
.think-spark.s1 { top: 27%; left: 91%; animation-delay: .4s; }
.think-spark.s2 { top: 51%; left: 95%; font-size: 10px; animation-delay: 1.6s; }
@keyframes sparkTwinkle {
  0%, 100% { opacity: 0; transform: scale(.6) translateY(2px); }
  50% { opacity: 1; transform: scale(1) translateY(-2px); }
}
@media (max-width: 900px) {
  .hero-photo { transform: none; }
  .hero-logo-mark { transform: translateX(-50%); }
}

/* ---------- انيميشن اسم المستر ---------- */
.name-stage {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 16px 22px;
  margin: 6px 0 20px;
  min-height: 1.4em;
}
.name-ar, .name-en {
  opacity: 0;
  will-change: transform, opacity;
}
.name-ar {
  font-family: var(--font-ar-display);
  font-size: clamp(30px, 4.4vw, 46px);
  font-weight: 700;
  color: var(--white);
  transform: translateX(-140px);
}
.name-en {
  font-family: var(--font-en-display);
  font-weight: 600;
  font-size: clamp(16px, 2vw, 22px);
  color: var(--accent-400);
  transform: translateX(140px);
  letter-spacing: .06em;
}
.name-stage.in-view .name-ar {
  animation: slideInFromLeft .9s cubic-bezier(.2,.8,.25,1) forwards;
}
.name-stage.in-view .name-en {
  animation: slideInFromRight .9s cubic-bezier(.2,.8,.25,1) forwards;
  animation-delay: .12s;
}
@keyframes slideInFromLeft {
  0%   { opacity: 0; transform: translateX(-140px); }
  70%  { opacity: 1; }
  100% { opacity: 1; transform: translateX(0); }
}
@keyframes slideInFromRight {
  0%   { opacity: 0; transform: translateX(140px); }
  70%  { opacity: 1; }
  100% { opacity: 1; transform: translateX(0); }
}
.name-stage.settled .name-ar,
.name-stage.settled .name-en {
  animation: none !important;
  opacity: 1 !important;
  transform: translateX(0) !important;
}

/* ---------------- بطاقة "من أنا" ---------------- */
.about-grid {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 60px;
  align-items: center;
}
.about-portrait {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(160deg, var(--petrol-800), var(--petrol-600));
  aspect-ratio: 4/5;
}
.about-portrait::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(4,33,28,.55), transparent 55%);
}
.about-quote {
  position: absolute; bottom: 22px; right: 22px; left: 22px; z-index: 2;
  color: var(--white);
  font-family: var(--font-ar-display);
  font-size: 19px;
}
.about-text h2 { font-size: clamp(26px, 3.6vw, 36px); color: var(--petrol-900); }
.about-text p { color: var(--ink-soft); font-size: 17px; }
.about-badges { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 26px; }
.badge {
  display: flex; align-items: center; gap: 10px;
  background: var(--petrol-100); color: var(--petrol-800);
  padding: 10px 16px; border-radius: 999px; font-weight: 700; font-size: 14px;
}
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-500); }

/* ---------------- ميزات المنصة ---------------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  margin-top: 50px;
}
.feature-card {
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 30px 26px;
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease;
}
.feature-card p { color: var(--ink-soft); }
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.feature-icon {
  width: 54px; height: 54px; border-radius: 14px;
  background: linear-gradient(135deg, var(--petrol-600), var(--petrol-400));
  display: flex; align-items: center; justify-content: center;
  color: var(--white); font-size: 24px; margin-bottom: 18px;
}
.feature-card.highlight { background: linear-gradient(160deg, var(--petrol-800), var(--petrol-700)); color: var(--white); border: none; }
.feature-card.highlight .feature-icon { background: linear-gradient(135deg, var(--accent-400), var(--accent-600)); color: var(--petrol-950); }
.feature-card.highlight p { color: rgba(255,255,255,.78); }
.feature-card h3 { font-size: 19px; color: inherit; }

/* ---------------- المراحل الدراسية (Landing) ----------------
   صورة المرحلة بتظهر واضحة (من غير أي تعتيم) في شريط عرضي فوق الكارت،
   والكلام التوضيحي (الاسم والوصف والزرار) بيظهر تحت الصورة مش فوقها. */
.stages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 26px;
  margin-top: 50px;
}
.stage-card {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: box-shadow .2s, transform .2s;
}
.stage-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.stage-card .stage-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(160deg, var(--petrol-700), var(--petrol-900));
  background-size: cover;
  background-position: center;
  display: flex; align-items: center; justify-content: center;
}
.stage-card .stage-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.stage-card .stage-thumb .thumb-fallback { color: rgba(255,255,255,.5); font-size: 42px; }
.stage-card .stage-body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.stage-card .stage-meta { display: flex; gap: 8px; font-size: 12.5px; color: var(--petrol-700); font-weight: 700; }
.stage-card h3 { font-size: 21px; color: var(--petrol-900); margin: 0; }
.stage-card p { color: var(--ink-soft); font-size: 14px; margin: 0; flex: 1; }
.stage-card .btn { align-self: flex-start; margin-top: 8px; }

/* ---------------- الفوتر ---------------- */
.site-footer {
  background: var(--petrol-950);
  color: rgba(255,255,255,.75);
  padding: 60px 0 26px;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-grid h4 { color: var(--white); font-size: 16px; }
.footer-grid a { display: block; padding: 6px 0; color: rgba(255,255,255,.68); font-size: 14.5px; }
.footer-grid a:hover { color: var(--accent-400); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12);
  padding-top: 22px; text-align: center; font-size: 13.5px; color: rgba(255,255,255,.5);
}

/* ---------------- زر الواتساب العائم ---------------- */
.whatsapp-float {
  position: fixed;
  bottom: 26px;
  left: 26px;
  z-index: 400;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  box-shadow: 0 12px 28px rgba(37, 211, 102, .45);
  animation: pulse-wa 2.4s infinite;
}
@keyframes pulse-wa {
  0% { box-shadow: 0 0 0 0 rgba(37,211,102,.55); }
  70% { box-shadow: 0 0 0 16px rgba(37,211,102,0); }
  100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); }
}

/* ---------------- زر الترحيب الصوتي العائم ---------------- */
.welcome-audio-btn {
  position: fixed;
  bottom: 26px;
  right: 26px;
  z-index: 400;
  width: 52px; height: 52px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--petrol-600), var(--petrol-800));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: 0 12px 24px rgba(9, 48, 72, .4);
  transition: transform .2s ease;
}
.welcome-audio-btn:hover { transform: translateY(-2px); }
.welcome-audio-btn.is-playing { animation: pulse-wa-petrol 2.4s infinite; }
@keyframes pulse-wa-petrol {
  0% { box-shadow: 0 0 0 0 rgba(23,118,158,.55); }
  70% { box-shadow: 0 0 0 14px rgba(23,118,158,0); }
  100% { box-shadow: 0 0 0 0 rgba(23,118,158,0); }
}
@media (max-width: 640px) {
  .welcome-audio-btn { width: 46px; height: 46px; font-size: 17px; bottom: 18px; right: 18px; }
}

/* ---------------- صفحات تسجيل الدخول / التسجيل ---------------- */
.auth-wrap {
  min-height: calc(100vh - 76px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--petrol-950), var(--petrol-800));
  padding: 60px 20px;
  position: relative;
  overflow: hidden;
}
.auth-wrap::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(500px 400px at 15% 10%, rgba(44,245,176,.18), transparent 60%),
              radial-gradient(600px 500px at 90% 90%, rgba(46,168,141,.28), transparent 60%);
}
.auth-card {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 44px 40px;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-lg);
}
.auth-card h1 { font-size: 26px; color: var(--petrol-900); }
.auth-card .sub { color: var(--ink-soft); margin-bottom: 30px; font-size: 15px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; font-weight: 700; color: var(--petrol-900); margin-bottom: 7px; }
.field input, .field textarea, .field select {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 15px;
  background: var(--cream);
  transition: border-color .2s, background .2s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--petrol-500); background: var(--white);
}
.field textarea { resize: vertical; min-height: 100px; }
.field .hint { font-size: 12.5px; color: var(--ink-soft); margin-top: 6px; }

.auth-foot { text-align: center; margin-top: 22px; font-size: 14px; color: var(--ink-soft); }
.auth-foot a { color: var(--petrol-600); font-weight: 700; }

.alert {
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 14.5px;
  margin-bottom: 20px;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert-error { background: #fdecea; color: #9a2f26; border: 1px solid #f4c2bc; }
.alert-success { background: #e6f6ef; color: #146b5a; border: 1px solid #b6e6d3; }
.alert-warning { background: #fff4e0; color: #915a0c; border: 1px solid #ffdca0; }
.alert-info { background: var(--petrol-100); color: var(--petrol-800); border: 1px solid #bfe4da; }

.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.status-pending { background: #fff4e0; color: #915a0c; }
.status-approved { background: #e6f6ef; color: #146b5a; }
.status-rejected { background: #fdecea; color: #9a2f26; }

/* ---------------- لوحة الطالب / الأدمن ---------------- */
.app-shell { min-height: 100vh; background: var(--cream); }
.app-top {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 150;
}
.app-top .container { display: flex; align-items: center; justify-content: space-between; height: 74px; }
.app-user { display: flex; align-items: center; gap: 12px; }
.app-user .avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--petrol-500), var(--petrol-800));
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700;
  font-family: var(--font-en-display);
}
.app-user .name { font-weight: 700; font-size: 14.5px; color: var(--petrol-900); }
.app-user .role { font-size: 12px; color: var(--ink-soft); }

.breadcrumbs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--ink-soft); font-size: 14px; margin-bottom: 8px; }
.breadcrumbs a { color: var(--petrol-600); font-weight: 600; }
.breadcrumbs .sep { opacity: .5; }

.page-head { padding: 44px 0 10px; }
.page-head h1 { font-size: 30px; color: var(--petrol-900); }
.page-head p { color: var(--ink-soft); }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 22px; margin: 30px 0 60px; }
.dash-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 26px; box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s;
  display: flex; flex-direction: column; gap: 10px;
}
.dash-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.dash-card .num { font-family: var(--font-en-display); font-size: 30px; color: var(--petrol-700); }
.dash-card .lbl { font-weight: 700; color: var(--petrol-900); }
.dash-card .desc { font-size: 13.5px; color: var(--ink-soft); }
.dash-card.accent .num { color: var(--accent-ink); }

.term-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); gap: 22px; margin: 30px 0 60px; }
.term-card {
  background: linear-gradient(160deg, var(--petrol-700), var(--petrol-900));
  color: #fff; border-radius: var(--radius-lg); padding: 34px 28px;
  display: flex; flex-direction: column; gap: 14px; min-height: 170px; justify-content: space-between;
}
.term-card .count { font-size: 13px; color: var(--accent-400); font-weight: 700; }

.lesson-list { display: flex; flex-direction: column; gap: 12px; margin: 26px 0 60px; }
.lesson-row {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  transition: box-shadow .2s;
}
.lesson-row:hover { box-shadow: var(--shadow-sm); }
.lesson-row .lnum {
  width: 40px; height: 40px; border-radius: 8px; background: var(--petrol-100); color: var(--petrol-800);
  display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0;
  font-family: var(--font-en-display);
}
.lesson-row .lthumb {
  width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex-shrink: 0;
}
.lesson-row .ltitle { font-weight: 700; color: var(--petrol-900); flex: 1; min-width: 160px; }
.lesson-row .lmeta { display: flex; gap: 8px; font-size: 12.5px; color: var(--ink-soft); }
.chip { background: var(--cream); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }

/* شبكة كروت الدروس (كارت مربع، صورة الدرس تملأ الكارت كله، واسم الدرس ووصفه
   لازقين في أسفل نفس الكارت فوق تدرج غامق عشان يبانوا واضحين) - بتتستخدم في
   صفحة الترم للطالب المسجل وفي معاينة المرحلة العامة لأي زائر لسه مسجلش */
.lesson-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 260px)); gap: 22px; margin: 26px 0 60px; }
.lesson-card {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(160deg, var(--petrol-700), var(--petrol-900));
  display: block;
  color: inherit; text-decoration: none; transition: box-shadow .2s, transform .2s;
}
.lesson-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.lesson-card .lcard-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.lesson-card .thumb-fallback {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.4); font-size: 42px;
}
.lesson-card .lcard-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(6,20,17,0) 38%, rgba(6,20,17,.55) 68%, rgba(6,20,17,.92) 100%);
}
.lesson-card .lcard-lock {
  position: absolute; top: 10px; inset-inline-end: 10px;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(6,43,36,.75); color: var(--accent-400);
  display: flex; align-items: center; justify-content: center; font-size: 13px;
  z-index: 2;
}
.lesson-card .lcard-body {
  position: absolute; inset-inline: 0; bottom: 0; z-index: 1;
  padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 4px;
}
.lesson-card .lcard-title { font-weight: 700; color: var(--accent-400); font-size: 16px; }
.lesson-card .lcard-desc {
  font-size: 12.5px; color: rgba(255,255,255,.82); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
@media (max-width: 560px) {
  .lesson-cards { grid-template-columns: 1fr; max-width: 340px; margin-left: auto; margin-right: auto; }
}

.lesson-view { max-width: 880px; margin: 0 auto; padding: 40px 0 90px; }
.video-frame { position: relative; padding-top: 56.25%; border-radius: var(--radius-lg); overflow: hidden; background: var(--petrol-950); box-shadow: var(--shadow-md); margin-bottom: 34px; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-placeholder { display: flex; align-items: center; justify-content: center; height: 100%; color: rgba(255,255,255,.6); position: absolute; inset:0; flex-direction: column; gap: 10px; }

.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; margin: 18px 0 36px; }
.file-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.file-card .ficon { font-size: 30px; color: var(--petrol-600); }
.file-card .fname { font-size: 12.5px; color: var(--ink-soft); word-break: break-word; }
.image-card { padding: 0; overflow: hidden; }
.image-card img { width: 100%; aspect-ratio: 1; object-fit: cover; }

/* ---------------- اسأل المسيو ---------------- */
.ask-box { background: var(--white); border-radius: var(--radius-lg); border: 1px solid var(--line); padding: 30px; box-shadow: var(--shadow-sm); margin-bottom: 30px; }
.qa-item { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 22px; margin-bottom: 16px; }
.qa-q { font-weight: 700; color: var(--petrol-900); margin-bottom: 10px; }
.qa-a { background: var(--petrol-100); border-radius: var(--radius-sm); padding: 14px 16px; color: var(--petrol-900); font-size: 14.5px; }
.qa-a strong { color: var(--petrol-700); }

/* ---------------- الامتحانات ---------------- */
.exam-choice-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.exam-choice {
  display: flex; align-items: center; gap: 10px;
  background: var(--cream); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 11px 14px; font-size: 14.5px; color: var(--ink);
}
.exam-choice.selectable { cursor: pointer; transition: border-color .15s, background .15s; }
.exam-choice.selectable:hover { border-color: var(--petrol-400); }
.exam-choice input[type="radio"] { accent-color: var(--petrol-600); width: 17px; height: 17px; flex-shrink: 0; }
.exam-choice .letter {
  width: 26px; height: 26px; border-radius: 50%; background: var(--petrol-100); color: var(--petrol-800);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12.5px; flex-shrink: 0;
}
.exam-choice span:nth-last-child(2) { flex: 1; }
.exam-choice.correct { background: var(--accent-100); border-color: var(--accent-600); }
.exam-choice.wrong { background: #fdecea; border-color: #e2897d; }
.exam-choice.selectable:has(input:checked) { border-color: var(--petrol-600); background: var(--petrol-100); }
.exam-timer {
  position: sticky; top: 10px; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  background: var(--petrol-800); color: #fff;
  border-radius: var(--radius-md); padding: 14px 20px;
  font-size: 15px; font-weight: 700; margin-bottom: 18px;
  box-shadow: var(--shadow-md);
}
.exam-timer i { color: var(--accent-400); font-size: 18px; }
.exam-timer strong { font-family: var(--font-en-display); font-size: 18px; letter-spacing: .04em; }
.exam-timer.urgent { background: #c94b3f; animation: examTimerPulse 1s ease-in-out infinite; }
.exam-timer.urgent i { color: #fff; }
@keyframes examTimerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .78; }
}
.qa-meta { font-size: 12px; color: var(--ink-soft); margin-top: 10px; }

/* بطاقة "اسأل المسيو" على الصفحة الرئيسية - كليك واحد بسيط */
.ask-click-card {
  display: flex; align-items: center; gap: 26px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--radius-lg);
  padding: 34px 38px;
  transition: transform .25s ease, background .25s ease, border-color .25s ease;
}
.ask-click-card:hover { transform: translateY(-4px); background: rgba(255,255,255,.1); border-color: rgba(44,245,176,.4); }
.ask-click-icon {
  flex-shrink: 0; width: 76px; height: 76px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-400), var(--accent-600));
  color: var(--petrol-950);
  display: flex; align-items: center; justify-content: center; font-size: 32px;
}
.ask-click-text { flex: 1; min-width: 0; }
.ask-click-arrow {
  flex-shrink: 0; width: 46px; height: 46px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.35); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
@media (max-width: 700px) {
  .ask-click-card { flex-direction: column; text-align: center; padding: 30px 24px; }
  .ask-click-arrow { display: none; }
}

/* ---------------- جداول الأدمن ---------------- */
.table-wrap { background: var(--white); border-radius: var(--radius-md); border: 1px solid var(--line); overflow: auto; box-shadow: var(--shadow-sm); margin: 26px 0 50px; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
thead { background: var(--petrol-100); }
th, td { padding: 14px 18px; text-align: right; font-size: 14.5px; border-bottom: 1px solid var(--line); }
th { color: var(--petrol-900); font-weight: 700; }
tbody tr:hover { background: var(--cream); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.admin-tree { display: flex; flex-direction: column; gap: 26px; margin: 26px 0 60px; }
.admin-stage { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 26px; box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .2s; }
.admin-stage:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.admin-stage h3 { color: var(--petrol-900); }
.admin-terms { display: grid; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); gap: 16px; margin-top: 16px; }
.admin-term { background: var(--cream); border-radius: var(--radius-sm); padding: 16px; }
.admin-term h4 { font-size: 14.5px; color: var(--petrol-800); margin-bottom: 10px; }
.admin-lesson-link { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 10px; font-size: 13.5px; color: var(--ink); background: var(--white); border: 1px solid var(--line); margin-bottom: 8px; }
.admin-lesson-link:hover { box-shadow: var(--shadow-sm); border-color: var(--petrol-300, var(--line)); }

.upload-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.file-manage-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--cream); border-radius: var(--radius-sm); margin-bottom: 8px; font-size: 13.5px; }

/* ---------------- عام ---------------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-soft); }
.empty-state .icon { font-size: 40px; margin-bottom: 14px; }

[data-animate] { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
[data-animate].in-view { opacity: 1; transform: translateY(0); }

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .hero-visual img { max-height: 380px; }
  .about-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .section { padding: 60px 0; }
  .footer-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 32px 24px; }
  .whatsapp-float { width: 52px; height: 52px; font-size: 24px; bottom: 18px; left: 18px; }
}

/* ---------------- سلاسة الموبايل: منع أي اهتزاز/حركة جانبية للشاشة ---------------- */
html, body { overflow-x: hidden; max-width: 100%; }
img, iframe, video { max-width: 100%; }
@media (max-width: 600px) {
  /* خط 16px جوه أي خانة كتابة عشان Safari على الآيفون متعملش زووم تلقائي للصفحة
     وقت الكتابة في تسجيل الدخول/إنشاء الحساب، واللي بيحس المستخدم إنه "اهتزاز" في الشاشة */
  input, select, textarea, button { font-size: 16px !important; }
}

/* ---------------- بار متحرك: فلاسفة (صف) + دروس علم النفس (صف) ---------------- */
.thinkers-ribbon {
  position: relative;
  overflow: hidden;
  padding: 6px 0;
  background: linear-gradient(180deg, var(--petrol-900), var(--petrol-950));
  border-top: 1px solid rgba(113, 198, 227, .18);
  border-bottom: 1px solid rgba(113, 198, 227, .18);
  direction: ltr; /* عشان اتجاه الحركة يفضل ثابت بغض النظر عن RTL بتاع الصفحة */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
}
.tr-row { overflow: hidden; padding: 9px 0; }
.tr-row + .tr-row { border-top: 1px dashed rgba(113, 198, 227, .13); }
.tr-track {
  display: flex;
  width: max-content;
  animation: thinkersScroll 60s linear infinite;
  will-change: transform;
}
.tr-rev .tr-track { animation-direction: reverse; animation-duration: 70s; }
.thinkers-ribbon:hover .tr-track { animation-play-state: paused; }
.tr-seg { display: flex; align-items: center; flex: none; white-space: nowrap; }
.tr-seg span {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 0 20px; direction: rtl;
}
.tr-seg span::after {
  content: "✦"; color: rgba(123, 255, 211, .38); font-size: 10px; margin-right: 20px;
}
.tr-phil .tr-seg span { font-family: 'Amiri', 'Readex Pro', serif; font-size: 24px; color: var(--accent-400); }
.tr-psy .tr-seg span { font-family: var(--font-ar-display); font-size: 15.5px; font-weight: 500; color: var(--petrol-300); }
@keyframes thinkersScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (max-width: 600px) {
  .tr-phil .tr-seg span { font-size: 20px; padding: 0 14px; }
  .tr-psy .tr-seg span { font-size: 14px; padding: 0 14px; }
  .tr-track { animation-duration: 45s; }
  .tr-rev .tr-track { animation-duration: 52s; }
}
@media (prefers-reduced-motion: reduce) {
  .tr-track { animation: none; }
}

/* ---------------- الصفحة التعريفية: ثيم بترولي داكن كامل (من غير أبيض) ---------------- */
.page-landing { background: var(--petrol-950); color: var(--petrol-100); }
.page-landing .section-alt {
  background: linear-gradient(180deg, var(--petrol-900), var(--petrol-950));
}
.page-landing .section-dark {
  background: linear-gradient(160deg, var(--petrol-950), var(--petrol-900) 60%, var(--petrol-800));
}
.page-landing .eyebrow,
.page-landing .eyebrow::before { color: var(--accent-400); }
.page-landing .eyebrow::before { background: var(--accent-400); }
.page-landing .section-title,
.page-landing .about-text h2 { color: var(--white); }
.page-landing .section-sub,
.page-landing .about-text p { color: rgba(226, 244, 250, .82); }
.page-landing .about-text strong { color: var(--accent-400); }
.page-landing .about-portrait { box-shadow: 0 20px 55px rgba(0, 0, 0, .45); border: 1px solid rgba(113, 198, 227, .2); }
.page-landing .badge {
  background: rgba(44, 245, 176, .08);
  color: var(--accent-400);
  border: 1px solid rgba(44, 245, 176, .3);
}
.page-landing .feature-card {
  background: rgba(9, 48, 72, .55);
  border: 1px solid rgba(113, 198, 227, .2);
  color: var(--petrol-100);
  box-shadow: none;
}
.page-landing .feature-card p { color: rgba(226, 244, 250, .75); }
.page-landing .feature-card:hover { border-color: rgba(44, 245, 176, .45); box-shadow: 0 14px 34px rgba(0, 0, 0, .35); }
.page-landing .feature-card.highlight {
  background: linear-gradient(160deg, var(--petrol-700), var(--petrol-800));
  border: 1px solid rgba(44, 245, 176, .35);
}
.page-landing .stage-card {
  background: rgba(9, 48, 72, .55);
  border: 1px solid rgba(113, 198, 227, .2);
  box-shadow: none;
}
.page-landing .stage-card:hover { border-color: rgba(44, 245, 176, .45); box-shadow: 0 14px 34px rgba(0, 0, 0, .35); }
.page-landing .stage-card h3 { color: var(--white); }
.page-landing .stage-card p { color: rgba(226, 244, 250, .75); }
.page-landing .stage-card .stage-meta { color: var(--accent-400); }
.page-landing .btn-ghost {
  background: transparent;
  color: var(--accent-400);
  border-color: rgba(44, 245, 176, .45);
}
.page-landing .btn-ghost:hover { background: rgba(44, 245, 176, .1); color: var(--accent-400); border-color: var(--accent-400); }

/* ---------------- أوائل المنصة (الصفحة التعريفية) ---------------- */
.podium-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 26px;
  margin-top: 50px;
}
.podium-card {
  background: rgba(9, 48, 72, .55);
  border: 1px solid rgba(113, 198, 227, .2);
  border-radius: var(--radius-lg);
  padding: 28px 22px 26px;
  text-align: center;
}
.podium-card h3 { color: var(--white); font-size: 20px; margin: 0 0 4px; }
.podium-sub { color: var(--petrol-300); font-size: 13px; margin-bottom: 22px; }
.podium-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: end; direction: ltr; }
.pslot {
  direction: rtl;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 8px 14px;
  border: 1.5px dashed rgba(113, 198, 227, .3);
  border-radius: 18px;
  background: rgba(3, 20, 31, .35);
  min-height: 168px;
}
.pslot.rank-1 { min-height: 200px; border-color: rgba(44, 245, 176, .5); }
.pslot.filled { border-style: solid; background: linear-gradient(180deg, rgba(44, 245, 176, .12), rgba(3, 20, 31, .4)); }
.pslot-badge { font-size: 20px; color: rgba(113, 198, 227, .45); line-height: 1; }
.pslot.rank-1 .pslot-badge { color: #e6c15a; font-size: 24px; }
.pslot.rank-2 .pslot-badge { color: #b9c4c9; }
.pslot.rank-3 .pslot-badge { color: #c98a52; }
.pslot:not(.filled) .pslot-badge { opacity: .55; }
.pslot-avatar {
  width: 54px; height: 54px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-ar-display); font-size: 22px; font-weight: 700;
  color: rgba(226, 244, 250, .5); border: 1.5px dashed rgba(113, 198, 227, .35);
}
.pslot.filled .pslot-avatar {
  color: var(--petrol-950); border: 0;
  background: linear-gradient(135deg, var(--accent-400), var(--accent-600));
}
.pslot-name { color: rgba(226, 244, 250, .6); font-size: 13px; font-weight: 600; line-height: 1.4; }
.pslot.filled .pslot-name { color: var(--white); }
.pslot-score { direction: ltr; unicode-bidi: isolate; color: var(--accent-400); font-family: var(--font-en-display); font-size: 13px; font-weight: 600; }
@media (max-width: 420px) {
  .podium-slots { gap: 8px; }
  .pslot { padding: 14px 4px 12px; }
  .pslot-avatar { width: 44px; height: 44px; font-size: 18px; }
  .pslot-name { font-size: 12px; }
}

/* ---------------- صفحة الدرس: ثيم بترولي داكن + شريط جانبي لقايمة الدروس ---------------- */
.page-lesson { background: var(--petrol-950); color: var(--petrol-100); }
.page-lesson .app-shell {
  background:
    radial-gradient(700px 420px at 90% -5%, rgba(44, 245, 176, .10), transparent 60%),
    radial-gradient(800px 500px at 0% 100%, rgba(23, 118, 158, .22), transparent 60%),
    var(--petrol-950);
}
.page-lesson .app-top { background: rgba(3, 20, 31, .92); border-bottom: 1px solid rgba(113, 198, 227, .16); backdrop-filter: blur(8px); }
.page-lesson .app-top .brand-text strong { color: var(--white); }
.page-lesson .app-user .name { color: var(--white); }
.page-lesson .app-user .role { color: var(--petrol-300); }
.page-lesson .app-user .avatar { background: linear-gradient(135deg, var(--accent-400), var(--accent-600)); color: var(--petrol-950); }
.page-lesson .app-top .btn-ghost { background: transparent; color: var(--petrol-100); border-color: rgba(113, 198, 227, .3); }
.page-lesson .app-top .btn-ghost:hover { border-color: var(--accent-400); color: var(--accent-400); }
.page-lesson .app-top .btn-outline { color: var(--petrol-100) !important; border-color: rgba(113, 198, 227, .3) !important; }
.page-lesson .breadcrumbs { color: rgba(226, 244, 250, .6); }
.page-lesson .breadcrumbs a { color: var(--accent-400); }
.page-lesson .alert-info, .page-lesson .alert-success { background: rgba(44, 245, 176, .1); color: var(--accent-400); border-color: rgba(44, 245, 176, .3); }
.page-lesson .alert-error { background: rgba(224, 80, 60, .12); color: #ffb4a8; border-color: rgba(224, 80, 60, .35); }

.lesson-layout {
  display: flex; align-items: flex-start; gap: 24px;
  padding: 18px 0 90px;
}
.lesson-main { flex: 1 1 0; min-width: 0; }
.lesson-playlist {
  flex: 0 0 340px; width: 340px;
  position: sticky; top: 92px;
  max-height: calc(100vh - 110px);
  display: flex; flex-direction: column;
  background: rgba(9, 48, 72, .55);
  border: 1px solid rgba(113, 198, 227, .2);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.page-lesson .video-frame {
  border: 1px solid rgba(113, 198, 227, .25);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
  margin-bottom: 14px;
}
.video-watermark {
  position: absolute; top: 12px; inset-inline-end: 16px; z-index: 3;
  direction: ltr; font-size: 12px; font-weight: 600; letter-spacing: .02em;
  color: rgba(255, 255, 255, .5); text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
  pointer-events: none; user-select: none;
}
.video-fallback { margin: 0 0 18px; text-align: center; }
.video-fallback a { font-size: 12.5px; color: var(--petrol-300); }
.video-fallback a:hover { color: var(--accent-400); }

.lesson-info { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin: 6px 0 14px; }
.lesson-info h1 { font-size: clamp(22px, 2.6vw, 30px); color: var(--white); margin: 8px 0 4px; }
.lesson-tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 700; color: var(--accent-400);
  background: rgba(44, 245, 176, .08); border: 1px solid rgba(44, 245, 176, .3);
  border-radius: 999px; padding: 3px 12px;
}
.lesson-where { margin: 0; color: var(--petrol-300); font-size: 14px; }
.lesson-nav { display: flex; gap: 10px; flex-wrap: wrap; }
.page-lesson .lesson-nav .btn-ghost { background: transparent; color: var(--accent-400); border-color: rgba(44, 245, 176, .45); }
.lesson-desc { font-size: 16px; color: rgba(226, 244, 250, .82); margin: 0 0 26px; line-height: 1.9; }
.lesson-h { color: var(--white); font-size: 17px; margin: 26px 0 0; }
.lesson-h i { color: var(--accent-400); margin-inline-end: 6px; }
.lesson-empty { color: rgba(226, 244, 250, .6); font-size: 14.5px; margin: 10px 0 0; }
.page-lesson .file-card { background: rgba(9, 48, 72, .55); border-color: rgba(113, 198, 227, .2); }
.page-lesson .file-card:hover { border-color: rgba(44, 245, 176, .45); }
.page-lesson .file-card .ficon { color: var(--accent-400); }
.page-lesson .file-card .fname { color: rgba(226, 244, 250, .75); }

.pl-head { padding: 18px 18px 14px; border-bottom: 1px solid rgba(113, 198, 227, .16); }
.pl-head h2 { font-size: 18px; color: var(--white); margin: 0 0 8px; }
.pl-meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--petrol-300); margin-bottom: 8px; }
.pl-bar { height: 5px; border-radius: 5px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.pl-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-600), var(--accent-400)); border-radius: 5px; }
.pl-list { overflow-y: auto; flex: 1; scrollbar-width: thin; scrollbar-color: rgba(113, 198, 227, .3) transparent; }
.pl-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(113, 198, 227, .1);
  transition: background .2s;
}
.pl-item:last-child { border-bottom: 0; }
.pl-item:hover { background: rgba(113, 198, 227, .06); }
.pl-text { display: flex; flex-direction: column; min-width: 0; }
.pl-title { font-size: 14.5px; font-weight: 700; color: var(--petrol-100); line-height: 1.5; }
.pl-sub { font-size: 12px; color: rgba(226, 244, 250, .55); }
.pl-dot {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid rgba(113, 198, 227, .3); color: rgba(226, 244, 250, .6);
  font-size: 12.5px; font-weight: 700;
}
.pl-item.is-done .pl-dot { border-color: var(--accent-600); color: var(--accent-400); background: rgba(44, 245, 176, .08); }
.pl-item.is-now { background: rgba(44, 245, 176, .09); box-shadow: inset -3px 0 0 var(--accent-400); }
.pl-item.is-now .pl-title { color: var(--accent-400); }
.pl-item.is-now .pl-sub { color: var(--accent-400); opacity: .8; }
.pl-item.is-now .pl-dot { background: var(--accent-400); border-color: var(--accent-400); color: var(--petrol-950); font-size: 11px; }

@media (max-width: 1000px) {
  .lesson-layout { flex-direction: column; }
  .lesson-playlist { position: static; width: 100%; flex-basis: auto; max-height: 420px; }
}

/* ---------------- هيكل الطالب: شريط جانبي على اليمين + شريط علوي ---------------- */
.student-shell { display: flex; align-items: stretch; }
.s-side {
  flex: 0 0 250px; width: 250px;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px;
  padding: 20px 14px;
  background: linear-gradient(180deg, var(--petrol-950), #021019);
  border-left: 1px solid rgba(113, 198, 227, .16);
  z-index: 160;
}
.s-brand { display: flex; align-items: center; gap: 11px; padding: 0 6px 16px; margin-bottom: 8px; border-bottom: 1px solid rgba(113, 198, 227, .16); }
.s-brand .brand-text strong { color: var(--white); font-size: 16px; }
.s-brand .brand-text span { color: var(--accent-400); font-size: 11.5px; }
.s-nav { display: flex; flex-direction: column; gap: 4px; }
.s-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 12px;
  color: rgba(226, 244, 250, .72); font-weight: 600; font-size: 14.5px;
  transition: background .2s, color .2s;
}
.s-nav a i { width: 20px; text-align: center; font-size: 15px; }
.s-nav a:hover { background: rgba(113, 198, 227, .08); color: var(--white); }
.s-nav a.on {
  background: linear-gradient(270deg, rgba(44, 245, 176, .16), rgba(44, 245, 176, .03));
  color: var(--accent-400); box-shadow: inset -3px 0 0 var(--accent-400);
}
.s-badge {
  margin-inline-start: auto; background: #e0503c; color: #fff;
  font-size: 11px; font-weight: 800; min-width: 20px; height: 20px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 6px;
}
.s-status {
  margin-top: auto; padding: 15px; border-radius: 15px;
  background: linear-gradient(160deg, rgba(44, 245, 176, .14), rgba(44, 245, 176, .02));
  border: 1px solid rgba(44, 245, 176, .28);
}
.s-status b { display: block; color: var(--accent-400); font-size: 13.5px; }
.s-status p { margin: 4px 0 0; font-size: 12px; color: rgba(226, 244, 250, .65); line-height: 1.6; }

.s-main { flex: 1 1 0; min-width: 0; }
.s-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 74px; padding: 0 28px;
  position: sticky; top: 0; z-index: 140;
  background: rgba(244, 248, 249, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.s-user { display: flex; align-items: center; gap: 12px; margin-inline-start: auto; }
.s-user .avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--petrol-500), var(--petrol-800));
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-family: var(--font-en-display);
}
.s-user .name { font-weight: 700; font-size: 14.5px; color: var(--petrol-900); line-height: 1.3; }
.s-user .role { font-size: 12px; color: var(--ink-soft); }
.s-logout {
  width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); color: var(--petrol-800);
}
.s-logout:hover { border-color: var(--petrol-500); color: var(--petrol-600); }
.s-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 11px; width: 42px; height: 42px; font-size: 18px; color: var(--petrol-800); }
.s-backdrop { display: none; }
.s-main > .container { max-width: 1100px; padding: 0 28px; }

/* صفحة الدرس: الشريط العلوي داكن والمحتوى واسع */
.page-lesson .s-top { background: rgba(3, 20, 31, .88); border-bottom-color: rgba(113, 198, 227, .16); }
.page-lesson .s-user .name { color: var(--white); }
.page-lesson .s-user .role { color: var(--petrol-300); }
.page-lesson .s-user .avatar { background: linear-gradient(135deg, var(--accent-400), var(--accent-600)); color: var(--petrol-950); }
.page-lesson .s-logout { color: var(--petrol-100); border-color: rgba(113, 198, 227, .3); }
.page-lesson .s-logout:hover { border-color: var(--accent-400); color: var(--accent-400); }
.page-lesson .s-toggle { color: var(--petrol-100); border-color: rgba(113, 198, 227, .3); }
.page-lesson .s-main > .container { max-width: none; }
.page-lesson .lesson-playlist { top: 90px; max-height: calc(100vh - 108px); }

@media (max-width: 1180px) {
  .lesson-layout { flex-direction: column; }
  .lesson-playlist { position: static; width: 100%; flex-basis: auto; max-height: 440px; }
}
@media (max-width: 900px) {
  .s-side {
    position: fixed; top: 0; bottom: 0; inset-inline-start: 0; height: auto;
    transform: translateX(100%); transition: transform .3s ease; width: 270px; flex-basis: auto;
  }
  .s-side.open { transform: translateX(0); }
  .s-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 155; }
  .s-toggle { display: flex; align-items: center; justify-content: center; }
  .s-top { padding: 0 16px; }
  .s-main > .container { padding: 0 16px; }
  .s-user .role { display: none; }
}

/* ---------- إصلاحات الموبايل (هيدر الأدمن + صفحة الدرس) ---------- */
.lesson-layout > * { min-width: 0; }
.lesson-main { max-width: 100%; }
.lesson-main .video-frame, .lesson-main .video-fallback { max-width: 100%; }
@media (max-width: 900px) {
  .app-top .container { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; gap: 8px; }
  .app-user { flex-wrap: wrap; gap: 8px; width: 100%; }
  .app-user .name, .app-user .role { display: none; }
  .app-user .btn-sm { padding: 8px 12px; font-size: 13px; }
}

/* هيدر الأدمن (خلفية بيضا): اللوجو كان أبيض على أبيض فمش باين */
.app-top .brand-badge { background: var(--petrol-900); border-radius: 10px; padding: 4px 8px; }
.app-top .brand-text strong { color: var(--petrol-900); }
.page-lesson .app-top .brand-badge { background: transparent; padding: 0; }
.lesson-main .btn { max-width: 100%; white-space: normal; text-align: center; line-height: 1.5; }
