/* ===== Authentication Pages Styles - StarShipDealers ===== */

/* Page wrapper pour les pages d'authentification */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  background: var(--bg);
}

/* Overlay avec particules d'étoiles pour les pages d'auth */
.auth-wrapper::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url("../images/StarShipDealers/Background-StarShip.ecf77a71a366.jpg") center / cover no-repeat fixed, var(--bg);
  filter: brightness(0.4) saturate(1.1);
  z-index: -1;
}

/* Bouton de retour à l'accueil */
.home-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--panel-strong);
  border: 1px solid var(--line-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  text-decoration: none;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.home-btn:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 212, 255, 0.4);
  color: var(--primary);
}

/* Carte principale d'authentification */
.auth-card {
  background: var(--panel-strong);
  border: 1px solid var(--line-soft);
  border-radius: 24px;
  padding: 40px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  max-width: 500px;
  width: 100%;
  animation: fadeInUp 0.6s ease-out;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 120% at 0% 0%, rgba(0, 212, 255, 0.08), transparent 60%);
  pointer-events: none;
}

.auth-card > * {
  position: relative;
  z-index: 1;
}

/* Titres d'authentification */
.auth-title {
  font-family: 'Orbitron', monospace;
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 800;
  color: var(--primary);
  text-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
  margin-bottom: 16px;
  text-align: center;
}

.auth-subtitle {
  color: var(--muted);
  text-align: center;
  margin-bottom: 32px;
  font-size: 16px;
}

.auth-subtitle a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.auth-subtitle a:hover {
  color: var(--text);
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.6);
}

/* Formulaires d'authentification */
.auth-form {
  margin-bottom: 24px;
}

.auth-form .form-group {
  margin-bottom: 20px;
}

.auth-form label {
  color: var(--text);
  font-weight: 600;
  margin-bottom: 8px;
  display: block;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Messages d'erreur et d'aide */
.auth-form .text-danger,
.auth-form .invalid-feedback {
  color: var(--danger);
  font-size: 13px;
  margin-top: 6px;
  display: block;
}

.auth-form .form-text,
.auth-form .help-text {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

/* ============================================
   INFO TOOLTIP (password requirements)
   ============================================ */
.label-with-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  transition: color 0.2s ease;
}

.info-tooltip:hover,
.info-tooltip:focus {
  color: var(--primary);
  outline: none;
}

.info-tooltip-content {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(15, 25, 42, 0.98), rgba(10, 18, 30, 0.95));
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 12px;
  padding: 14px 16px;
  min-width: 260px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5),
              0 0 20px rgba(0, 212, 255, 0.1);
  backdrop-filter: blur(16px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  z-index: 100;
  pointer-events: none;
  font-size: 12px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
}

.info-tooltip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: rgba(0, 212, 255, 0.3);
}

.info-tooltip-content strong {
  display: block;
  color: var(--primary);
  margin-bottom: 8px;
  font-size: 13px;
}

.info-tooltip-content ul {
  margin: 0;
  padding-left: 16px;
  list-style: disc;
}

.info-tooltip-content li {
  margin-bottom: 4px;
  color: var(--muted);
  line-height: 1.4;
}

.info-tooltip-content li:last-child {
  margin-bottom: 0;
}

.info-tooltip:hover .info-tooltip-content,
.info-tooltip:focus .info-tooltip-content {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Cases à cocher et radio */
.auth-form .form-check {
  margin: 16px 0;
}

.auth-form .form-check-input {
  background: rgba(15, 25, 42, 0.6);
  border: 1px solid var(--line-soft);
  width: 18px;
  height: 18px;
}

.auth-form .form-check-input:checked {
  background: var(--primary);
  border-color: var(--primary);
}

.auth-form .form-check-label {
  color: var(--text);
  font-size: 14px;
  margin-left: 8px;
}

/* Boutons d'authentification */
.auth-btn {
  width: 100%;
  padding: 14px 20px;
  border-radius: 12px;
  border: 2px solid transparent;
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 16px;
  margin-top: 50px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-btn.primary {
  background: linear-gradient(45deg, var(--primary), var(--primary-2));
  color: #001018;
  box-shadow: 0 0 22px rgba(0, 212, 255, 0.45);
}

.auth-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 212, 255, 0.55);
}

.auth-btn.danger {
  background: linear-gradient(45deg, var(--danger), #ff5555);
  color: white;
  box-shadow: 0 0 22px rgba(255, 122, 122, 0.45);
}

.auth-btn.danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(255, 122, 122, 0.55);
}

.auth-btn.outline {
  background: transparent;
  border-color: var(--line);
  color: var(--primary);
  box-shadow: 0 0 14px rgba(0, 212, 255, 0.25);
}

.auth-btn.outline:hover {
  background: rgba(0, 212, 255, 0.10);
  border-color: var(--primary);
}

/* Boutons sociaux */
.social-login {
  margin-top: 24px;
}

.social-title {
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  margin-bottom: 16px;
  position: relative;
}

.social-title::before,
.social-title::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--line-soft);
}

.social-title::before {
  left: 0;
}

.social-title::after {
  right: 0;
}

.social-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.social-btn {
  flex: 1;
  min-width: 120px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(15, 25, 42, 0.6);
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.social-btn:hover {
  border-color: var(--primary);
  background: rgba(0, 212, 255, 0.08);
  color: var(--primary);
  transform: translateY(-2px);
}

.social-btn.google:hover {
  border-color: var(--primary);
  background: rgba(0, 212, 255, 0.08);
  color: var(--primary);
}

.social-btn.facebook:hover {
  border-color: #1877f2;
  background: rgba(24, 119, 242, 0.08);
  color: #1877f2;
}

/* ============================================
   HERO SOCIAL BUTTON (primary position)
   ============================================ */
.social-login-primary {
  margin-bottom: 16px;
}

.social-btn-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  border: 2px solid var(--line-soft);
  background: rgba(15, 25, 42, 0.6);
  color: var(--text);
  text-decoration: none;
  transition: all 0.3s ease;
}

.social-btn-hero .social-icon {
  font-size: 20px;
  display: flex;
  align-items: center;
}

.social-btn-hero.google:hover {
  border-color: var(--primary);
  background: rgba(0, 212, 255, 0.12);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.2);
}

/* Auth separator (or) */
.auth-separator {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.auth-separator::before,
.auth-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--line-soft), transparent);
}

.auth-separator span {
  padding: 0 16px;
}

/* Gestion des emails */
.email-list {
  margin: 24px 0;
}

.email-item {
  background: rgba(15, 25, 42, 0.4);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
}

.email-item:hover {
  border-color: var(--line);
  background: rgba(15, 25, 42, 0.6);
}

.email-item input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.email-address {
  flex: 1;
  color: var(--text);
  font-weight: 500;
}

.email-status {
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.email-status.verified {
  background: rgba(33, 230, 163, 0.15);
  color: var(--success);
  border: 1px solid rgba(33, 230, 163, 0.3);
}

.email-status.unverified {
  background: rgba(255, 122, 122, 0.15);
  color: var(--danger);
  border: 1px solid rgba(255, 122, 122, 0.3);
}

.email-status.primary {
  background: rgba(0, 212, 255, 0.15);
  color: var(--primary);
  border: 1px solid var(--line);
}

/* Actions pour les emails */
.email-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.email-actions .auth-btn {
  flex: 1;
  min-width: 120px;
  padding: 8px 12px;
  font-size: 12px;
  margin-bottom: 0;
}

/* Notifications et alertes */
.auth-alert {
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 20px;
  border: 1px solid;
  position: relative;
  overflow: hidden;
}

.auth-alert::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: currentColor;
}

.auth-alert.success {
  background: rgba(33, 230, 163, 0.1);
  color: var(--success);
  border-color: rgba(33, 230, 163, 0.3);
}

.auth-alert.error {
  background: rgba(255, 122, 122, 0.1);
  color: var(--danger);
  border-color: rgba(255, 122, 122, 0.3);
}

.auth-alert.warning {
  background: rgba(255, 204, 102, 0.1);
  color: var(--warning);
  border-color: rgba(255, 204, 102, 0.3);
}

.auth-alert.info {
  background: rgba(0, 212, 255, 0.1);
  color: var(--primary);
  border-color: var(--line);
}

/* Reset password steps */
.reset-steps {
  list-style: none;
  padding: 0;
  margin: 24px 0;
}

.reset-steps li {
  display: flex;
  align-items: flex-start;
  margin-bottom: 12px;
  color: var(--text);
}

.reset-steps .step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(45deg, var(--primary), var(--primary-2));
  color: #001018;
  font-weight: 700;
  font-size: 12px;
  margin-right: 12px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Responsive */
@media (max-width: 768px) {
  .auth-card {
    padding: 30px 20px;
    margin: 10px;
    border-radius: 16px;
  }
  
  .home-btn {
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
  }
  
  .social-buttons {
    flex-direction: column;
  }
  
  .social-btn {
    width: 100%;
  }
  
  .email-actions {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .auth-wrapper {
    padding: 10px;
  }
  
  .auth-card {
    padding: 24px 16px;
  }
  
  .auth-title {
    font-size: 24px;
  }
}

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

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.auth-card {
  animation: fadeInUp 0.6s ease-out;
}

/* États de chargement */
.auth-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}

.auth-btn.loading::after {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 8px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* TOTP QR: make it visible on dark cards */
.qr-wrap {
  display: flex;
  justify-content: center;
  margin: 12px 0;
}

.qr-wrap img {
  /* White tile behind the (transparent) SVG */
  background: #fff;
  padding: 12px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  line-height: 0;
}