/* ===========================
   AUTHENTICATION STYLES
=========================== */

/* Note: Common modal and overlay patterns are now in modals.css */

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-light);
}

.form-input {
  padding: 0.875rem 1rem;
  border: 2px solid rgba(100, 116, 139, 0.3);
  border-radius: 8px;
  font-size: 1rem;
  background: rgba(30, 41, 59, 0.5);
  color: var(--text-light);
  transition: all 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-gold);
  box-shadow: 0 0 0 3px rgba(218, 165, 32, 0.1);
  background: rgba(30, 41, 59, 0.7);
}

.form-input.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-input::placeholder {
  color: var(--text-subtle);
}

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

/* Newsletter checkbox now uses .terms class from careers.css */

/* Auth Button */
.auth-button {
  padding: 0.875rem 1.5rem;
  margin-top: 24px;
  background: var(--primary-gold);
  color: var(--primary-dark);
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.auth-button:hover {
  background: var(--primary-gold-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(218, 165, 32, 0.4);
}

.auth-button:disabled {
  background: #64748b;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.auth-button.loading {
  pointer-events: none;
  color: transparent;
}

.auth-button.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid var(--primary-dark);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Auth Divider */
.auth-divider {
  text-align: center;
  margin: 1.5rem 0;
  position: relative;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(100, 116, 139, 0.3);
}

.auth-divider span {
  background: var(--secondary-dark);
  padding: 0 1rem;
  position: relative;
}

/* Auth Switch (Login/Register toggle) */
.auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.auth-switch-link {
  color: var(--primary-gold);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease;
}

.auth-switch-link:hover {
  color: var(--primary-gold-light);
  text-decoration: underline;
}

/* Forgot Password Link */
.auth-forgot-password {
  text-align: right;
  margin-top: -0.5rem;
  margin-bottom: 0.5rem;
}

.auth-forgot-link {
  color: var(--primary-gold);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s ease;
}

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

/* Back to Login Link */
.auth-back-to-login {
  text-align: center;
  margin-top: 1rem;
}

.auth-back-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.auth-back-link:hover {
  color: var(--primary-gold);
}

/* Form Hint */
.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.4;
}

/* Error/Success Messages */
.error-message {
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: none;
}

.error-message.show {
  display: block;
}

.success-message {
  background: rgba(34, 197, 94, 0.1);
  color: #86efac;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(34, 197, 94, 0.3);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: none;
}

.success-message.show {
  display: block;
}

/* User Menu Dropdown */
.user-menu {
  position: relative;
  display: none;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  color: var(--text-light);
  transition: all 0.3s ease;
  font-size: 0.875rem;
}

.user-menu-trigger:hover {
  color: var(--primary-gold);
  background: rgba(218, 165, 32, 0.1);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-gold);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}

.user-menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  min-width: 200px;
  background: var(--secondary-dark);
  border-radius: 8px;
  border: 1px solid rgba(100, 116, 139, 0.3);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 2000;
  overflow: visible;
  max-height: 400px;
  overflow-y: auto;
}

.user-menu.active .user-menu-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-menu-header {
  padding: 1rem;
  border-bottom: 1px solid rgba(100, 116, 139, 0.3);
}

.user-name {
  font-weight: 600;
  color: var(--text-light);
  font-size: 0.9rem;
  margin: 0;
}

.user-email {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 0.25rem 0 0 0;
}

.user-menu-items {
  padding: 0.5rem 0;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-light);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.user-menu-item i {
  font-size: 0.9rem;
  width: 16px;
}

.user-menu-item:hover {
  background: rgba(218, 165, 32, 0.1);
  color: var(--primary-gold);
}

.user-menu-item.danger {
  color: #fca5a5;
}

.user-menu-item.danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Header-specific user menu styling */
.header-icons .user-menu {
  display: none; /* Hidden by default, shown via JS when authenticated */
}

.header-icons .user-avatar {
  width: 28px;
  height: 28px;
  font-size: 0.75rem;
}

.header-icons #userDisplayName {
  font-weight: 500;
}

.header-icons .user-menu-dropdown {
  right: 0;
  left: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  /* Hide user name on tablets and mobile */
  .header-icons .user-menu-trigger #userDisplayName,
  .user-menu-trigger #userDisplayName {
    display: none !important;
  }

  /* Shift dropdown left on tablet to prevent cutoff */
  .user-menu-dropdown {
    right: -30px !important;
    left: auto !important;
    min-width: 200px !important;
    max-width: 250px !important;
  }
}

@media (max-width: 480px) {
  /* Ensure full name is hidden on mobile, show only initials + arrow */
  .header-icons .user-menu-trigger #userDisplayName,
  .user-menu-trigger #userDisplayName {
    display: none !important;
  }

  .user-menu-trigger {
    padding: 0.25rem 0.35rem;
    gap: 0.2rem;
  }

  .user-avatar {
    width: 26px;
    height: 26px;
    font-size: 0.65rem;
  }

  /* Shift dropdown significantly left to prevent cutoff on mobile */
  .user-menu-dropdown {
    right: -60px !important;
    left: auto !important;
    min-width: 180px !important;
    max-width: 200px !important;
  }

  .user-menu-item {
    padding: 0.65rem 0.85rem;
    font-size: 0.85rem;
  }
}