/* ═══════════════════════════════════════════════════════════════
   منطقة الطالب — كورس صناعة الفيديوهات بالذكاء الاصطناعي
   Mobile-first · RTL · داكن · سينمائي · أخضر
   ═══════════════════════════════════════════════════════════════ */

/* ───────────────────────────────────────────────
   ١) التوكِنز

   ⚠️ منسوخة حرفياً من ../styles.css عشان منطقة الطالب تضل
   ملف مستقل بلا تبعية لصفحة الهبوط. لو غيّرت لون أو خط هناك،
   غيّره هون كمان — هدول المكانين الوحيدين.
─────────────────────────────────────────────── */
:root {
  color-scheme: dark;

  /* ── البالِت الخضراء (حول لون البراند #3d4a25) ── */
  --g-950: #080d04;
  --g-900: #0d1607;
  --g-850: #121e09;
  --g-800: #17280c;
  --g-700: #1e3410;
  --g-600: #284214;
  --g-brand: #3d4a25;
  --g-500: #4a5c2c;
  --g-400: #6b8244;
  --g-300: #8fa863;
  --g-200: #b4c98d;
  --g-100: #d8e3bd;
  --g-50: #eef3e0;

  /* ── النص ── */
  --text: #ffffff;
  --text-soft: rgba(238, 243, 224, 0.78);
  --text-mute: rgba(238, 243, 224, 0.64);

  /* ── accent ── */
  --accent: #e8bc4e;
  --accent-hover: #f3d075;
  --accent-ink: #14200a;

  /* ── حدود وأسطح ── */
  --line: rgba(216, 227, 189, 0.16);
  --line-strong: rgba(216, 227, 189, 0.3);
  --surface: rgba(216, 227, 189, 0.08);

  /* ── الخطوط ── */
  --font-display: 'Alexandria', system-ui, sans-serif;
  --font-body: 'Almarai', 'Alexandria', system-ui, sans-serif;

  /* ── التخطيط ── */
  --pad: 1.25rem;
  --max: 75rem;
  --radius: 14px;
}

@media (min-width: 768px) {
  :root {
    --pad: 2.5rem;
  }
}

/* ───────────────────────────────────────────────
   ٢) الأساس
─────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* تمنع انتشار خلفية body للـcanvas، وتغطي منطقة الـoverscroll */
  background-color: var(--g-950);
}

/* نفس تدرّج صفحة الهبوط — خلفية عادية بتتحرك مع الصفحة،
   بلا position: fixed وبلا JS. التوهّجان مثبّتان بوحدات rem
   عشان يضلوا قرب أعلى الصفحة مهما طالت. */
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text-soft);
  background-color: var(--g-950);
  background-image:
    radial-gradient(70rem 50rem at 78% -8rem, rgba(107, 130, 68, 0.5), transparent 62%),
    radial-gradient(55rem 45rem at 8% 17rem, rgba(61, 74, 37, 0.62), transparent 65%),
    linear-gradient(180deg, var(--g-800) 0%, var(--g-900) 45%, var(--g-950) 100%);
  background-repeat: no-repeat;
  min-height: 100vh;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

/* ───────────────────────────────────────────────
   ٣) الشريط العلوي
─────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 13, 4, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--max);
  margin-inline: auto;
  padding: 0.875rem var(--pad);
}

.topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  min-width: 0; /* عشان يشتغل الـellipsis جوّا flex */
}

.topbar__mark {
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
}

.topbar__name {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__slogan {
  display: none;
  font-size: 0.8125rem;
  color: var(--text-mute);
  white-space: nowrap;
}

/* الجهة المقابلة للوغو */
.topbar__actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 1rem;
}

/* خافت عن قصد: الخروج مش الشي اللي بدنا العين تروح عليه.
   بيوضح بالهوفر والتركيز وبس. */
.topbar__logout {
  flex: none;
  /* الحشو بيكبّر مساحة اللمس، والهامش السالب بيلغي أثره على
     الارتفاع — الشريط بيضل بنفس علوّه. بلا هالتوازن الزر
     بيصير ١٤ بكسل بالطول وصعب تضربه بالإصبع. */
  padding: 0.75rem 0.35rem;
  margin-block: -0.75rem;
  margin-inline-start: -0.35rem;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.75rem;
  color: var(--text-mute);
  cursor: pointer;
  white-space: nowrap;
  opacity: 0.75;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.topbar__logout:hover,
.topbar__logout:focus-visible {
  color: var(--text);
  opacity: 1;
}

.topbar__logout[disabled] {
  cursor: default;
  opacity: 0.4;
}

@media (min-width: 768px) {
  .topbar__name {
    font-size: 0.9375rem;
  }
  .topbar__slogan {
    display: inline;
  }
  .topbar__logout {
    font-size: 0.8125rem;
  }
}

/* ───────────────────────────────────────────────
   ٤) لوحة المتابعة
─────────────────────────────────────────────── */
.resume {
  max-width: var(--max);
  margin-inline: auto;
  padding: 2.5rem var(--pad) 0;
}

.resume__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5.5vw, 2.25rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.resume__sub {
  margin: 0.5rem 0 0;
  font-size: 0.9375rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--text-soft);
}

.resume__progress {
  margin-top: 1.75rem;
  padding: 1.125rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.progress__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.progress__label {
  font-size: 0.8125rem;
  color: var(--text-mute);
}

.progress__value {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.progress {
  margin-top: 0.75rem;
  height: 0.5rem;
  border-radius: 999px;
  background: rgba(8, 13, 4, 0.55);
  overflow: hidden;
}

.progress__fill {
  width: 0; /* بيتعبّى من الـJS */
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--g-400), var(--accent));
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.progress__note {
  margin: 0.625rem 0 0;
  font-size: 0.75rem;
  color: var(--text-mute);
}

/* ── زر «كمّل من وين وقفت» ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding: 0.875rem 1.5rem;
  border: 0;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--accent);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.btn:hover {
  background: var(--accent-hover);
}

.btn:active {
  transform: scale(0.985);
}

.btn__icon {
  font-size: 1.125rem;
  line-height: 1;
  /* المثلث رمز لاتيني الاتجاه — بنعكسه يدوياً ليشير لليسار بالـRTL */
  transform: scaleX(-1);
}

.btn__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.35;
}

.btn__sub {
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.75;
  max-width: 15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ───────────────────────────────────────────────
   ٥) الأقسام
─────────────────────────────────────────────── */
.course {
  max-width: var(--max);
  margin-inline: auto;
  padding: 0 var(--pad) 4rem;
}

.section {
  margin-top: 3rem;
}

.section__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.875rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--line);
}

.section__index {
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.6875rem;
  color: var(--g-200);
  white-space: nowrap;
}

.section__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 4.5vw, 1.75rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.section__count {
  margin-inline-start: auto;
  font-size: 0.75rem;
  color: var(--text-mute);
  white-space: nowrap;
}

/* ───────────────────────────────────────────────
   ٦) الشبكة والبطاقات
─────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: 1fr; /* عمود واحد على الموبايل */
  gap: 1.25rem;
  margin-top: 1.25rem;
}

@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  text-decoration: none;
  transition:
    transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.25s ease,
    background-color 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  background: rgba(216, 227, 189, 0.13);
}

/* ── الثامبنيل ──
   النسبة مقفولة 16:9 والصورة cover — أي لقطة حقيقية بأي مقاس
   بتنقص من حوافها بدل ما تكسر ارتفاع الشبكة. */
.card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--g-850);
  overflow: hidden;
}

.card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.card:hover .card__img {
  transform: scale(1.045);
}

/* تعتيم خفيف بأسفل الثامبنيل — بيربطه بلون الصفحة */
.card__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8, 13, 4, 0.45), transparent 55%);
  pointer-events: none;
}

.card__play {
  position: absolute;
  inset-block-end: 0.75rem;
  inset-inline-end: 0.75rem;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: rgba(8, 13, 4, 0.6);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1;
  transform: scaleX(-1); /* المثلث يشير لليسار بالـRTL */
  transition: background-color 0.25s ease;
}

.card:hover .card__play {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}

/* ── علامة «مكتمل» ── */
.card__badge {
  position: absolute;
  inset-block-start: 0.75rem;
  inset-inline-start: 0.75rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(8, 13, 4, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--g-100);
}

/* ⚠️ ضروري: الشارة موجودة بكل بطاقة وبتنخفى بخاصية hidden.
   بس قاعدة display فوق بتغلب قاعدة المتصفح [hidden]{display:none}
   لأنها أعلى نوعيّة — فالشارة كانت بتظهر على **كل** درس وكأنه
   مكتمل. أي عنصر بينخفى بـhidden ومعطى له display لازم هالسطر. */
.card__badge[hidden] {
  display: none;
}

.card__check {
  display: grid;
  place-items: center;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: var(--g-400);
  color: var(--g-950);
  font-size: 0.6rem;
  line-height: 1;
}

/* الدرس المكتمل أخفت شوي — بيوجّه العين للدروس الجاية */
.card.is-done .card__img {
  opacity: 0.62;
}

.card.is-done:hover .card__img {
  opacity: 0.8;
}

.card__body {
  padding: 0.875rem 1rem 1.125rem;
}

.card__num {
  font-family: var(--font-display);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--g-300);
}

.card__title {
  margin: 0.3rem 0 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
}

/* ═══════════════════════════════════════════════════════════════
   صفحة الدرس (lesson.html)
   ═══════════════════════════════════════════════════════════════ */
.lesson {
  max-width: 60rem; /* أضيق من القائمة — سطر القراءة يضل مريح */
  margin-inline: auto;
  padding: 1.5rem var(--pad) 3.5rem;
}

/* ── الشريط العلوي: رابط الرجوع ── */
.topbar__back {
  flex: none;
  font-size: 0.8125rem;
  color: var(--text-mute);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.topbar__back:hover {
  color: var(--text);
}

/* ── ١) breadcrumb ── */
.crumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-mute);
}

.crumb__link {
  color: var(--g-200);
  text-decoration: none;
}

.crumb__link:hover {
  text-decoration: underline;
}

.crumb__sep {
  opacity: 0.5;
}

.crumb__current {
  color: var(--text-soft);
}

/* ── ٢) المشغّل ──
   الحاوية بتحجز نسبة 16:9 والـiframe مطلق جوّاها، فما في
   قفزة بالتخطيط وقت ما يحمّل الفيديو. */
.player {
  position: relative;
  aspect-ratio: 16 / 9;
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--g-950);
  overflow: hidden;
}

.player__frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ── placeholder: الدرس لسّه ما انصوّر ── */
.player__soon {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 1.5rem;
  text-align: center;
  background:
    radial-gradient(40rem 30rem at 50% 0%, rgba(61, 74, 37, 0.55), transparent 65%),
    var(--g-900);
}

.player__soon-icon {
  font-size: 2rem;
  line-height: 1;
  opacity: 0.85;
}

.player__soon-title {
  margin: 0.5rem 0 0;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
}

.player__soon-text {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-mute);
  max-width: 32ch;
}

/* دوّارة تجهيز الفيديو */
.player__spinner {
  width: 1.5rem;
  height: 1.5rem;
  margin-bottom: 0.875rem;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: login-spin 0.7s linear infinite;
}

.player__retry {
  margin-top: 1.125rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.875rem;
}

/* ── ٣) العنوان والوصف ── */
.lesson__head {
  margin-top: 1.5rem;
}

.lesson__num {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--g-300);
}

.lesson__title {
  margin: 0.4rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5.5vw, 2.25rem);
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}

.lesson__desc {
  margin: 0.875rem 0 0;
  font-size: 0.9375rem;
  font-weight: 300;
  line-height: 1.85;
  color: var(--text-soft);
}

/* ── ٤) الموارد ── */
.block {
  margin-top: 2.25rem;
}

.block__title {
  margin: 0 0 0.875rem;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}

.res {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.res__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.9375rem;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.res__link:hover {
  border-color: var(--line-strong);
  background: rgba(216, 227, 189, 0.13);
  color: var(--text);
}

.res__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: rgba(8, 13, 4, 0.5);
  color: var(--g-200);
  font-size: 0.8rem;
}

/* ── ٥) الواجب — الصندوق الوحيد بلون البراند ── */
.homework {
  margin-top: 2.25rem;
  padding: 1.25rem 1.375rem;
  border: 1px solid rgba(143, 168, 99, 0.35);
  border-inline-start: 3px solid var(--g-400);
  border-radius: var(--radius);
  background: linear-gradient(
    180deg,
    rgba(61, 74, 37, 0.55),
    rgba(61, 74, 37, 0.28)
  );
}

.homework__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.homework__icon {
  color: var(--g-200);
  font-size: 1rem;
}

.homework__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
}

.homework__text {
  margin: 0.625rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.85;
  color: var(--text-soft);
}

/* ── ٦) زر تعليم كمكتمل ── */
.lesson__actions {
  margin-top: 2.25rem;
}

.lesson__hint {
  margin: 0.625rem 0 0;
  font-size: 0.75rem;
  color: var(--text-mute);
}

.btn--ghost {
  margin-top: 0;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
}

.btn--ghost:hover {
  background: var(--surface);
}

.btn--ghost.is-done {
  border-color: transparent;
  background: var(--g-400);
  color: var(--g-950);
}

.btn--ghost.is-done:hover {
  background: var(--g-300);
}

/* ── ٧) التنقّل بين الدروس ── */
.lessonnav {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 2.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}

@media (min-width: 640px) {
  .lessonnav {
    grid-template-columns: 1fr 1fr;
  }
}

.lessonnav__item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.lessonnav__item:hover {
  border-color: var(--line-strong);
  background: rgba(216, 227, 189, 0.13);
  transform: translateY(-2px);
}

/* «التالي» بيتحاذى لليسار — عكس اتجاه القراءة، زي أي واجهة RTL */
.lessonnav__item--next {
  text-align: left;
  align-items: flex-end;
}

.lessonnav__dir {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-mute);
}

.lessonnav__arrow {
  font-size: 0.875rem;
}

.lessonnav__title {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
}

.lessonnav__item.is-disabled {
  opacity: 0.4;
}

.lessonnav__item.is-disabled .lessonnav__title {
  font-weight: 400;
  color: var(--text-mute);
}

/* ── حالة: الدرس مش موجود ── */
.notice {
  margin: 3rem auto;
  padding: 2.5rem 1.5rem;
  max-width: 30rem;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.notice__icon {
  font-size: 1.75rem;
}

.notice__title {
  margin: 0.75rem 0 0;
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text);
}

.notice__text {
  margin: 0.5rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.8;
  color: var(--text-soft);
}

/* ═══════════════════════════════════════════════════════════════
   صفحة الدخول (login.html)
   ═══════════════════════════════════════════════════════════════ */
.login-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.login {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 26rem;
  margin-inline: auto;
  padding: 3rem var(--pad) 4rem;
  text-align: center;
}

.login__state {
  width: 100%;
}

.login__state[hidden] {
  display: none;
}

.login__icon {
  font-size: 2rem;
  line-height: 1;
}

.login__title {
  margin: 1rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 5.5vw, 1.875rem);
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}

.login__sub {
  margin: 0.75rem 0 0;
  font-size: 0.9375rem;
  font-weight: 300;
  line-height: 1.85;
  color: var(--text-soft);
}

.login__muted {
  margin: 1.25rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.8;
  color: var(--text-mute);
}

.login__spinner {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: login-spin 0.7s linear infinite;
}

@keyframes login-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── الفورم ── */
.login__form {
  margin-top: 1.75rem;
  text-align: start;
}

.login__label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-mute);
}

.login__input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 13, 4, 0.5);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.login__input::placeholder {
  color: rgba(238, 243, 224, 0.35);
}

.login__input:focus {
  outline: none;
  border-color: var(--accent);
}

/* تنبيه أعلى الصفحة — سبب التحويل من الميدلوير */
.login__notice {
  margin: 0 0 1.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(240, 163, 163, 0.3);
  border-radius: 10px;
  background: rgba(240, 163, 163, 0.08);
  font-size: 0.8125rem;
  line-height: 1.7;
  color: #f0c0c0;
}

.login__notice[hidden] {
  display: none;
}

.login__error {
  margin: 0.625rem 0 0;
  font-size: 0.8125rem;
  color: #f0a3a3;
}

.login__error[hidden] {
  display: none;
}

.login__submit {
  width: 100%;
  margin-top: 1.25rem;
}

/* زر نصّي داخل سطر */
.login__link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--g-200);
  font-family: inherit;
  font-size: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.login__link:hover {
  color: var(--text);
}

/* ── حالة التحميل على الزر ── */
.btn.is-loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1.125rem;
  height: 1.125rem;
  border: 2px solid rgba(20, 32, 10, 0.25);
  border-top-color: var(--accent-ink);
  border-radius: 50%;
  animation: login-spin 0.7s linear infinite;
}

/* ───────────────────────────────────────────────
   ٧) التذييل
─────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--line);
  padding: 2rem var(--pad);
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.875rem;
  color: var(--text-mute);
}

.footer__em {
  color: var(--g-200);
}

/* ── الروابط القانونية ──
   Paddle بيفحص وجودها عند اعتماد الحساب، فلازم تكون ظاهرة
   وقابلة للنقر — مش مخفية خلف قائمة. */
.footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem 1.35rem;
  margin-top: 1.25rem;
}

.footer__link {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--text-mute);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer__link:hover,
.footer__link:focus-visible {
  color: var(--text);
  text-decoration: underline;
}

/* ───────────────────────────────────────────────
   ٨) إتاحة
─────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
