/* ==========================================================================
   AUTHENTICATION & NEW USER FORMATION STYLES (Light & Dark Theme Responsive)
   ========================================================================== */

/* Auth Modal Backdrop */
.auth-modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.auth-modal-backdrop.active {
  display: flex;
  opacity: 1;
}

/* Auth Modal Window */
.auth-modal-window {
  background: var(--bg-surface);
  color: var(--text-primary);
  width: 92%;
  max-width: 480px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  animation: authModalSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authModalSlideIn {
  from {
    transform: translateY(20px) scale(0.97);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* Modal Header */
.auth-modal-header {
  padding: 1.75rem 2rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  position: relative;
  text-align: center;
}

.auth-brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-sm);
}

.auth-modal-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.auth-modal-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.auth-modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  font-size: 1.35rem;
  cursor: pointer;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

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

/* Auth Tabs Navigation */
.auth-tabs-nav {
  display: flex;
  padding: 0 2rem;
  border-bottom: 1px solid var(--border-color);
  gap: 1.5rem;
  background: rgba(0, 0, 0, 0.02);
}

.auth-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.85rem 0.2rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.auth-tab-btn:hover {
  color: var(--text-primary);
}

.auth-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Modal Body */
.auth-modal-body {
  padding: 1.75rem 2rem 2rem;
}

/* Form Alert Boxes */
.auth-alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  margin-bottom: 1.25rem;
  display: none;
  align-items: flex-start;
  gap: 0.65rem;
  line-height: 1.4;
}

.auth-alert.error {
  display: flex;
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.auth-alert.success {
  display: flex;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.auth-alert.info {
  display: flex;
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* Password Input Wrapper with toggle eye */
.auth-password-wrap {
  position: relative;
}

.auth-password-wrap input {
  padding-right: 2.75rem !important;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.auth-password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem;
  font-size: 0.95rem;
}

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

/* Form Helper Rows */
.auth-options-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.84rem;
  margin-top: -0.25rem;
  margin-bottom: 1.25rem;
}

.auth-link {
  color: var(--text-primary);
  text-decoration: underline;
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
}

.auth-link:hover {
  opacity: 0.8;
}

/* Submit Button */
.btn-auth-submit {
  width: 100%;
  padding: 0.75rem 1.25rem;
  font-size: 0.96rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-auth-submit:hover:not(:disabled) {
  opacity: 0.92;
  transform: translateY(-1px);
}

.btn-auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Switch Form Footer */
.auth-switch-footer {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

/* Topbar Auth Widget */
.topbar-auth-widget {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: 0.5rem;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.75rem 0.35rem 0.45rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  cursor: pointer;
  transition: var(--transition);
}

.user-pill:hover {
  border-color: var(--text-muted);
}

.user-pill-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-pill-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-logout-icon {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-logout-icon:hover {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fca5a5;
}

/* Formation Bonus Badge */
.formation-bonus-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px dashed #10b981;
  color: #065f46;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  font-size: 0.82rem;
  margin-bottom: 1.25rem;
}

.theme-dark .formation-bonus-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}
