/* Authentication Pages Styles */

.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #1877f2 0%, #42a5f5 100%);
  padding: 2rem 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.auth-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 1200px;
  margin: 0 auto;
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  min-height: 600px;
}

/* Left Side - Branding */
.auth-branding {
  background: linear-gradient(135deg, #1877f2, #4267b2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  position: relative;
}

.auth-branding::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="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="10" cy="60" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="90" cy="40" r="0.5" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.3;
}

.branding-content {
  text-align: center;
  position: relative;
  z-index: 1;
}

.auth-logo {
  max-height: 80px;
  margin-bottom: 2rem;
}

.auth-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: white;
}

.auth-tagline {
  font-size: 1.25rem;
  margin-bottom: 3rem;
  opacity: 0.9;
  line-height: 1.4;
}

.auth-features {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1rem;
}

.feature-item i {
  font-size: 1.5rem;
  opacity: 0.8;
}

/* Right Side - Form */
.auth-form-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

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

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

.auth-form-header h3 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.auth-form-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Form Styles */
.auth-form {
  width: 100%;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #1c1e21;
  font-size: 0.9rem;
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group i {
  position: absolute;
  left: 1rem;
  color: var(--text-secondary);
  z-index: 2;
}

.input-group input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 3rem;
  border: 1px solid #dddfe2;
  border-radius: 6px;
  background-color: #f5f6f7;
  color: #1c1e21;
  font-size: 1rem;
  transition: all 0.3s ease;
  font-family: inherit;
}

.input-group input:focus {
  outline: none;
  border-color: #1877f2;
  background-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.2);
}

.password-toggle {
  position: absolute;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  z-index: 2;
}

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

.form-help {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: #65676b;
  line-height: 1.4;
}

.error-message {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--error-color);
}

.availability-message {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
}

.availability-message.success {
  color: var(--success-color);
}

.availability-message.error {
  color: var(--error-color);
}

.form-group.error input {
  border-color: var(--error-color);
}

.form-group.success input {
  border-color: var(--success-color);
}

/* Password Strength */
.password-strength {
  margin-top: 0.5rem;
}

.strength-meter {
  height: 4px;
  background-color: var(--border-color);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.25rem;
}

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

.strength-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Form Options */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-radius: 3px;
  position: relative;
  transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.forgot-password-link {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.forgot-password-link:hover {
  color: #1557B0;
}

/* Submit Button */
.auth-submit {
  position: relative;
  overflow: hidden;
  background-color: #1877f2;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.auth-submit:hover {
  background-color: #166fe5;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(24, 119, 242, 0.4);
}

.btn-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Divider */
.auth-divider {
  text-align: center;
  margin: 1.5rem 0;
  position: relative;
}

.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background-color: var(--border-color);
}

.auth-divider span {
  background-color: var(--card-background);
  padding: 0 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  position: relative;
  z-index: 1;
}

/* Social Login */
.social-login {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.btn-facebook {
  background-color: #1877f2;
  color: white;
  border: none;
  font-weight: 600;
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 1rem;
}

.btn-facebook:hover {
  background-color: #166fe5;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(24, 119, 242, 0.3);
}

.btn-google {
  background-color: #db4437;
  color: white;
  border: none;
}

.btn-google:hover {
  background-color: #c23321;
}

/* Auth Footer */
.auth-footer {
  text-align: center;
}

.auth-footer p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.auth-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.auth-link:hover {
  color: #1557B0;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.modal {
  background-color: var(--card-background);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

/* OTP Input */
.otp-input-group {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 1.5rem 0;
}

.otp-input {
  width: 50px;
  height: 50px;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 600;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  background-color: var(--background-color);
  color: var(--text-primary);
  transition: all 0.3s ease;
}

.otp-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.otp-actions {
  text-align: center;
  margin: 1rem 0;
}

.resend-otp-btn,
.resend-verification-btn {
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: underline;
}

.resend-otp-btn:hover,
.resend-verification-btn:hover {
  color: #1557B0;
}

.resend-otp-btn:disabled,
.resend-verification-btn:disabled {
  color: var(--text-secondary);
  cursor: not-allowed;
  text-decoration: none;
}

.resend-timer {
  color: var(--text-secondary);
}

/* Verification Modal */
.verification-modal .modal-body {
  text-align: center;
}

.verification-icon {
  font-size: 4rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .auth-container {
    padding: 1rem 0;
  }
  
  .auth-wrapper {
    grid-template-columns: 1fr;
    margin: 0 1rem;
    min-height: auto;
  }
  
  .auth-branding {
    padding: 2rem 1.5rem;
    order: 2;
  }
  
  .auth-form-container {
    padding: 2rem 1.5rem;
    order: 1;
  }
  
  .auth-title {
    font-size: 2rem;
  }
  
  .auth-tagline {
    font-size: 1.1rem;
    margin-bottom: 2rem;
  }
  
  .auth-features {
    gap: 1rem;
  }
  
  .feature-item {
    font-size: 0.9rem;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  
  .form-options {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .social-login {
    gap: 0.5rem;
  }
  
  .modal {
    margin: 1rem;
    width: calc(100% - 2rem);
  }
  
  .modal-header,
  .modal-body {
    padding: 1rem;
  }
  
  .modal-actions {
    flex-direction: column;
  }
  
  .otp-input {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  
  .otp-input-group {
    gap: 0.25rem;
  }
}

@media (max-width: 480px) {
  .auth-form-wrapper {
    max-width: none;
  }
  
  .input-group input {
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    font-size: 0.9rem;
  }
  
  .input-group i {
    left: 0.75rem;
    font-size: 0.9rem;
  }
  
  .password-toggle {
    right: 0.75rem;
  }
  
  .otp-input {
    width: 35px;
    height: 35px;
    font-size: 0.9rem;
  }
}

/* Dark Mode Adjustments */
[data-theme="dark"] .auth-container {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

[data-theme="dark"] .auth-branding::before {
  opacity: 0.2;
}

[data-theme="dark"] .input-group input {
  background-color: var(--card-background);
  border-color: var(--border-color);
}

[data-theme="dark"] .input-group input:focus {
  box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.2);
}

[data-theme="dark"] .checkmark {
  background-color: var(--card-background);
}

[data-theme="dark"] .auth-divider::before {
  background-color: var(--border-color);
}

[data-theme="dark"] .auth-divider span {
  background-color: var(--card-background);
}

/* Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-form-wrapper {
  animation: fadeInUp 0.6s ease;
}

.branding-content {
  animation: fadeInUp 0.6s ease 0.2s both;
}

/* Loading States */
.form-group.loading input {
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><circle cx="12" cy="12" r="3" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><animate attributeName="stroke-dasharray" values="0 15;5 10;0 15" dur="1.5s" repeatCount="indefinite"/><animate attributeName="stroke-dashoffset" values="0;-5;-10" dur="1.5s" repeatCount="indefinite"/></circle></svg>');
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 16px;
}
