/* ============================================================
   AL ADAB CBT — AUTH CSS
   Login Page, Forgot Password
   ============================================================ */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  background: #0f172a;
  overflow: hidden;
}

/* ---- Left Panel: Branding ---- */
.auth-panel-left {
  flex: 1;
  background: linear-gradient(145deg, #1e3a8a 0%, #1a56db 50%, #1d4ed8 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 48px;
  position: relative;
  overflow: hidden;
}

/* Islamic Geometric Background Pattern */
.auth-panel-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.06'%3E%3Cpath d='M40 0L52 22H28L40 0zM40 80L28 58H52L40 80zM0 40L22 28V52L0 40zM80 40L58 52V28L80 40zM40 40m-14 0a14 14 0 1 0 28 0 14 14 0 0 0-28 0'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.8;
}

/* Glowing Orbs */
.auth-panel-left::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,160,23,0.15) 0%, transparent 70%);
  top: -100px;
  right: -100px;
  animation: float 6s ease infinite;
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  animation: float 8s ease infinite;
}

.auth-orb-1 { width: 300px; height: 300px; bottom: -80px; left: -80px; animation-delay: -3s; }
.auth-orb-2 { width: 200px; height: 200px; top: 10%; left: 60%; animation-delay: -1s; }

.auth-brand {
  position: relative;
  z-index: 1;
  text-align: center;
  margin-bottom: 48px;
}

.auth-logo {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 20px;
  box-shadow: 0 8px 32px rgba(212,160,23,0.4);
  animation: float 4s ease infinite;
}

.auth-brand h1 {
  color: white;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 8px;
}

.auth-brand h1 span {
  color: var(--gold-300);
}

.auth-brand p {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  font-weight: 400;
}

.auth-arabic {
  font-family: var(--font-arabic);
  font-size: 1.4rem;
  color: rgba(255,255,255,0.6);
  margin-top: 12px;
  text-align: center;
}

/* Feature List */
.auth-features {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 340px;
}

.auth-feature-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  animation: slideInLeft 0.5s ease backwards;
}

.auth-feature-item:nth-child(1) { animation-delay: 0.1s; }
.auth-feature-item:nth-child(2) { animation-delay: 0.2s; }
.auth-feature-item:nth-child(3) { animation-delay: 0.3s; }
.auth-feature-item:nth-child(4) { animation-delay: 0.4s; }
.auth-feature-item:last-child { border-bottom: none; }

.auth-feature-icon {
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,0.12);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-300);
  font-size: 1rem;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.15);
}

.auth-feature-text strong {
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  display: block;
}

.auth-feature-text span {
  color: rgba(255,255,255,0.55);
  font-size: 0.775rem;
}

/* ---- Right Panel: Form ---- */
.auth-panel-right {
  width: 480px;
  background: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 48px;
  position: relative;
  overflow-y: auto;
}

/* Top Decoration */
.auth-panel-right::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-600), var(--gold-500), var(--primary-600));
}

.auth-form-header {
  margin-bottom: 32px;
}

.auth-form-header h2 {
  font-size: 1.625rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 6px;
}

.auth-form-header p {
  color: var(--gray-500);
  font-size: 0.875rem;
}

.auth-form-header .welcome-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-50);
  color: var(--primary-700);
  font-size: 0.775rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}

/* Password Input Group */
.input-password {
  position: relative;
}

.input-password .form-control {
  padding-right: 44px;
}

.input-password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  cursor: pointer;
  font-size: 0.9rem;
  transition: var(--transition-fast);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-password-toggle:hover { color: var(--gray-700); }

/* CAPTCHA */
.captcha-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: var(--gray-50);
  margin-bottom: 18px;
}

.captcha-display {
  flex: 1;
  font-family: 'Courier New', monospace;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--primary-700);
  background: linear-gradient(135deg, var(--primary-50), var(--primary-100));
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  text-align: center;
  user-select: none;
  text-decoration: line-through;
  text-decoration-color: rgba(26,86,219,0.3);
  position: relative;
}

.captcha-refresh {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--gray-200);
  color: var(--gray-600);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.captcha-refresh:hover { background: var(--gray-300); color: var(--gray-800); }

/* Remember Me Row */
.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 8px;
}

.forgot-link {
  font-size: 0.825rem;
  color: var(--primary-600);
  font-weight: 500;
}

.forgot-link:hover {
  color: var(--primary-800);
  text-decoration: underline;
}

/* Login Button */
.btn-login {
  width: 100%;
  padding: 13px 24px;
  background: linear-gradient(135deg, var(--primary-600), var(--primary-800));
  color: white;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  box-shadow: var(--shadow-blue);
  position: relative;
  overflow: hidden;
}

.btn-login::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: var(--transition-fast);
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(26,86,219,0.45);
}

.btn-login:hover::before { opacity: 1; }
.btn-login:active { transform: translateY(0); }

/* Role Selector (Demo) */
.role-selector {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-100);
}

.role-selector-label {
  font-size: 0.775rem;
  color: var(--gray-400);
  text-align: center;
  margin-bottom: 12px;
  font-weight: 500;
}

.role-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.role-pill {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--gray-200);
  color: var(--gray-600);
  transition: var(--transition-fast);
  background: white;
}

.role-pill:hover {
  border-color: var(--primary-300);
  color: var(--primary-600);
  background: var(--primary-50);
}

.role-pill.active {
  background: var(--primary-600);
  color: white;
  border-color: var(--primary-600);
}

/* Auth Footer */
.auth-footer {
  position: absolute;
  bottom: 24px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--gray-400);
}

/* Forgot Password Panel */
.forgot-panel {
  display: none;
}

.forgot-panel.active {
  display: block;
  animation: fadeInUp 0.3s ease;
}

.login-panel.hidden {
  display: none;
}

/* ============================================================
   RESPONSIVE AUTH
   ============================================================ */
@media (max-width: 900px) {
  .auth-panel-left {
    display: none;
  }

  .auth-panel-right {
    width: 100%;
    padding: 40px 32px;
  }
}

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

  .auth-form-header h2 { font-size: 1.4rem; }
}
