/* ═══════════════════════════════════════════════════════
   Auth Pages – Modern Split Design  (عالسريع)
   ═══════════════════════════════════════════════════════ */

/* ── Body ── */
.auth-body {
  font-family: 'Cairo', var(--font, sans-serif);
  min-height: 100vh;
  margin: 0;
  background: #f0f4ff;
  display: flex;
  align-items: stretch;
  overflow-x: hidden;
}

/* ── Shell ── */
.auth-shell {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* ════════════════════════════
   BRANDING PANEL (right in RTL)
   ════════════════════════════ */
.auth-brand {
  flex: 1 1 0;
  background: linear-gradient(155deg, #0f2557 0%, #1a3c6e 45%, #1e4d8c 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
  position: relative;
  overflow: hidden;
  color: #fff;
}

.auth-brand::before,
.auth-brand::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  opacity: .08;
}
.auth-brand::before {
  width: 520px; height: 520px;
  background: #fff;
  top: -180px; right: -160px;
}
.auth-brand::after {
  width: 380px; height: 380px;
  background: #fff;
  bottom: -120px; left: -100px;
}

.brand-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 380px;
}

.brand-logo { margin-bottom: 2rem; }
.brand-logo img {
  max-height: 90px;
  max-width: 220px;
  object-fit: contain;
  filter: brightness(0) invert(1) drop-shadow(0 4px 16px rgba(0,0,0,.3));
}

.brand-title {
  font-size: 1.9rem;
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: .6rem;
  color: #fff;
}
.brand-title span { color: #7eb3ff; }

.brand-sub {
  font-size: .95rem;
  color: rgba(255,255,255,.72);
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.brand-features {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: right;
}
.brand-feature {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .75rem 1rem;
  background: rgba(255,255,255,.08);
  border-radius: 12px;
  backdrop-filter: blur(4px);
  transition: background .2s;
}
.brand-feature:hover { background: rgba(255,255,255,.13); }
.brand-feature-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
  color: #7eb3ff;
}
.brand-feature-text strong {
  display: block;
  font-size: .9rem;
  font-weight: 700;
  color: #fff;
}
.brand-feature-text small {
  font-size: .78rem;
  color: rgba(255,255,255,.6);
}

/* ════════════════════════════
   FORM PANEL
   ════════════════════════════ */
.auth-form-panel {
  width: 480px;
  flex-shrink: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 2.75rem;
  box-shadow: -8px 0 40px rgba(0,0,0,.08);
  position: relative;
  overflow-y: auto;
}

.auth-form-panel::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #1a3c6e, #7eb3ff);
}

.auth-panel-header { margin-bottom: 2rem; }
.auth-panel-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary, #1a1a2e);
  margin-bottom: .3rem;
}
.auth-panel-header p {
  font-size: .875rem;
  color: var(--text-muted, #6b7280);
}

/* ── Form ── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.auth-label {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-secondary, #374151);
  display: flex;
  align-items: center;
  gap: .4rem;
}
.auth-label i {
  color: #1a3c6e;
  font-size: .75rem;
  width: 14px;
}

.auth-input-wrap { position: relative; }
.auth-input-wrap .form-control {
  padding-right: .9rem;
  padding-left: 2.8rem;
  height: 48px;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  font-size: .9rem;
  transition: border-color .2s, box-shadow .2s;
  background: #fafbff;
}
.auth-input-wrap .form-control:focus {
  border-color: #1a3c6e;
  box-shadow: 0 0 0 3px rgba(26,60,110,.1);
  background: #fff;
}
.auth-input-wrap .form-control.is-invalid {
  border-color: var(--danger, #ef4444);
  box-shadow: 0 0 0 3px rgba(239,68,68,.08);
}

.auth-field-icon {
  position: absolute;
  left: .9rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: .85rem;
  pointer-events: none;
  transition: color .2s;
}
.auth-input-wrap:focus-within .auth-field-icon { color: #1a3c6e; }

.toggle-password {
  position: absolute;
  left: .9rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94a3b8;
  font-size: .85rem;
  transition: color .2s;
  padding: 0;
  line-height: 1;
  cursor: pointer;
}
.toggle-password:hover { color: #1a3c6e; }

.auth-field-error {
  font-size: .75rem;
  color: var(--danger, #ef4444);
  min-height: 1em;
  display: block;
}

.opt-badge {
  font-size: .7rem;
  font-weight: 500;
  color: #94a3b8;
  background: #f1f5f9;
  border-radius: 6px;
  padding: .1rem .45rem;
  margin-right: .2rem;
}

.auth-submit {
  width: 100%;
  height: 50px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0f2557, #1a3c6e);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  transition: transform .2s, box-shadow .2s, opacity .2s;
  margin-top: .5rem;
  cursor: pointer;
}
.auth-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15,37,87,.35);
}
.auth-submit:active { transform: translateY(0); }
.auth-submit:disabled { opacity: .65; cursor: not-allowed; }

.auth-switch {
  text-align: center;
  margin-top: 1.25rem;
  font-size: .875rem;
  color: var(--text-muted, #6b7280);
}
.auth-switch a {
  color: #1a3c6e;
  font-weight: 700;
  text-decoration: none;
}
.auth-switch a:hover { text-decoration: underline; }

.auth-footer-note {
  margin-top: 2rem;
  text-align: center;
  font-size: .73rem;
  color: #94a3b8;
}

/* ── Password strength ── */
.pw-strength-bar {
  height: 4px;
  border-radius: 4px;
  background: #e2e8f0;
  margin-top: 6px;
  overflow: hidden;
}
.pw-strength-fill {
  height: 100%;
  border-radius: 4px;
  width: 0;
  transition: width .3s, background .3s;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .auth-brand { display: none; }
  .auth-form-panel {
    width: 100%;
    padding: 2.5rem 1.75rem;
    box-shadow: none;
    background:
      radial-gradient(circle, rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 28px 28px,
      linear-gradient(155deg, #0f2557 0%, #1a3c6e 60%, #1e4d8c 100%);
  }
  /* دائرة زينة علوية يمين */
  .auth-form-panel::before {
    display: block;
    content: '';
    position: absolute;
    width: 340px; height: 340px;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    top: -110px; right: -90px;
    left: auto;
  }
  /* دائرة زينة سفلية يسار */
  .auth-form-panel::after {
    content: '';
    position: absolute;
    width: 230px; height: 230px;
    border-radius: 50%;
    background: rgba(126,179,255,.1);
    bottom: -50px; left: 5px;
  }
  /* رفع المحتوى فوق عناصر الزينة */
  .auth-mobile-header,
  .auth-panel-header,
  .auth-form,
  .auth-switch,
  .auth-footer-note { position: relative; z-index: 1; }
  /* بطاقة زجاجية حول حقول النموذج */
  .auth-form {
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 16px;
    padding: 1.25rem;
    backdrop-filter: blur(6px);
  }
  .auth-panel-header h2, .auth-panel-header p { color: #fff; }
  .auth-label { color: rgba(255,255,255,.85); }
  .auth-label i { color: #7eb3ff; }
  .auth-field-icon { color: #7eb3ff; }
  .auth-input-wrap .form-control {
    background: rgba(255,255,255,.1);
    border-color: rgba(255,255,255,.25);
    color: #fff;
  }
  .auth-input-wrap .form-control::placeholder { color: rgba(255,255,255,.4); }
  .auth-input-wrap .form-control:focus {
    background: rgba(255,255,255,.18);
    border-color: #7eb3ff;
    box-shadow: 0 0 0 3px rgba(126,179,255,.2);
  }
  .auth-switch { color: rgba(255,255,255,.7); }
  .auth-switch a { color: #7eb3ff; }
  .auth-footer-note { color: rgba(255,255,255,.4); }
}

@media (max-width: 480px) {
  .auth-form-panel { padding: 2rem 1.25rem; }
  .auth-panel-header h2 { font-size: 1.35rem; }
}

/* ── Mobile logo (hidden on desktop, shown on mobile) ── */
.auth-mobile-header {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 2rem;
}
.auth-mobile-header img {
  max-height: 64px;
  max-width: 160px;
  object-fit: contain;
  filter: brightness(0) invert(1) drop-shadow(0 2px 8px rgba(0,0,0,.3));
  margin-bottom: .75rem;
}
.auth-mobile-header .auth-app-name {
  font-size: 1.4rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -.5px;
}
.auth-mobile-header .auth-app-tagline {
  font-size: .8rem;
  color: rgba(255,255,255,.65);
  margin-top: .2rem;
}

@media (max-width: 900px) {
  .auth-mobile-header { display: flex; }
  .auth-toggle-password { color: rgba(255,255,255,.7); }
}
