/* ============================================================
   أعمالي ERP — Login & Auth Styles
============================================================ */

.auth-page {
  min-height: 100vh;
  display: flex;
  background: var(--bg);
}

/* ============================================================
   LEFT PANEL — BRAND
============================================================ */
.auth-brand {
  width: 45%;
  background: linear-gradient(135deg, var(--blue-900) 0%, var(--blue-700) 50%, var(--violet-700) 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--sp-12);
  position: relative;
  overflow: hidden;
}

[data-lang="en"] .auth-brand { order: -1; }

/* Decorative circles */
.auth-brand::before,
.auth-brand::after {
  content: '';
  position: absolute;
  border-radius: var(--r-full);
  opacity: .12;
}
.auth-brand::before {
  width: 400px;
  height: 400px;
  background: white;
  top: -100px;
  right: -100px;
}
.auth-brand::after {
  width: 300px;
  height: 300px;
  background: white;
  bottom: -80px;
  left: -60px;
}

.auth-brand-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  position: relative;
  z-index: 1;
}

.auth-brand-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  background: rgba(255,255,255,.2);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 900;
  color: #fff;
  border: 1px solid rgba(255,255,255,.3);
}

.auth-brand-name {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: #fff;
}

.auth-brand-tagline {
  font-size: var(--text-sm);
  color: rgba(255,255,255,.7);
  margin-top: 2px;
}

/* Brand center content */
.auth-brand-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.auth-brand-heading {
  font-size: var(--text-4xl);
  font-weight: 900;
  color: #fff;
  line-height: 1.2;
  margin-bottom: var(--sp-5);
}

.auth-brand-heading span {
  color: var(--blue-200);
}

.auth-brand-desc {
  font-size: var(--text-base);
  color: rgba(255,255,255,.75);
  line-height: 1.7;
  max-width: 380px;
}

/* Features list */
.auth-features {
  margin-top: var(--sp-8);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.auth-feature-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: rgba(255,255,255,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.auth-feature-text {
  flex: 1;
}

.auth-feature-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: #fff;
}

.auth-feature-desc {
  font-size: var(--text-xs);
  color: rgba(255,255,255,.65);
  margin-top: 2px;
}

/* Brand footer */
.auth-brand-footer {
  font-size: var(--text-xs);
  color: rgba(255,255,255,.5);
  position: relative;
  z-index: 1;
}

/* ============================================================
   RIGHT PANEL — FORM
============================================================ */
.auth-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-8);
}

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

/* Step */
.auth-step {
  display: none;
  flex-direction: column;
  gap: var(--sp-6);
  animation: fadeIn var(--tr-slow) ease forwards;
}

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

/* Header */
.auth-form-header { display: flex; flex-direction: column; gap: var(--sp-1); }

.auth-form-title {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.auth-form-sub {
  font-size: var(--text-base);
  color: var(--text-muted);
}

/* Form */
.auth-form { display: flex; flex-direction: column; gap: var(--sp-4); }

/* Password wrapper */
.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrap .form-input { padding-left: 44px; }
[dir="rtl"] .password-wrap .form-input { padding-left: var(--sp-4); padding-right: 44px; }

.password-toggle {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  transition: color var(--tr);
  padding: 4px;
  border-radius: var(--r-sm);
}
[dir="rtl"] .password-toggle { left: auto; right: 12px; }

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

/* Remember me row */
.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-forgot {
  font-size: var(--text-sm);
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--tr);
}
.auth-forgot:hover { opacity: .75; }

/* Submit */
.auth-submit {
  width: 100%;
  height: 48px;
  font-size: var(--text-base);
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
  color: #fff;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: transform var(--tr-fast), box-shadow var(--tr);
  position: relative;
  overflow: hidden;
  font-family: var(--font);
}

.auth-submit::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-600));
  opacity: 0;
  transition: opacity var(--tr);
}

.auth-submit:hover::after { opacity: 1; }
.auth-submit:active { transform: translateY(1px); }

.auth-submit span { position: relative; z-index: 1; }

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

/* Admin code field */
.admin-code-wrap {
  display: flex;
  gap: var(--sp-3);
}

.code-digit {
  flex: 1;
  height: 60px;
  text-align: center;
  font-size: var(--text-2xl);
  font-weight: 700;
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--tr), box-shadow var(--tr);
}

.code-digit:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

/* Back link */
.auth-back {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--tr);
  font-weight: 500;
}
.auth-back:hover { color: var(--text); }

/* Error message */
.auth-error {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--danger-light);
  border: 1px solid var(--red-200);
  border-radius: var(--r-md);
  color: var(--danger);
  font-size: var(--text-sm);
  font-weight: 500;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Theme toggle */
.auth-theme-btn {
  position: absolute;
  top: var(--sp-5);
  left: var(--sp-5);
  width: 38px;
  height: 38px;
  border-radius: var(--r-full);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all var(--tr);
  color: var(--text-muted);
  box-shadow: var(--sh-sm);
}

[dir="rtl"] .auth-theme-btn { left: auto; right: var(--sp-5); }

.auth-theme-btn:hover { background: var(--surface-2); color: var(--text); }

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 900px) {
  .auth-brand { display: none; }
  .auth-form-panel {
    padding: var(--sp-6) var(--sp-5);
  }
}

@media (max-width: 480px) {
  .auth-form-title { font-size: var(--text-2xl); }
  .auth-form-panel { padding: var(--sp-5) var(--sp-4); }
  .admin-code-wrap { gap: var(--sp-2); }
  .code-digit { height: 52px; font-size: var(--text-xl); }
}
