/* =================================
   UNIFIED AUTHENTICATION STYLES
   Optimized shared CSS for all auth pages
================================= */

/* RTL Support */
[dir="rtl"] { text-align: right; }
[dir="rtl"] .navbar, [dir="rtl"] .nav-links, [dir="rtl"] .form-group, 
[dir="rtl"] .form-input, [dir="rtl"] .card, [dir="rtl"] .container { direction: rtl; }
[dir="rtl"] .nav-links { flex-direction: row-reverse; }
[dir="rtl"] .form-input { direction: rtl; }

/* Shared Auth Layout */
.auth-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.auth-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  max-width: 1000px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 600px;
}

/* Left Side Branding */
.auth-left {
  background: linear-gradient(135deg, rgb(66, 57, 100), rgb(31, 19, 66));
  padding: 60px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.auth-left::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.3;
}

.auth-left-content {
  position: relative;
  z-index: 2;
}

.auth-left h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.2;
}

.auth-left p {
  font-size: 1.1rem;
  opacity: 0.9;
  line-height: 1.6;
  margin-bottom: 32px;
}

.auth-features {
  list-style: none;
  padding: 0;
  margin: 0;
}

.auth-features li {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  font-size: 0.95rem;
  opacity: 0.9;
}

.auth-features i {
  margin-right: 12px;
  font-size: 1.1rem;
  width: 20px;
}

/* Right Side Form */
.auth-right {
  padding: 60px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-header {
  text-align: center;
  margin-bottom: 40px;
}

.auth-logo {
  margin-bottom: 24px;
}

.auth-logo img {
  height: 50px;
  width: auto;
}

.auth-title {
  font-size: 2rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 8px;
}

.auth-subtitle {
  color: #6b7280;
  font-size: 1rem;
}

.auth-form {
  width: 100%;
}

/* Form Components */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 8px;
}

.form-row .form-group {
  margin-bottom: 4px;
}

.form-group {
  margin-bottom: 8px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  display: block;
  font-weight: 500;
  color: #374151;
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.2s ease;
  background: #fafafa;
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: rgb(66, 57, 100);
  background: white;
  box-shadow: 0 0 0 3px rgba(66, 57, 100, 0.1);
}

/* Password Components */
.password-container {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
  font-size: 1rem;
}

.password-strength {
  margin-top: 8px;
  font-size: 0.8rem;
}

.strength-bar {
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.strength-fill {
  height: 100%;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.strength-weak { background: #ef4444; width: 25%; }
.strength-fair { background: #f59e0b; width: 50%; }
.strength-good { background: #10b981; width: 75%; }
.strength-strong { background: #059669; width: 100%; }

/* UI Elements */
.terms-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 24px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.terms-checkbox input[type="checkbox"] {
  margin: 0;
  flex-shrink: 0;
  margin-top: 2px;
}

.terms-checkbox label {
  color: #6b7280;
  cursor: pointer;
}

.terms-checkbox a {
  color: rgb(66, 57, 100);
  text-decoration: none;
  font-weight: 500;
}

.terms-checkbox a:hover {
  color: rgb(31, 19, 66);
}

.forgot-password {
  text-align: right;
  margin-bottom: 12px;
}

.forgot-password a {
  color: rgb(66, 57, 100);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.forgot-password a:hover {
  color: rgb(31, 19, 66);
}

/* Buttons */
.auth-btn {
  width: 100%;
  background: linear-gradient(135deg, rgb(66, 57, 100), rgb(31, 19, 66));
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(66, 57, 100, 0.3);
}

/* Footer */
.auth-footer {
  text-align: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
}

.auth-footer p {
  color: #6b7280;
  font-size: 0.9rem;
  margin: 0;
}

.auth-footer a {
  color: rgb(66, 57, 100);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.auth-footer a:hover {
  color: rgb(31, 19, 66);
}

/* Messages */
.message {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
}

.message.success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.message.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

/* Responsive */
@media (max-width: 768px) {
  .auth-page {
    margin-top: 50px;
  }
  
  .auth-container {
    grid-template-columns: 1fr;
    max-width: 400px;
  }
  
  .auth-left {
    padding: 40px 30px;
    order: 2;
  }
  
  .auth-right {
    padding: 40px 30px;
    order: 1;
    margin-top: 30px;
  }
  
  .auth-left h1 {
    font-size: 2rem;
  }
  
  .auth-title {
    font-size: 1.75rem;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

@media (max-width: 480px) {
  .auth-page {
    padding: 10px;
    margin-top: 40px;
  }
  
  .auth-left,
  .auth-right {
    padding: 30px 20px;
  }
  
  .auth-right {
    margin-top: 20px;
  }
  
  .auth-left h1 {
    font-size: 1.75rem;
  }
  
  .auth-title {
    font-size: 1.5rem;
  }
}
