/* ==============================================================================
   AUTH SCREEN — LOGIN & LOCK SCREEN
   شاشة تسجيل الدخول الرسمية — الأبيض والأزرق الملكي القضائي المعتمد
   ============================================================================== */

/* ── Overlay يغطي الشاشة بالكامل ── */
#authOverlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0F2C59 0%, #1E3A8A 50%, #1E40AF 100%);
  overflow: hidden;
  font-family: 'Cairo', 'Tajawal', system-ui, sans-serif;
}

/* ── خلفية متحركة بدوائر ضبابية زرقاء ملكية ── */
#authOverlay::before,
#authOverlay::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  animation: authPulse 8s ease-in-out infinite alternate;
}
#authOverlay::before {
  width: 520px;
  height: 520px;
  top: -120px;
  right: -120px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.25) 0%, transparent 70%);
}
#authOverlay::after {
  width: 400px;
  height: 400px;
  bottom: -100px;
  left: -80px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.20) 0%, transparent 70%);
  animation-delay: -4s;
}

@keyframes authPulse {
  0%   { transform: scale(1);    opacity: 0.7; }
  100% { transform: scale(1.25); opacity: 1;   }
}

/* ── بطاقة الدخول البيضاء الرسمية ── */
.auth-card {
  position: relative;
  z-index: 2;
  width: min(480px, calc(100vw - 32px));
  background: #FFFFFF;
  border: 1.5px solid #CBD5E1;
  border-radius: 24px;
  padding: 44px 38px 36px;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.05),
    0 24px 60px rgba(15, 23, 42, 0.35),
    0 0 50px rgba(37, 99, 235, 0.15);
  animation: authCardIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes authCardIn {
  from { opacity: 0; transform: translateY(32px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* ── شعار وعنوان ── */
.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
  text-align: center;
}

.auth-logo-icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1E40AF 0%, #2563EB 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.35);
  animation: logoGlow 3s ease-in-out infinite alternate;
}

@keyframes logoGlow {
  0%   { box-shadow: 0 0 16px rgba(37, 99, 235, 0.25); }
  100% { box-shadow: 0 0 30px rgba(37, 99, 235, 0.45); }
}

.auth-logo-icon svg {
  width: 34px;
  height: 34px;
  stroke: #FFFFFF;
}

.auth-logo h1 {
  font-size: 20px;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: 0.01em;
  line-height: 1.35;
  margin: 0;
}

.auth-logo p {
  font-size: 12px;
  color: #2563EB;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.05em;
}

/* ── خط فاصل أزرق ملكي ── */
.auth-divider {
  width: 60px;
  height: 3px;
  background: #2563EB;
  border-radius: 3px;
  margin: 0 auto 24px;
}

/* ── مجموعة الحقول ── */
.auth-field-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field label {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  padding-right: 2px;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-wrap .auth-input-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748B;
  pointer-events: none;
  transition: color 0.16s ease;
}

.auth-input {
  width: 100%;
  padding: 12px 44px 12px 44px;
  background: #F8FAFC;
  border: 1.5px solid #CBD5E1;
  border-radius: 12px;
  color: #0F172A;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  direction: rtl;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  outline: none;
  -webkit-appearance: none;
}

.auth-input::placeholder {
  color: #94A3B8;
  font-weight: 400;
}

.auth-input:focus {
  border-color: #2563EB;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.auth-input-wrap:focus-within .auth-input-icon {
  color: #2563EB;
}

/* زر عرض/إخفاء كلمة المرور */
.auth-pass-toggle {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #64748B;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.16s;
}
.auth-pass-toggle:hover { color: #2563EB; }

/* ── رسالة الخطأ ── */
.auth-error-msg {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #FEE2E2;
  border: 1px solid #F87171;
  color: #B91C1C;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 16px;
  animation: shakeErr 0.4s ease;
}
.auth-error-msg.visible { display: flex; }

@keyframes shakeErr {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

/* ── زر الدخول ── */
.auth-submit-btn {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, #1E40AF 0%, #2563EB 100%);
  border: none;
  border-radius: 12px;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
}

.auth-submit-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #1D4ED8 0%, #1E3A8A 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(30, 58, 138, 0.35);
}

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

/* Spinner للتحميل */
.auth-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-left: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── قدم الصفحة ── */
.auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: #64748B;
  border-top: 1px solid #E2E8F0;
  padding-top: 18px;
}

.auth-footer strong {
  color: #1E40AF;
}

/* ── شريط الأمان السفلي ── */
.auth-security-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 11px;
  color: #64748B;
  font-weight: 600;
}
.auth-security-badge svg { color: #16A34A; }

/* ── Responsive ── */
@media (max-width: 520px) {
  .auth-card {
    padding: 32px 20px 28px;
    border-radius: 20px;
  }
  .auth-logo h1 { font-size: 17px; }
}
