/* ============================================================================
   طيف (tayf) — شاشات الدخول والتسجيل ونسيت كلمة السر (Auth Screens)
   ============================================================================
   ملف منفصل عن main.css عمدًا: شاشات المصادقة (login/register/forgot-password)
   لها هوية بصرية مختلفة عن باقي الموقع (لا يوجد فيها Sidebar ولا Topbar ولا
   Footer — فقط شاشة مقسومة نصفين + زرّي هوم/لغة ثابتين، بنفس تصميم شاشة
   التسجيل الفعلية في tayf.ae). الخط Tajawal — نفس خط باقي الموقع بالضبط
   (قرار نهائي: لا يتغيّر بأي شاشة حالية أو مستقبلية بهذا المشروع).
   ============================================================================ */

* ,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.auth-body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-primary);
  font-family: var(--font-primary);
  color: var(--color-ink-900);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a {
  text-decoration: none;
  color: inherit;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* -------------------------- زرّا الهوم/اللغة الثابتان -------------------------- */
.auth-fixed-actions {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 8px;
  z-index: 100;
}

.auth-fixed-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-brand-blue);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-fast);
}

.auth-fixed-btn:hover {
  transform: translateY(-2px);
}

.auth-fixed-btn svg {
  width: 20px;
  height: 20px;
}

/* -------------------------------- الشاشة المقسومة --------------------------------
   على الجوال: عمود واحد — لوحة الصورة أولًا (شريط علوي بارتفاع محدود) ثم لوحة
   النموذج تحتها. من 900px فأكثر: صف كامل الارتفاع (لوحة نموذج + لوحة صورة
   جنبًا إلى جنب)، بنفس تقسيم الشاشة الفعلية في tayf.ae. */
.auth-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.auth-form-panel {
  order: 2;
  width: 100%;
  background: var(--color-primary);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 28px 20px 40px;
}

.auth-form-card {
  width: 100%;
  max-width: 420px;
}

/* شارة صغيرة فوق العنوان — تُستخدم بشاشات لوحة الأدمن لتمييزها ("لوحة الإدارة") */
.auth-eyebrow {
  display: block;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--color-ink-900);
  background: rgba(20, 20, 28, 0.08);
  border-radius: var(--radius-full);
  padding: 6px 16px;
  width: fit-content;
  margin: 0 auto var(--space-4);
  letter-spacing: 0.3px;
}

.auth-title {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: var(--space-2);
}

.auth-subtitle {
  text-align: center;
  color: rgba(20, 20, 28, 0.65);
  margin-bottom: var(--space-6);
  font-size: 0.92rem;
}

/* -------------------------------- الحقول -------------------------------- */
.auth-form-group {
  margin-bottom: var(--space-5);
  text-align: center;
}

.auth-label {
  display: block;
  text-align: center;
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 0.92rem;
}

.auth-input,
.auth-select {
  width: 100%;
  text-align: center;
  border: 2px solid rgba(20, 20, 28, 0.15);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--color-white);
  color: var(--color-ink-900);
  transition: border-color var(--transition-fast);
}

.auth-input:focus,
.auth-select:focus {
  outline: none;
  border-color: var(--color-brand-blue);
}

.auth-input::placeholder {
  color: var(--color-gray-500);
  text-align: center;
}

/* -------------------------------- حقل رقم الهاتف (واتساب) --------------------------------
   طريقة موحّدة لكل حقول رقم الهاتف بالمشروع: مفتاح الدولة الدولي ثابت في
   أقصى يسار الحقل (بغض النظر عن اتجاه الصفحة، لأن أرقام الهاتف بيانات LTR
   دائمًا)، ثم إدخال الرقم بعده من اليسار لليمين. */
.phone-input-group {
  display: flex;
  align-items: stretch;
  direction: ltr;
  border: 2px solid rgba(20, 20, 28, 0.15);
  border-radius: var(--radius-md);
  background: var(--color-white);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.phone-input-group:focus-within {
  border-color: var(--color-brand-blue);
}

.phone-code-select {
  border: none;
  border-inline-end: 2px solid rgba(20, 20, 28, 0.15);
  background: var(--color-bg-alt);
  padding: 0 10px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--color-ink-900);
  flex-shrink: 0;
}

.phone-code-select:focus {
  outline: none;
}

.phone-number-input {
  flex: 1;
  min-width: 0;
  direction: ltr;
  text-align: left;
  border: none;
  padding: 12px 16px;
  font-size: 1rem;
  font-family: inherit;
  background: transparent;
  color: var(--color-ink-900);
}

.phone-number-input:focus {
  outline: none;
}

.phone-number-input::placeholder {
  color: var(--color-gray-500);
}

/* -------------------------------- الأزرار والروابط -------------------------------- */
.auth-btn {
  width: 100%;
  background: var(--color-brand-blue);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius-md);
  padding: 14px;
  font-weight: 700;
  font-size: 1rem;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
}

.auth-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(49, 100, 245, 0.3);
}

.auth-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.auth-link-row {
  text-align: center;
  margin-top: var(--space-5);
  font-size: 0.9rem;
  color: rgba(20, 20, 28, 0.75);
}

.auth-link-row a {
  color: var(--color-brand-blue);
  font-weight: 700;
}

.auth-link-row a:hover {
  text-decoration: underline;
}

.auth-forgot-link {
  display: block;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-brand-blue);
  margin-top: -8px;
  margin-bottom: var(--space-6);
}

.auth-forgot-link:hover {
  text-decoration: underline;
}

/* -------------------------------- إقرار الشروط (التسجيل) -------------------------------- */
.auth-checkbox-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(20, 20, 28, 0.75);
  margin-bottom: var(--space-6);
}

.auth-checkbox-row input {
  margin-top: 3px;
  accent-color: var(--color-brand-blue);
  flex-shrink: 0;
}

.auth-checkbox-row a {
  color: var(--color-brand-blue);
  font-weight: 700;
}

.auth-checkbox-row a:hover {
  text-decoration: underline;
}

/* -------------------------------- لوحة الصورة --------------------------------
   على الجوال: شريط علوي بارتفاع ثابت (220px). من 900px فأكثر: تأخذ باقي
   عرض الشاشة بكامل الارتفاع، جنب لوحة النموذج. */
.auth-image-panel {
  order: 1;
  position: relative;
  overflow: hidden;
  height: 220px;
  flex-shrink: 0;
}

.auth-image-panel img.auth-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.auth-image-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

/* الأيقونة والشعار بجانب النص أفقيًا (وليس فوقه) — نفس ترتيب الشاشة الفعلية */
.auth-image-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  text-align: start;
  padding: var(--space-5);
}

.auth-image-content img {
  width: 130px;
  flex-shrink: 0;
}

.auth-image-tagline {
  color: var(--color-white);
  font-size: 1rem;
  font-weight: 700;
  max-width: 220px;
}

@media (min-width: 900px) {
  .auth-page {
    flex-direction: row;
  }

  .auth-form-panel {
    order: 0;
    width: 42%;
    min-width: 420px;
    min-height: 100vh;
    align-items: center;
    padding: 64px 24px;
  }

  .auth-image-panel {
    order: 0;
    flex: 1;
    height: auto;
    min-height: 100vh;
  }

  .auth-image-content {
    gap: var(--space-4);
  }

  .auth-image-content img {
    width: 190px;
  }

  .auth-image-tagline {
    font-size: 1.2rem;
    max-width: 260px;
  }
}

/* -------------------------------- خطوات متعددة (نسيت كلمة السر) -------------------------------- */
.auth-step {
  display: none;
}

.auth-step.active {
  display: block;
}

.auth-step-indicator {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.auth-step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(20, 20, 28, 0.12);
  color: var(--color-ink-900);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.auth-step-dot.active,
.auth-step-dot.done {
  background: var(--color-ink-900);
  color: var(--color-primary);
}

.auth-step-line {
  width: 28px;
  height: 2px;
  background: rgba(20, 20, 28, 0.15);
  flex-shrink: 0;
}

/* -------------------------------- حقول رمز التحقق (OTP) -------------------------------- */
.otp-group-title {
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: var(--space-2);
}

.otp-group-desc {
  text-align: center;
  color: rgba(20, 20, 28, 0.6);
  font-size: 0.85rem;
  margin-bottom: var(--space-3);
}

.otp-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
  direction: ltr;
  margin-bottom: var(--space-6);
}

.otp-input {
  width: 52px;
  height: 52px;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 800;
  border: 2px solid rgba(20, 20, 28, 0.15);
  border-radius: var(--radius-md);
  background: var(--color-white);
  font-family: inherit;
}

.otp-input:focus {
  outline: none;
  border-color: var(--color-brand-blue);
}

.auth-resend {
  text-align: center;
  font-size: 0.85rem;
  color: rgba(20, 20, 28, 0.6);
  margin-top: var(--space-4);
}

.auth-resend button {
  background: none;
  border: none;
  color: var(--color-brand-blue);
  font-weight: 700;
  padding: 0;
}

.auth-resend button:disabled {
  color: rgba(20, 20, 28, 0.4);
  cursor: not-allowed;
}

/* -------------------------------- شاشة النجاح -------------------------------- */
.auth-success {
  text-align: center;
}

.auth-success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(47, 174, 96, 0.12);
  color: var(--color-success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-5);
}

.auth-success-icon svg {
  width: 30px;
  height: 30px;
}

@media (max-width: 480px) {
  .auth-form-panel {
    padding: 24px 16px 32px;
  }

  .otp-input {
    width: 44px;
    height: 44px;
  }

  .auth-fixed-actions {
    top: 14px;
    right: 14px;
  }

  .auth-fixed-btn {
    width: 42px;
    height: 42px;
  }
}
