/* ========== AUTH MODAL ========== */
.auth-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay-bg, rgba(0,0,0,0.5));
  z-index: 100000; /* Increased to ensure it covers everything */
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(2px); /* Add blur for better focus */
  animation: fadeIn 0.3s ease;
}

.auth-modal-overlay.active {
  display: flex;
}

.auth-modal {
  background: var(--bg-primary, #ffffff);
  border-radius: 16px;
  box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,0.15));
  width: 90%;
  max-width: 450px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

.auth-modal-header {
  padding: 24px 24px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color, #dee2e6);
}

.auth-modal-header h2 {
  margin: 0;
  font-size: 24px;
  color: var(--text-primary, #212529);
}

.auth-modal-close {
  background: transparent;
  border: none;
  font-size: 28px;
  color: var(--text-secondary, #6c757d);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.auth-modal-close:hover {
  background: var(--bg-tertiary, #e9ecef);
}

.auth-tabs {
  display: flex;
  padding: 0 24px;
  margin-top: 16px;
  gap: 8px;
}

.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary, #6c757d);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.auth-tab.active {
  color: var(--accent-primary, #007bff);
  border-bottom-color: var(--accent-primary, #007bff);
}

.auth-modal-body {
  padding: 24px;
}

.auth-tab-content {
  display: none;
}

.auth-tab-content.active {
  display: block;
}

.social-login {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 20px;
  border: 1px solid var(--border-color, #dee2e6);
  border-radius: 8px;
  background: var(--bg-primary, #ffffff);
  color: var(--text-primary, #212529);
  font-size: 15px;
  cursor: pointer;
}

.social-btn:hover {
  background: var(--bg-primary, #ffffff) !important;
  background-color: #ffffff !important;
  border-color: var(--border-color, #dee2e6) !important;
  transform: none !important;
  box-shadow: none !important;
}

.divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
  color: var(--text-muted, #adb5bd);
  font-size: 13px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color, #dee2e6);
}

.divider span {
  padding: 0 12px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary, #212529);
}

.form-group input {
  padding: 12px 16px;
  border: 1px solid var(--border-color, #dee2e6);
  border-radius: 8px;
  font-size: 15px;
  background: var(--bg-primary, #ffffff);
  color: var(--text-primary, #212529);
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent-primary, #007bff);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Password Input Wrapper */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  width: 100%;
  padding-right: 45px;
}

.password-toggle-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary, #6c757d);
  transition: color 0.2s;
}

.password-toggle-btn:hover {
  color: var(--text-primary, #212529);
}

.password-toggle-btn svg {
  width: 20px;
  height: 20px;
}

/* Input Error State - SmallPDF Style */
.form-group input.input-error {
  border: 1px solid #e74c3c !important;
  background-color: #fdf2f2 !important;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15) !important;
}

.form-group input.input-success {
  border-color: #28a745 !important;
  box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1) !important;
}

/* Inline Error Message - SmallPDF Style */
.input-error-message {
  color: #e74c3c;
  font-size: 13px;
  font-weight: 500;
  margin-top: 6px;
  display: none;
}

.input-error-message.show {
  display: block;
}

/* Shake animation for error feedback */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Password Requirements Box */
.password-requirements {
  background: var(--bg-secondary, #f8f9fa);
  border: 1px solid var(--border-color, #dee2e6);
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 8px;
  display: none;
}

.password-requirements.show {
  display: block;
}

.password-requirements-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary, #212529);
  margin-bottom: 8px;
}

.password-requirement {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary, #6c757d);
  margin-bottom: 4px;
}

.password-requirement:last-child {
  margin-bottom: 0;
}

.requirement-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.password-requirement.valid {
  color: #28a745;
}

.password-requirement.valid .requirement-icon {
  color: #28a745;
}

.password-requirement.invalid {
  color: var(--text-secondary, #6c757d);
}

.password-requirement.invalid .requirement-icon {
  color: var(--text-secondary, #6c757d);
}

.form-actions {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.forgot-password {
  color: var(--accent-primary, #007bff);
  text-decoration: none;
}

.submit-btn {
  width: 100%;
  padding: 12px;
  background: var(--accent-primary, #007bff);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

/* ========== DARK MODE FOR AUTH MODAL ========== */
body.dark-mode .auth-modal {
  background-color: #2d2d2d !important;
  border: 1px solid #495057 !important;
}

body.dark-mode .auth-modal-header {
  border-bottom-color: #495057 !important;
}

body.dark-mode .auth-modal-header h2 {
  color: #f8f9fa !important;
}

body.dark-mode .auth-modal-close {
  color: #adb5bd !important;
}

body.dark-mode .auth-modal-close:hover {
  background-color: #3a3a3a !important;
  color: #f8f9fa !important;
}

body.dark-mode .auth-tab {
  color: #adb5bd !important;
}

body.dark-mode .auth-tab.active {
  color: #007bff !important;
  border-bottom-color: #007bff !important;
}

body.dark-mode .social-btn {
  background-color: #3a3a3a !important;
  border-color: #495057 !important;
  color: #f8f9fa !important;
}

body.dark-mode .social-btn:hover {
  background-color: #3a3a3a !important;
  border-color: #495057 !important;
  transform: none !important;
  box-shadow: none !important;
}

body.dark-mode .divider {
  color: #6c757d !important;
}

body.dark-mode .divider::before,
body.dark-mode .divider::after {
  border-bottom-color: #495057 !important;
}

body.dark-mode .form-group label {
  color: #f8f9fa !important;
}

body.dark-mode .form-group input {
  background-color: #3a3a3a !important;
  border-color: #495057 !important;
  color: #f8f9fa !important;
}

body.dark-mode .form-group input::placeholder {
  color: #6c757d !important;
}

body.dark-mode .form-group input:focus {
  border-color: #007bff !important;
}

body.dark-mode .form-group input:focus {
  border-color: #007bff !important;
}

body.dark-mode .password-toggle-btn {
  color: #adb5bd !important;
}

body.dark-mode .password-toggle-btn:hover {
  color: #f8f9fa !important;
}

body.dark-mode .form-group input.input-error {
  border-color: #dc3545 !important;
}

body.dark-mode .form-group input.input-success {
  border-color: #28a745 !important;
}

body.dark-mode .password-requirements {
  background-color: #3a3a3a !important;
  border-color: #495057 !important;
}

body.dark-mode .password-requirements-title {
  color: #f8f9fa !important;
}

body.dark-mode .password-requirement {
  color: #adb5bd !important;
}

body.dark-mode .password-requirement.valid {
  color: #28a745 !important;
}

body.dark-mode .remember-me {
  color: #adb5bd !important;
}

body.dark-mode .forgot-password {
  color: #007bff !important;
}

body.dark-mode .submit-btn {
  background-color: #007bff !important;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
