/* =========================================================
   نموذج التسجيل — مشروع "معلم من فلسطين"
   نظام تصميم: أخضر فلسطيني عميق + أبيض دافئ + لمسات حمراء
   ========================================================= */

:root {
  --green-900: #073f24;
  --green-800: #0a5230;
  --green-700: #0d6b3f;
  --green-600: #128a51;
  --green-100: #e3f4ec;
  --red-600:   #ce1126;
  --ink:       #1c2723;
  --ink-soft:  #5c6b64;
  --paper:     #f7faf8;
  --card:      #ffffff;
  --line:      #dde7e1;
  --radius:    14px;
  --shadow:    0 10px 30px rgba(7, 63, 36, .10);
  --font:      'Tajawal', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
}

/* ---------- التخطيط المقسوم ---------- */
.split-layout {
  display: grid;
  grid-template-columns: minmax(420px, 44%) 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------- لوحة السلايدر ---------- */
.hero-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2rem 2.25rem;
  color: #fff;
  background:
    radial-gradient(1100px 600px at 85% -10%, rgba(255,255,255,.10), transparent 60%),
    linear-gradient(160deg, var(--green-800) 0%, var(--green-900) 70%);
  overflow: hidden;
}

/* نقش هندسي خفيف مستوحى من التطريز */
.hero-pattern {
  position: absolute;
  inset: 0;
  opacity: .07;
  background-image:
    repeating-linear-gradient(45deg,  #fff 0 2px, transparent 2px 18px),
    repeating-linear-gradient(-45deg, #fff 0 2px, transparent 2px 18px);
  pointer-events: none;
}

.hero-top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  font-weight: 800;
  font-size: 1.15rem;
}

.brand img {
  border-radius: 12px;
  background: rgba(255,255,255,.12);
  padding: 6px;
}

.lang-switch {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: .875rem;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px;
  padding: .3rem .95rem;
  transition: background .2s;
}
.lang-switch:hover { background: rgba(255,255,255,.15); color: #fff; }

/* السلايدر */
.slider { position: relative; padding: 2.5rem 0; }

.badge-course {
  display: inline-block;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  padding: .35rem 1.1rem;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .3px;
  margin-bottom: 1.75rem;
}

.slides { position: relative; min-height: 300px; }

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .55s ease, transform .55s ease;
  pointer-events: none;
}

.slide.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.slide-icon {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.20);
  margin-bottom: 1.4rem;
}
.slide-icon svg { width: 34px; height: 34px; }

.slide h2 {
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: .85rem;
}

.slide p {
  font-size: 1.02rem;
  line-height: 1.9;
  color: rgba(255,255,255,.86);
  max-width: 46ch;
}

/* نقاط التنقل */
.slider-nav { margin-top: .5rem; }

.dots { display: flex; gap: .5rem; }

.dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 999px;
  border: none;
  background: rgba(255,255,255,.35);
  cursor: pointer;
  transition: width .3s, background .3s;
}
.dot.active { width: 30px; background: #fff; }
.dot:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.hero-footer {
  position: relative;
  font-size: .8rem;
  color: rgba(255,255,255,.55);
}

/* ---------- لوحة النموذج ---------- */
.form-panel {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3rem 2rem;
  overflow-y: auto;
}

.form-wrap { width: 100%; max-width: 640px; }

.form-header h1 {
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  font-weight: 800;
  color: var(--green-900);
  margin-bottom: .4rem;
}

.form-header p {
  color: var(--ink-soft);
  line-height: 1.8;
  margin-bottom: 1.75rem;
}

/* الحقول */
.field-label {
  font-weight: 700;
  font-size: .92rem;
  color: var(--ink);
  margin-bottom: .4rem;
  display: inline-block;
  float: none;
  width: auto;
}

fieldset { border: 0; padding: 0; margin: 0; }
legend.field-label { font-size: .92rem; }

.req { color: var(--red-600); }
.hint { color: var(--ink-soft); font-weight: 400; }

.form-control, .form-select {
  font-family: var(--font);
  border-radius: 10px;
  border-color: var(--line);
  padding: .6rem .85rem;
  min-height: 44px;
  transition: border-color .2s, box-shadow .2s;
}

.form-control:focus, .form-select:focus {
  border-color: var(--green-600);
  box-shadow: 0 0 0 .2rem rgba(18, 138, 81, .15);
}

.form-control.is-invalid, .form-select.is-invalid { border-color: var(--red-600); }
.invalid-feedback { color: var(--red-600); font-size: .82rem; }

/* مصيدة البوتات — خارج الشاشة وليست display:none حتى تملأها البوتات */
.hp-field {
  position: absolute;
  inset-inline-start: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* صناديق رفع الصور */
.badge-req {
  background: var(--red-600);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  border-radius: 999px;
  padding: .12rem .6rem;
  vertical-align: middle;
  margin-inline-start: .35rem;
}

.upload-box {
  position: relative;
  display: block;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--card);
  min-height: 170px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .2s, background .2s;
}

.upload-box:hover, .upload-box.dragover {
  border-color: var(--green-600);
  background: var(--green-100);
}

.upload-box.is-invalid { border-color: var(--red-600); }

.upload-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: 1rem;
  text-align: center;
  color: var(--ink-soft);
}

.upload-inner svg { width: 30px; height: 30px; color: var(--green-700); }
.upload-text { font-weight: 700; font-size: .9rem; color: var(--ink); }
.upload-formats { font-size: .75rem; }

.upload-preview {
  width: 100%;
  height: 170px;
  object-fit: cover;
  display: block;
}

.upload-change {
  position: absolute;
  bottom: .5rem;
  inset-inline-start: 50%;
  transform: translateX(50%);
  background: rgba(7, 63, 36, .85);
  color: #fff;
  font-size: .78rem;
  font-weight: 500;
  border-radius: 999px;
  padding: .25rem .9rem;
  white-space: nowrap;
}
[dir="ltr"] .upload-change { transform: translateX(-50%); }

.upload-box.has-preview .upload-inner { display: none; }
.upload-box.has-preview .upload-preview,
.upload-box.has-preview .upload-change { display: block !important; }

/* زر الإرسال */
.btn-submit {
  background: linear-gradient(135deg, var(--green-700), var(--green-900));
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  border: none;
  border-radius: 12px;
  padding: .85rem 1rem;
  min-height: 52px;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s, filter .15s;
}

.btn-submit:hover:not(:disabled) {
  color: #fff;
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-submit:disabled { opacity: .75; color: #fff; }
.btn-loading { display: inline-flex; align-items: center; gap: .5rem; }

/* بطاقة النجاح */
.success-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem 2rem;
  text-align: center;
}

.success-icon {
  width: 74px;
  height: 74px;
  margin: 0 auto 1.2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green-100);
  color: var(--green-700);
}
.success-icon svg { width: 38px; height: 38px; }

.success-card h2 { font-weight: 800; color: var(--green-900); font-size: 1.3rem; }
.success-card p { color: var(--ink-soft); line-height: 1.8; }
.success-card strong { color: var(--green-700); font-size: 1.2rem; }

/* ---------- استجابة ---------- */
@media (max-width: 991.98px) {
  .split-layout { grid-template-columns: 1fr; }

  .hero-panel { min-height: auto; padding: 1.5rem 1.25rem 2rem; }
  .slider { padding: 1.5rem 0 0; }
  .slides { min-height: 260px; }
  .slide p { font-size: .95rem; }
  .hero-footer { display: none; }

  .form-panel { padding: 2rem 1.25rem 3rem; }
}

@media (max-width: 575.98px) {
  .slides { min-height: 300px; }
  .upload-box { min-height: 150px; }
  .upload-preview { height: 150px; }
}

/* تقليل الحركة لمن يفضّل ذلك */
@media (prefers-reduced-motion: reduce) {
  .slide { transition: opacity .2s linear; transform: none; }
  .btn-submit { transition: none; }
}

/* =========================================================
   الزر العائم للوحة التحكم
   ========================================================= */
.fab {
  position: fixed;
  bottom: 1.5rem;
  inset-inline-end: 1.5rem;
  z-index: 1050;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green-700), var(--green-900));
  color: #fff;
  box-shadow: 0 8px 24px rgba(7, 63, 36, .35);
  transition: transform .18s, box-shadow .18s;
}
.fab svg { width: 24px; height: 24px; }
.fab:hover {
  color: #fff;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 30px rgba(7, 63, 36, .45);
}
.fab:focus-visible { outline: 3px solid var(--green-600); outline-offset: 3px; }

/* =========================================================
   صفحة دخول المسؤول
   ========================================================= */
.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(255,255,255,.08), transparent 60%),
    linear-gradient(160deg, var(--green-800) 0%, var(--green-900) 70%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  padding: 2.5rem 2rem;
  text-align: center;
}

.login-logo { margin-bottom: 1rem; }
.login-card h1 { font-size: 1.35rem; font-weight: 800; color: var(--green-900); }
.login-card p { font-size: .9rem; margin-bottom: 1.5rem; }

.login-back {
  display: inline-block;
  margin-top: 1.25rem;
  font-size: .85rem;
  color: var(--green-700);
  text-decoration: none;
}
.login-back:hover { text-decoration: underline; }

/* =========================================================
   لوحة التحكم
   ========================================================= */
.admin-body { background: var(--paper); }

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 1040;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: .7rem 1.5rem;
  background: linear-gradient(135deg, var(--green-800), var(--green-900));
  color: #fff;
  box-shadow: 0 4px 16px rgba(7, 63, 36, .25);
}

.admin-topbar .brand { font-size: 1rem; }
.topbar-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

.admin-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 3rem;
}

.admin-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--green-900);
  margin-bottom: 1.25rem;
}

/* بطاقات الإحصائيات */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .85rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .15rem;
  border-inline-start: 4px solid var(--green-700);
}

.stat-card .stat-num { font-size: 1.6rem; font-weight: 800; color: var(--green-900); }
.stat-card .stat-label { font-size: .85rem; color: var(--ink-soft); font-weight: 500; }
.stat-pending  { border-inline-start-color: #d97706; }
.stat-approved { border-inline-start-color: var(--green-600); }
.stat-rejected { border-inline-start-color: var(--red-600); }

/* شريط الأدوات */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.filter-form {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
}

.filter-form .form-control { min-width: 220px; }
.filter-form .form-select { width: auto; min-width: 150px; }

.export-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.btn-excel, .btn-zip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-weight: 700;
  border-radius: 10px;
  color: #fff;
}
.btn-excel svg, .btn-zip svg { width: 18px; height: 18px; }
.btn-excel { background: #1d6f42; border-color: #1d6f42; }
.btn-excel:hover { background: #175a35; color: #fff; }
.btn-zip { background: #34495e; border-color: #34495e; }
.btn-zip:hover { background: #283a4b; color: #fff; }

/* الجدول */
.table-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table-scroll { overflow-x: auto; }

.admin-table { margin: 0; font-size: .875rem; min-width: 1100px; }
.admin-table thead th {
  background: var(--green-100);
  color: var(--green-900);
  font-weight: 700;
  white-space: nowrap;
  border-bottom: 2px solid var(--line);
}
.admin-table td { vertical-align: middle; }

.thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line);
  transition: transform .15s;
}
.thumb:hover { transform: scale(1.12); }

.addr-cell {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-badge {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  border-radius: 999px;
  padding: .25rem .75rem;
  white-space: nowrap;
}
.badge-pending  { background: #fef3c7; color: #92400e; }
.badge-approved { background: var(--green-100); color: var(--green-800); }
.badge-rejected { background: #fee2e2; color: #991b1b; }

.file-link {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  color: var(--green-700);
  background: var(--green-100);
  margin-inline-end: .25rem;
  transition: background .15s, color .15s;
}
.file-link svg { width: 18px; height: 18px; }
.file-link:hover { background: var(--green-700); color: #fff; }

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: .85rem 1.25rem;
  border-top: 1px solid var(--line);
  font-size: .875rem;
}

.pager { display: flex; align-items: center; gap: .6rem; }
.pager-info { font-weight: 700; color: var(--green-900); }

/* حالة الفراغ */
.empty-state {
  padding: 3.5rem 1rem;
  text-align: center;
  color: var(--ink-soft);
}
.empty-state svg { width: 44px; height: 44px; margin-bottom: .75rem; opacity: .5; }
.empty-state p { margin: 0; font-weight: 500; }

@media (max-width: 767.98px) {
  .admin-main { padding: 1.25rem 1rem 2.5rem; }
  .filter-form .form-control { min-width: 0; flex: 1 1 100%; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .export-actions .btn { flex: 1; justify-content: center; }
}
