/**
 * ============================================================================
 * LOGIN MODAL - Styles
 * ============================================================================
 * Modal de connexion/forgot password
 * Design cohérent avec le reste du site
 * ============================================================================
 */

/* ═══════════════════════════════════════════════════════════════════════
   MODAL OVERLAY & CONTAINER
   ═══════════════════════════════════════════════════════════════════════ */

.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20001;  /* Au-dessus du booking widget (20000) */
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  pointer-events: none;  /* Pas d'interaction quand caché */
}

.auth-modal.active {
  display: flex;
  pointer-events: auto;  /* Réactiver les interactions quand ouvert */
}

.auth-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease;
}

.auth-modal-content {
  position: relative;
  background: var(--bg-color);
  border-radius: var(--border-radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  max-width: 450px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2.5rem 2rem;
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 20002;  /* Au-dessus de l'overlay login (20001) */
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Bouton fermeture */
.auth-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-light);
  cursor: pointer;
  transition: var(--transition);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.auth-modal-close:hover {
  background: var(--bg-secondary);
  color: var(--text-color);
  transform: rotate(90deg);
}

/* ═══════════════════════════════════════════════════════════════════════
   AUTH VIEWS
   ═══════════════════════════════════════════════════════════════════════ */

.auth-view {
  display: none;
  animation: fadeIn 0.3s ease;
}

.auth-view.active {
  display: block;
}

/* Icône */
.auth-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: var(--bg-secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  font-size: 2rem;
}

/* Titres */
.auth-title {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 2rem;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════════════
   FORM
   ═══════════════════════════════════════════════════════════════════════ */

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

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

.form-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.form-group label i {
  color: var(--text-light);
  font-size: 0.9rem;
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 1rem;
  color: var(--text-color);
  background: var(--bg-color);
  transition: var(--transition);
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .form-group input:focus {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

/* Password input avec toggle */
.password-input-wrapper {
  position: relative;
}

.password-input-wrapper input {
  padding-right: 3rem;
}

.toggle-password {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 0.5rem;
  transition: var(--transition);
}

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

/* Lien mot de passe oublié */
.forgot-password-link {
  display: block;
  text-align: right;
  font-size: 0.85rem;
  color: var(--text-light);
  text-decoration: none;
  margin-bottom: 1.5rem;
  transition: var(--transition);
}

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

/* ═══════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════ */

.btn-auth-primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.875rem 1.5rem;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-auth-primary:hover:not(:disabled) {
  background: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-auth-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-auth-primary i {
  font-size: 1.1rem;
}

.btn-auth-secondary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: var(--bg-secondary);
  color: var(--text-color);
  border: 2px solid var(--border-color);
  padding: 0.875rem 1.5rem;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-auth-secondary:hover {
  background: var(--bg-color);
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-auth-text {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.75rem;
  transition: var(--transition);
  margin-top: 1rem;
  width: 100%;
}

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

/* ═══════════════════════════════════════════════════════════════════════
   DIVIDER
   ═══════════════════════════════════════════════════════════════════════ */

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

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

.auth-divider span {
  position: relative;
  background: var(--bg-color);
  padding: 0 1rem;
  color: var(--text-light);
  font-size: 0.85rem;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════════
   ERROR & SUCCESS MESSAGES
   ═══════════════════════════════════════════════════════════════════════ */

/* Empêcher les images vides de s'afficher */
.auth-modal img[src=""],
.auth-modal img:not([src]) {
  display: none !important;
}

.auth-error,
.auth-success {
  display: none;
  padding: 0.875rem 1rem;
  border-radius: var(--border-radius);
  font-size: 0.9rem;
  margin-top: 1rem;
}

.auth-error.show,
.auth-success.show {
  display: block;
  animation: slideDown 0.3s ease;
}

.auth-error {
  background: #fff5f5;
  color: #dc3545;
  border: 1px solid #ffdddd;
}

.auth-success {
  background: #f0fff4;
  color: #28a745;
  border: 1px solid #c3f3d0;
}

[data-theme="dark"] .auth-error {
  background: #2d1f1f;
  border-color: #5a3030;
}

[data-theme="dark"] .auth-success {
  background: #1f2d20;
  border-color: #305a33;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
  .auth-modal-content {
    padding: 2rem 1.5rem;
    max-width: 95%;
  }

  .auth-title {
    font-size: 1.5rem;
  }

  .auth-subtitle {
    font-size: 0.9rem;
  }

  .auth-icon {
    width: 70px;
    height: 70px;
    font-size: 1.75rem;
  }

  .btn-auth-primary,
  .btn-auth-secondary {
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
  }
}

/* Scrollbar pour le modal */
.auth-modal-content::-webkit-scrollbar {
  width: 6px;
}

.auth-modal-content::-webkit-scrollbar-track {
  background: transparent;
}

.auth-modal-content::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

.auth-modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* ═══════════════════════════════════════════════════════════════════════
   PASSWORD STRENGTH INDICATOR
   ═══════════════════════════════════════════════════════════════════════ */

.password-strength-indicator {
  margin-top: 0.75rem;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.3s ease, max-height 0.3s ease;
}

.password-strength-indicator.visible {
  opacity: 1;
  max-height: 200px;
}

.password-requirements {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.requirement {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.requirement i {
  font-size: 0.5rem;
  color: rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.requirement.met {
  color: #22c55e;
  font-weight: 500;
}

.requirement.met i {
  color: #22c55e;
}

.requirement.met i::before {
  content: "\f058";  /* fa-check-circle */
}
