/* ==========================================================================
   auth.css — أزرار الحساب في الهيدر + صفحات تسجيل الدخول وإنشاء الحساب
   يعتمد هوية الموقع: أزرق #2196F3، داكن #212121، خلفية #F5F5F5
   ========================================================================== */

/* ─── أزرار الحساب في الهيدر ─────────────────────────────────────────────── */
.auth-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-inline-start: 10px;
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 50px;
  padding: 6px 18px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
  text-decoration: none;
  transition: 0.3s;
}

.auth-btn i { font-size: 16px; }

.auth-btn-login {
  background: transparent;
  color: #2196F3;
  border: 2px solid #2196F3;
}

.auth-btn-login:hover {
  background: #2196F3;
  color: #fff;
}

.auth-btn-register {
  background: #212121;
  color: #fff;
  border: 2px solid #212121;
}

.auth-btn-register:hover {
  background: #2196F3;
  border-color: #2196F3;
  color: #fff;
}

/* عناصر الحساب داخل القائمة المنسدلة — مخفية على سطح المكتب، تظهر على الجوال فقط */
.nav-auth-mobile { display: none; }

@media (max-width: 991px) {
  /* إخفاء أزرار الحساب المنفصلة على الجوال ودمجها في القائمة المنسدلة */
  .auth-btns { display: none; }

  /* إظهار روابط الحساب داخل القائمة المنسدلة */
  .nav-auth-mobile { display: block; }

  /* فاصل بصري قبل أول رابط حساب داخل القائمة الداكنة */
  #navbar .ul-navbar > li:not(.nav-auth-mobile) + .nav-auth-mobile {
    border-top: 1px solid rgba(255, 255, 255, 0.18);
  }

  /* لمسة لونية لرابط "إنشاء حساب" (آخر عنصر في القائمة) */
  #navbar .ul-navbar > .nav-auth-mobile:last-child > a { color: #64B5F6; }
}



/* ─── تعويض ارتفاع الهيدر الثابت في الصفحات الداخلية ─────────────────────── */
.site-main-offset {
  padding-top: 110px;
  padding-bottom: 40px;
  background: #F5F5F5;
  min-height: calc(100vh - 260px);
}

@media (max-width: 991px) {
  .site-main-offset { padding-top: 95px; }
}

/* ─── قسم المصادقة ───────────────────────────────────────────────────────── */
.auth-section {
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  background: #fff;
  border-radius: 16px;
  padding: 24px 26px;
  box-shadow: 0 12px 40px rgba(33, 150, 243, 0.14), 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid rgba(33, 150, 243, 0.15);
}

.auth-card-wide { max-width: 720px; }

.auth-head { text-align: center; margin-bottom: 18px; }

.auth-icon {
  width: 50px;
  height: 50px;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  background: linear-gradient(135deg, #2196F3, #1976D2);
  box-shadow: 0 5px 15px rgba(33, 150, 243, 0.3);
}

.auth-title {
  font-size: 21px;
  font-weight: 700;
  color: #212121;
  margin-bottom: 4px;
}

.auth-subtitle {
  color: #6b7280;
  font-size: 13.5px;
  margin-bottom: 0;
}

/* ─── الحقول ─────────────────────────────────────────────────────────────── */
.auth-card .form-label {
  font-weight: 600;
  color: #37474F;
  font-size: var(--label-font-size, 13px);
  margin-bottom: var(--label-margin-bottom, 4px);
}

.auth-card .form-control,
.auth-card .form-select {
  border: 1.5px solid #e2e8f0;
  border-radius: var(--input-border-radius, 8px);
  padding: var(--input-padding-y, 7px) var(--input-padding-x, 12px);
  font-size: var(--input-font-size, 13.5px);
  min-height: var(--input-height, 38px);
  background: #fbfcfe;
  transition: border-color .2s, box-shadow .2s, background .2s;
}

.auth-card .form-control:focus,
.auth-card .form-select:focus {
  border-color: #2196F3;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.12);
  outline: none;
}

.auth-card textarea.form-control { resize: vertical; }

.auth-input-icon {
  position: relative;
  display: block;
}

.auth-input-icon .form-control {
  padding-left: 44px !important;
  padding-right: 14px !important;
}

.auth-input-icon .auth-toggle-eye {
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: #9aa4b2;
  padding: 6px 8px;
  cursor: pointer;
  line-height: 1;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.2s, background-color 0.2s;
}

.auth-input-icon .auth-toggle-eye:hover {
  color: #2196F3;
  background-color: rgba(33, 150, 243, 0.08);
}

.auth-hint {
  font-size: 12.5px;
  color: #8a94a6;
  margin-top: 5px;
}

/* ─── الأزرار ────────────────────────────────────────────────────────────── */
.auth-submit {
  width: 100%;
  border: 0;
  border-radius: 50px;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #2196F3, #1976D2);
  box-shadow: 0 6px 20px rgba(33, 150, 243, 0.32);
  transition: transform .2s, box-shadow .2s, background .2s;
}

.auth-submit:hover {
  background: linear-gradient(135deg, #42A5F5, #2196F3);
  box-shadow: 0 10px 26px rgba(33, 150, 243, 0.45);
  transform: translateY(-1px);
  color: #fff;
}

.auth-submit:disabled { opacity: .65; transform: none; cursor: not-allowed; }

.auth-link {
  color: #2196F3;
  font-weight: 600;
  text-decoration: none;
}

.auth-link:hover { color: #1976D2; text-decoration: underline; }

.auth-alt {
  text-align: center;
  margin-top: 22px;
  margin-bottom: 0;
  color: #6b7280;
  font-size: 14.5px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #9aa4b2;
  font-size: 13px;
  margin: 20px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e6ebf1;
}

/* ─── التنبيهات ──────────────────────────────────────────────────────────── */
.auth-alert {
  border: 0;
  border-radius: 10px;
  font-size: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.auth-alert-danger  { background: #FDECEA; color: #B3261E; }
.auth-alert-success { background: #E8F5E9; color: #2E7D32; }
.auth-alert-warning { background: #FFF4E5; color: #B26A00; }

/* ─── مقياس قوة كلمة المرور ──────────────────────────────────────────────── */
.auth-strength { margin-top: 8px; }

.auth-strength-bar {
  height: 6px;
  border-radius: 50px;
  background: #e9edf2;
  overflow: hidden;
}

.auth-strength-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 50px;
  transition: width .3s ease, background .3s ease;
}

.auth-strength-text { font-size: 12.5px; margin-top: 5px; color: #8a94a6; }

/* ظهور تدريجي لملاحظة متطلبات كلمة المرور */
#pwdRequirementsHint {
  animation: hintFadeIn .22s ease;
  overflow: hidden;
}
@keyframes hintFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* حقل غير صحيح */
.auth-card .form-control.is-invalid,
.auth-card .form-select.is-invalid {
  border-color: #e53935;
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.12);
}

/* ─── كبتشا ──────────────────────────────────────────────────────────────── */
.auth-captcha,
.captcha-wrapper {
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  background: #fbfcfe;
  padding: 14px 16px;
}

.auth-captcha-row,
.captcha-checkbox-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* إلغاء تراكب مربع الاختيار Bootstrap في RTL */
.form-check.d-flex,
.auth-captcha .form-check,
.captcha-wrapper .form-check,
.auth-captcha-row .form-check,
.captcha-checkbox-row .form-check {
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.form-check.d-flex .form-check-input,
.auth-captcha .form-check-input,
.captcha-wrapper .form-check-input,
.auth-captcha-row .form-check-input,
.captcha-checkbox-row .form-check-input {
  float: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  margin-top: 0 !important;
  flex-shrink: 0 !important;
  cursor: pointer !important;
  width: 1.2em;
  height: 1.2em;
}

.form-check.d-flex .form-check-label,
.auth-captcha .form-check-label,
.captcha-wrapper .form-check-label,
.auth-captcha-row .form-check-label,
.captcha-checkbox-row .form-check-label {
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  color: #37474F;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}

.auth-captcha .form-check-input:checked,
.captcha-wrapper .form-check-input:checked {
  background-color: #2196F3;
  border-color: #2196F3;
}

.auth-captcha-shield { color: #2196F3; font-size: 20px; opacity: .9; }

.auth-captcha-challenge {
  margin-top: 14px;
  display: none;
  flex-direction: column;
  gap: 10px;
  animation: authFade .25s ease;
}

.auth-captcha-challenge.open { display: flex; }

@keyframes authFade {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-captcha-img {
  border: 2px solid #2196F3;
  border-radius: 8px;
  overflow: hidden;
  line-height: 0;
  cursor: pointer;
  background: #fff;
}

.auth-captcha-img img {
  width: 100%;
  height: 70px;
  object-fit: fill;
  display: block;
}

.auth-captcha-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.auth-captcha-input-row input[type="text"] {
  flex: 1 1 130px;
  min-width: 0;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 16px;
  background: #fff;
  direction: ltr;
  letter-spacing: 5px;
  text-align: center;
}

.auth-captcha-input-row input[type="text"]:focus {
  border-color: #2196F3;
  box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.12);
  outline: none;
}

.auth-captcha-refresh,
.auth-captcha-verify {
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: #546E7A;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: .2s;
}

.auth-captcha-refresh:hover {
  border-color: #2196F3;
  color: #2196F3;
  background: rgba(33, 150, 243, .08);
}

.auth-captcha-verify {
  width: auto;
  padding: 0 20px;
  font-weight: 700;
  background: #212121;
  border-color: #212121;
  color: #fff;
}

.auth-captcha-verify:hover { background: #2196F3; border-color: #2196F3; color: #fff; }

.auth-captcha-verified {
  display: none;
  align-items: center;
  gap: 8px;
  color: #2E7D32;
  font-weight: 600;
  font-size: 14px;
}

.auth-captcha-verified.show { display: flex; }

/* ─── الجوال ─────────────────────────────────────────────────────────────── */
@media (max-width: 575.98px) {
  .auth-card { padding: 26px 20px; border-radius: 14px; }
  .auth-title { font-size: 21px; }
  .auth-captcha-verify { flex: 1 1 100%; height: 42px; }
}

/* ==========================================================================
   Dark / Light Mode Support — auth pages & site-main-offset
   المتغيرات مُعرَّفة هنا مباشرة — لا تعتمد على app/assets/css/style.css
   ========================================================================== */

/* ── متغيرات الوضع الفاتح (افتراضي — بدون data-theme) ───────────────────── */
:root {
    --auth-bg-main:           #f3f5f9;
    --auth-bg-secondary:      #ffffff;
    --auth-text-main:         #1e293b;
    --auth-text-muted:        #64748b;
    --auth-text-heading:      #0f172a;
    --auth-border:            rgba(15, 23, 42, 0.1);
    --auth-input-bg:          #ffffff;
    --auth-input-bg-focus:    #ffffff;
    --auth-input-border:      rgba(15, 23, 42, 0.12);
    --auth-input-color:       #1e293b;
    --auth-input-placeholder: #94a3b8;
    --auth-label-color:       #334155;
    --auth-card-bg:           linear-gradient(180deg, #ffffff, #f8fafc);
    --auth-card-border:       rgba(15, 23, 42, 0.08);
    --auth-captcha-bg:        #f8fafc;
}

/* ── متغيرات الوضع الداكن ────────────────────────────────────────────────── */
[data-theme="dark"] {
    --auth-bg-main:           #10121b;
    --auth-bg-secondary:      #1a1c28;
    --auth-text-main:     #f1f5f9;
    --auth-text-muted:    #94a3b8;
    --auth-text-heading:  #ffffff;
    --auth-border:        rgba(255, 255, 255, 0.08);
    --auth-input-bg:      #101115;
    --auth-input-bg-focus:#161720;
    --auth-input-border:  rgba(255, 255, 255, 0.1);
    --auth-input-color:   #f1f5f9;
    --auth-input-placeholder: #6b7280;
    --auth-label-color:   #e2e8f0;
    --auth-card-bg:       radial-gradient(circle at top right, #1d1e2b, #13141d);
    --auth-card-border:   rgba(255, 255, 255, 0.06);
    --auth-captcha-bg:    rgba(255, 255, 255, 0.03);
}

/* ── الخلفية الرئيسية للصفحات الداخلية ─────────────────────────────────── */
.site-main-offset {
    background: var(--auth-bg-main, #F5F5F5) !important;
    color: var(--auth-text-main, #212121);
    transition: background 0.3s ease, color 0.3s ease;
}

/* ── قسم المصادقة ────────────────────────────────────────────────────────── */
.auth-section {
    background: transparent;
}

/* ── البطاقة ─────────────────────────────────────────────────────────────── */
.auth-card {
    background: var(--auth-card-bg, #fff) !important;
    border-color: var(--auth-card-border, rgba(33,150,243,0.15)) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0,0,0,0.06);
    transition: background 0.3s ease, border-color 0.3s ease;
}

/* ── العناوين والنصوص ────────────────────────────────────────────────────── */
.auth-title {
    color: var(--auth-text-heading, #212121);
    transition: color 0.3s ease;
}

.auth-subtitle {
    color: var(--auth-text-muted, #6b7280);
    transition: color 0.3s ease;
}

.auth-alt {
    color: var(--auth-text-muted, #6b7280);
    transition: color 0.3s ease;
}

/* ── التسميات ────────────────────────────────────────────────────────────── */
.auth-card .form-label {
    color: var(--auth-label-color, #37474F);
    transition: color 0.3s ease;
}

/* ── حقول الإدخال ────────────────────────────────────────────────────────── */
.auth-card .form-control,
.auth-card .form-select {
    background: var(--auth-input-bg, #fbfcfe) !important;
    border-color: var(--auth-input-border, #e2e8f0) !important;
    color: var(--auth-input-color, #212121) !important;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.2s;
}

.auth-card .form-control::placeholder,
.auth-card .form-select::placeholder {
    color: var(--auth-input-placeholder, #94a3b8) !important;
}

.auth-card .form-control:focus,
.auth-card .form-select:focus {
    background: var(--auth-input-bg-focus, #fff) !important;
    border-color: #2196F3 !important;
}

/* ── فاصل ─────────────────────────────────────────────────────────────────── */
.auth-divider {
    color: var(--auth-text-muted, #9aa4b2);
}
.auth-divider::before,
.auth-divider::after {
    background: var(--auth-border, #e6ebf1);
}

/* ── زر إظهار كلمة المرور ──────────────────────────────────────────────── */
.auth-input-icon .auth-toggle-eye {
    color: var(--auth-text-muted, #9aa4b2);
}

/* ── CAPTCHA ─────────────────────────────────────────────────────────────── */
.auth-captcha {
    background: var(--auth-captcha-bg, #f8fafc);
    border-color: var(--auth-border, #e0e0e0);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.auth-captcha-row {
    color: var(--auth-text-main, #424242);
}
.auth-captcha-row .form-check-label {
    color: var(--auth-text-main, #424242);
}

.auth-captcha-challenge {
    border-top-color: var(--auth-border, #e0e0e0);
    background: var(--auth-bg-main, #f5f5f5);
    transition: background 0.3s, border-color 0.3s;
}

.auth-captcha-input-row input {
    background: var(--auth-input-bg, #fff) !important;
    border-color: var(--auth-input-border, #e2e8f0) !important;
    color: var(--auth-input-color, #212121) !important;
    transition: background 0.3s, border-color 0.3s, color 0.3s;
}

.auth-captcha-verified {
    color: var(--auth-text-main, #424242);
}

/* ── شريط قوة كلمة المرور ────────────────────────────────────────────────── */
.auth-strength-bar {
    background: var(--auth-border, #e0e0e0);
    transition: background 0.3s;
}
.auth-strength-text {
    color: var(--auth-text-muted, #8a9ab5);
    transition: color 0.3s;
}

/* ── Breadcrumb & News Styles ────────────────────────────────────────────── */
.news-breadcrumb {
    color: var(--auth-text-muted, #888);
}
.news-breadcrumb a {
    color: #2196F3;
}
.news-breadcrumb a:hover {
    color: var(--auth-text-heading, #212121);
}
.news-title-page {
    color: var(--auth-text-heading, #212121);
    transition: color 0.3s;
}
.news-meta {
    border-bottom-color: var(--auth-border, #E0E0E0);
    transition: border-color 0.3s;
}
.news-meta span {
    color: var(--auth-text-muted, #888);
    transition: color 0.3s;
}
.news-summary-box {
    background: var(--auth-bg-secondary, linear-gradient(135deg,#E3F2FD,#F5F5F5));
    border-right-color: #2196F3;
    color: var(--auth-text-main, #424242);
    transition: background 0.3s, color 0.3s;
}
.news-content-body {
    color: var(--auth-text-main, #444);
    transition: color 0.3s;
}
.news-content-body h2,
.news-content-body h3 {
    color: var(--auth-text-heading, #212121);
    transition: color 0.3s;
}
.back-section {
    border-top-color: var(--auth-border, #E0E0E0);
    transition: border-color 0.3s;
}
.news-gallery-title {
    color: var(--auth-text-heading, #212121);
    font-weight: 700;
    transition: color 0.3s;
}

/* ── الوضع الداكن: تعديلات إضافية ────────────────────────────────────────── */
[data-theme="dark"] .news-summary-box {
    background: rgba(33, 150, 243, 0.07);
}
[data-theme="dark"] .news-hero {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
[data-theme="dark"] .news-gallery a {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
[data-theme="dark"] .btn-back-home {
    background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
    border: 1px solid rgba(255,255,255,0.1);
    color: #e2e8f0;
    box-shadow: none;
}
[data-theme="dark"] .btn-back-home:hover {
    background: #2196F3;
    border-color: #2196F3;
    color: #fff;
    box-shadow: 0 8px 24px rgba(33,150,243,0.35);
}
[data-theme="dark"] .auth-card {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0,0,0,0.3);
}
[data-theme="dark"] .auth-input-icon .auth-toggle-eye:hover {
    color: #60a5fa;
    background-color: rgba(96, 165, 250, 0.1);
}

/* ── الوضع الفاتح: overrides إضافية ─────────────────────────────────────── */
[data-theme="light"] .site-main-offset {
    background: #f3f5f9 !important;
}
[data-theme="light"] .auth-card {
    background: #ffffff !important;
    box-shadow: 0 12px 40px rgba(33,150,243,0.1), 0 2px 8px rgba(0,0,0,0.04);
}
[data-theme="light"] .news-summary-box {
    background: linear-gradient(135deg, #E3F2FD, #F5F5F5);
}
