/* ============================================================
   LEADERS ACADEMIA LMS — auth.css
   Authentication Pages Styles
   ============================================================ */

/* ============================================================
   1. AUTH LAYOUT
   ============================================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  background: var(--bg, #F8FAFC);
}

/* ============================================================
   2. LEFT PANEL — BRAND GRAPHIC SIDE
   ============================================================ */
.auth-left {
  flex: 1;
  background: linear-gradient(160deg, #1D4ED8 0%, #2563EB 45%, #06B6D4 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}

/* Geometric pattern overlay */
.auth-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cpolygon points='50,5 95,27 95,73 50,95 5,73 5,27' fill='none' stroke='rgba(255,255,255,0.07)' stroke-width='1'/%3E%3Cpolygon points='50,20 80,36 80,64 50,80 20,64 20,36' fill='none' stroke='rgba(255,255,255,0.05)' stroke-width='1'/%3E%3Cpolygon points='50,35 65,44 65,56 50,65 35,56 35,44' fill='none' stroke='rgba(255,255,255,0.04)' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 80px 80px;
  pointer-events: none;
}

/* Radial glow */
.auth-left::after {
  content: '';
  position: absolute;
  bottom: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(6,182,212,0.2) 0%, transparent 70%);
  pointer-events: none;
}

.auth-left-content {
  position: relative;
  z-index: 1;
  max-width: 440px;
  text-align: center;
}

.auth-left-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.875rem;
  margin-bottom: 3rem;
  text-decoration: none;
}

.auth-left-logo-icon {
  width: 56px;
  height: 56px;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.25);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.875rem;
  backdrop-filter: blur(8px);
}

.auth-left-logo-name {
  font-size: 1.625rem;
  font-weight: 800;
  color: white;
  line-height: 1.1;
}

.auth-left-logo-sub {
  font-size: 0.75rem;
  font-weight: 400;
  color: rgba(255,255,255,0.6);
  display: block;
}

.auth-left-illustration {
  width: 100%;
  max-width: 360px;
  margin: 0 auto 2.5rem;
  position: relative;
}

.auth-left-illustration img {
  width: 100%;
  border-radius: 1.5rem;
  box-shadow: 0 30px 60px rgba(0,0,0,0.2);
  animation: float 4s ease-in-out infinite;
}

/* Decorative elements on illustration */
.auth-illus-badge {
  position: absolute;
  background: white;
  border-radius: 1rem;
  padding: 0.875rem 1.125rem;
  box-shadow: 0 12px 24px rgba(0,0,0,0.12);
  display: flex;
  align-items: center;
  gap: 0.625rem;
  animation: float 3.5s ease-in-out 0.5s infinite;
}

.auth-illus-badge.badge-1 {
  bottom: -16px;
  left: -24px;
}

.auth-illus-badge.badge-2 {
  top: -16px;
  right: -20px;
  animation-delay: 1s;
}

.auth-illus-badge-icon {
  width: 32px;
  height: 32px;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.auth-illus-badge-label { font-size: 0.6875rem; color: #64748B; }
.auth-illus-badge-value { font-size: 0.875rem; font-weight: 700; color: #0F172A; }

.auth-left-quote {
  font-family: 'Amiri', 'Traditional Arabic', serif;
  font-size: 1.375rem;
  color: rgba(255,255,255,0.9);
  line-height: 1.8;
  margin-bottom: 0.75rem;
  text-align: center;
}

.auth-left-quote-en {
  font-size: 0.9375rem;
  color: rgba(255,255,255,0.65);
  font-style: italic;
  margin-bottom: 1.5rem;
}

.auth-left-quote-source {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.5);
  font-weight: 500;
}

/* Floating shapes */
.auth-shape {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.auth-shape-1 {
  width: 180px;
  height: 180px;
  background: rgba(255,255,255,0.05);
  top: -60px;
  left: -60px;
}

.auth-shape-2 {
  width: 120px;
  height: 120px;
  background: rgba(6,182,212,0.1);
  bottom: 10%;
  right: -40px;
}

.auth-shape-3 {
  width: 60px;
  height: 60px;
  background: rgba(255,255,255,0.08);
  top: 20%;
  right: 10%;
}

/* ============================================================
   3. RIGHT PANEL — FORM SIDE
   ============================================================ */
.auth-right {
  width: 500px;
  min-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
  background: white;
  overflow-y: auto;
}

.auth-form-container {
  width: 100%;
  max-width: 400px;
}

/* Mobile logo (hidden on desktop) */
.auth-mobile-logo {
  display: none;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  text-decoration: none;
}

.auth-mobile-logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary, #2563EB), var(--secondary, #06B6D4));
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.375rem;
}

.auth-mobile-logo-name {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--dark, #1E293B);
}

.auth-form-header {
  margin-bottom: 2rem;
}

.auth-form-title {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--dark, #1E293B);
  margin-bottom: 0.5rem;
}

.auth-form-subtitle {
  font-size: 0.9375rem;
  color: var(--text-muted, #64748B);
  line-height: 1.6;
}

.auth-form-subtitle a {
  color: var(--primary, #2563EB);
  font-weight: 600;
  text-decoration: none;
}

.auth-form-subtitle a:hover { text-decoration: underline; }

/* Auth form */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}

.auth-form .form-group { margin-bottom: 0; }

/* ============================================================
   4. SOCIAL LOGIN BUTTONS
   ============================================================ */
.auth-social-divider {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin: 0.75rem 0;
}

.auth-social-divider span {
  font-size: 0.8125rem;
  color: var(--text-muted, #64748B);
  white-space: nowrap;
}

.auth-social-divider::before,
.auth-social-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-light, #E2E8F0);
}

.auth-social-buttons {
  display: flex;
  gap: 0.75rem;
}

.auth-social-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  padding: 0.625rem 1rem;
  background: white;
  border: 1.5px solid var(--border, #CBD5E1);
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--dark, #1E293B);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

.auth-social-btn:hover {
  border-color: var(--primary, #2563EB);
  background: rgba(37,99,235,0.03);
  color: var(--dark, #1E293B);
}

.auth-social-btn.google:hover { border-color: #EA4335; }
.auth-social-btn.facebook:hover { border-color: #1877F2; }
.auth-social-btn.github:hover { border-color: #24292E; }

.auth-social-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

.social-icon-google  { color: #EA4335; font-size: 1rem; }
.social-icon-facebook{ color: #1877F2; font-size: 1rem; }

/* ============================================================
   5. PASSWORD FIELD
   ============================================================ */
.password-input-wrapper {
  position: relative;
}

.password-input-wrapper .form-control {
  padding-right: 2.75rem;
}

.password-toggle-btn {
  position: absolute;
  right: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted, #64748B);
  font-size: 0.9375rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  transition: color 0.2s ease;
  z-index: 1;
}

.password-toggle-btn:hover { color: var(--primary, #2563EB); }

/* ============================================================
   6. PASSWORD STRENGTH INDICATOR
   ============================================================ */
.password-strength {
  margin-top: 0.625rem;
}

.password-strength-bars {
  display: flex;
  gap: 4px;
  margin-bottom: 0.375rem;
}

.password-strength-bar {
  flex: 1;
  height: 4px;
  border-radius: 9999px;
  background: var(--light, #E2E8F0);
  transition: background 0.3s ease;
}

.password-strength-bar.filled.strength-weak   { background: var(--error, #EF4444); }
.password-strength-bar.filled.strength-fair   { background: var(--warning, #F59E0B); }
.password-strength-bar.filled.strength-good   { background: #3B82F6; }
.password-strength-bar.filled.strength-strong { background: var(--success, #10B981); }

.password-strength-label {
  font-size: 0.75rem;
  font-weight: 600;
}

.strength-weak   { color: var(--error, #EF4444); }
.strength-fair   { color: var(--warning, #F59E0B); }
.strength-good   { color: #3B82F6; }
.strength-strong { color: var(--success, #10B981); }

.password-requirements {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.password-req {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted, #64748B);
}

.password-req-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--light, #E2E8F0);
  color: var(--text-muted, #64748B);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.password-req.met .password-req-icon {
  background: var(--success, #10B981);
  color: white;
}

.password-req.met { color: var(--success, #10B981); }

/* ============================================================
   7. OTP INPUT
   ============================================================ */
.otp-input-group {
  display: flex;
  gap: 0.625rem;
  justify-content: center;
}

.otp-input {
  width: 52px;
  height: 60px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark, #1E293B);
  background: var(--bg, #F8FAFC);
  border: 2px solid var(--border, #CBD5E1);
  border-radius: 0.875rem;
  outline: none;
  transition: all 0.2s ease;
  caret-color: var(--primary, #2563EB);
  font-family: inherit;
}

.otp-input:focus {
  border-color: var(--primary, #2563EB);
  background: white;
  box-shadow: 0 0 0 4px rgba(37,99,235,0.1);
  transform: scale(1.05);
}

.otp-input.filled {
  border-color: var(--primary, #2563EB);
  background: rgba(37,99,235,0.04);
}

.otp-input.error {
  border-color: var(--error, #EF4444);
  animation: wiggle 0.4s ease;
}

.otp-resend {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted, #64748B);
  margin-top: 1.25rem;
}

.otp-timer {
  font-weight: 600;
  color: var(--primary, #2563EB);
}

.otp-resend-btn {
  background: none;
  border: none;
  color: var(--primary, #2563EB);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  font-family: inherit;
  text-decoration: underline;
  opacity: 0.5;
  pointer-events: none;
}

.otp-resend-btn.active {
  opacity: 1;
  pointer-events: all;
}

.otp-resend-btn:hover { text-decoration: none; }

/* ============================================================
   8. REMEMBER ME & FORGOT PASSWORD
   ============================================================ */
.auth-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.remember-me-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border, #CBD5E1);
  border-radius: 0.3rem;
  cursor: pointer;
  appearance: none;
  background: white;
  transition: all 0.2s ease;
  position: relative;
  flex-shrink: 0;
}

.remember-me-checkbox:checked {
  background: var(--primary, #2563EB);
  border-color: var(--primary, #2563EB);
}

.remember-me-checkbox:checked::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 4px;
  width: 5px;
  height: 9px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.remember-me-label {
  font-size: 0.875rem;
  color: var(--text, #0F172A);
}

.forgot-password-link {
  font-size: 0.875rem;
  color: var(--primary, #2563EB);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.forgot-password-link:hover { color: var(--primary-dark, #1D4ED8); text-decoration: underline; }

/* ============================================================
   9. AUTH FORM FOOTER
   ============================================================ */
.auth-form-footer {
  margin-top: 1.75rem;
  text-align: center;
}

.auth-switch-text {
  font-size: 0.9375rem;
  color: var(--text-muted, #64748B);
}

.auth-switch-link {
  color: var(--primary, #2563EB);
  font-weight: 700;
  text-decoration: none;
}

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

.auth-terms {
  font-size: 0.8125rem;
  color: var(--text-muted, #64748B);
  margin-top: 1.25rem;
  text-align: center;
  line-height: 1.6;
}

.auth-terms a {
  color: var(--primary, #2563EB);
  font-weight: 600;
  text-decoration: none;
}

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

/* ============================================================
   10. BACK LINK
   ============================================================ */
.auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted, #64748B);
  text-decoration: none;
  margin-bottom: 2rem;
  transition: color 0.2s ease;
}

.auth-back-link:hover { color: var(--primary, #2563EB); }

/* ============================================================
   11. SUCCESS STATE
   ============================================================ */
.auth-success-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--success, #10B981), #34D399);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
  margin: 0 auto 1.5rem;
  box-shadow: 0 12px 30px rgba(16,185,129,0.35);
  animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================================
   12. ROLE SELECTION (REGISTRATION)
   ============================================================ */
.auth-role-select {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.auth-role-option {
  position: relative;
}

.auth-role-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.auth-role-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  padding: 1.25rem 0.75rem;
  background: var(--bg, #F8FAFC);
  border: 2px solid var(--border-light, #E2E8F0);
  border-radius: 0.875rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.auth-role-label:hover {
  border-color: var(--primary-light, #06B6D4);
  background: white;
}

.auth-role-option input:checked + .auth-role-label {
  border-color: var(--primary, #2563EB);
  background: rgba(37,99,235,0.04);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.auth-role-icon {
  font-size: 1.875rem;
}

.auth-role-name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--dark, #1E293B);
}

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

  .auth-right {
    width: 100%;
    min-width: unset;
    padding: 2rem 1.5rem;
  }

  .auth-mobile-logo { display: flex; }
}

@media (max-width: 480px) {
  .auth-right { padding: 1.5rem 1.25rem; }

  .auth-form-title { font-size: 1.5rem; }

  .otp-input {
    width: 44px;
    height: 52px;
    font-size: 1.25rem;
  }

  .otp-input-group { gap: 0.5rem; }

  .auth-role-select { grid-template-columns: 1fr; }

  .auth-social-buttons { flex-direction: column; }
}
