/**
 * @file
 * Styles pour les onglets de connexion OTP.
 */

/* Wrapper avec padding pour la partie authentification */
.auth-content {
  max-width: 650px;
  margin: 0 auto;
  padding: 40px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border-top: 4px solid #0d75a3;
}

/* Titre Login avec espacement en haut */
.auth-user-form .form-header {
  margin-bottom: 1.5rem;
  color: #0d75a3;
  font-weight: 600;
  font-size: 1.75rem;
}

/* Phrase d'introduction */
.auth-intro {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-intro p,
.auth-intro > div {
  font-size: 1.08rem;
  margin-bottom: 0.5rem;
  color: #0d75a3;
  font-weight: 600;
}

.auth-options {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  display: inline-block;
  text-align: left;
  max-width: 320px;
}

.auth-options li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.auth-options li::before {
  content: "•";
  color: #0d75a3;
  font-weight: bold;
  position: absolute;
  left: 0;
  top: 0;
}

/* Container accordion */
.login-accordion-container {
  margin-bottom: 2rem;
}

.accordion {
  border: none;
}

.accordion-item {
  border: 1px solid #dee2e6;
  border-radius: 8px !important;
  margin-bottom: 0.75rem;
  overflow: hidden;
  background: #fff;
}

.accordion-item:last-child {
  margin-bottom: 0;
}

.accordion-header {
  margin: 0 !important;
  padding: 0 !important;
}

.accordion-button {
  background-color: #f8f9fa;
  color: #333;
  font-weight: 500;
  font-size: 1rem;
  padding: 1rem 1.25rem;
  border: none;
  transition: all 0.2s ease;
}

.accordion-button:not(.collapsed) {
  background-color: #0d75a3;
  color: #fff;
  box-shadow: none;
}

.accordion-button:hover {
  background-color: #e9ecef;
}

.accordion-button:not(.collapsed):hover {
  background-color: #0b6187;
  color: #fff;
}

.accordion-button:focus {
  box-shadow: 0 0 0 3px rgba(13, 117, 163, 0.25);
  border-color: #0d75a3;
}

.accordion-button::after {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23333'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
  transition: transform 0.2s ease;
}

.accordion-button:not(.collapsed)::after {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
  transform: rotate(-180deg);
}

.accordion-body {
  padding: 1.5rem 1.25rem;
  background: #fff;
}

/* Supprimer le padding et les bordures pour les accordion-body dans auth-content */
.auth-content .accordion-body {
  padding: 0;
  border: none;
  border-radius: 0;
  border-top: none;
}

/* Actions secondaires */
.auth-secondary-actions {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid #e9ecef;
  margin-top: 1.5rem;
}

.auth-link {
  color: #0d75a3;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.auth-link:hover {
  color: #0b6187;
  text-decoration: underline;
}

.auth-separator {
  margin: 0 1rem;
  color: #dee2e6;
}

/* Masquer le lien original "mot de passe oublié" */
.pass-link {
  display: none !important;
}

/* Description OTP */
.otp-description {
  border-left: 4px solid #17a2b8;
  transition: opacity 0.3s ease;
}

.otp-description i {
  margin-right: 0.5rem;
  color: #17a2b8;
}

/* Masquer la description OTP dans l'étape 2 */
.otp-description.step-2-active {
  display: none;
}

/* Étapes OTP */
.otp-step {
  transition: all 0.3s ease;
}

.otp-step-1 {
  text-align: center;
}

.otp-step-2 {
  animation: slideInUp 0.3s ease-out;
}

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

/* Bouton retour */
.otp-back-btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  color: #6c757d;
  text-decoration: none;
  margin-bottom: 1rem;
  margin: 10px auto;
  max-width: 300px;
  display: block;
}

.otp-back-btn:hover {
  color: #007bff;
  text-decoration: none;
}

.otp-back-btn i {
  margin-right: 0.25rem;
}

/* Informations du code */
.otp-code-info {
  text-align: center;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background-color: #d1ecf1;
  border-radius: 6px;
  border: 1px solid #bee5eb;
  border-left: 4px solid #17a2b8;
}

.otp-code-info > div {
  margin-bottom: 0.5rem;
}

.otp-code-info > div:last-child {
  margin-bottom: 0;
}

#otp-sent-email {
  color: #17a2b8;
  font-weight: 500;
}

/* Container des chiffres OTP */
.otp-digits-container {
  display: flex !important;
  justify-content: center;
  gap: 1rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

/* Champs de saisie OTP */
.otp-digit {
  width: 60px;
  height: 60px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: bold;
  border: 2px solid #ced4da;
  border-radius: 8px;
  background: #fff;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.otp-digit:focus {
  border-color: #007bff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
  transform: scale(1.05);
}

.otp-digit.filled {
  background-color: #e7f3ff;
  border-color: #007bff;
  color: #007bff;
}

.otp-digit.success {
  background-color: #d4edda;
  border-color: #28a745;
  color: #155724;
  transform: scale(1.02);
}

.otp-digit.error {
  border-color: #dc3545;
  background-color: #fff5f5;
  animation: shake 0.5s ease-in-out;
}

.otp-digit.paste-effect {
  animation: pulseIn 0.3s ease-out;
}

@keyframes pulseIn {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.15);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Auto-submit feedback */
.otp-digits-container.auto-submitting .otp-digit {
  border-color: #28a745;
  background-color: #d4edda;
  animation: successPulse 0.5s ease-in-out;
}

@keyframes successPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
  }
}

/* Boutons */
.otp-send-btn,
.otp-verify-btn {
  min-height: 48px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.otp-send-btn {
  background: linear-gradient(45deg, #007bff, #0056b3);
  border: none;
}

.otp-verify-btn {
  background: linear-gradient(45deg, #28a745, #1e7e34);
  border: none;
}

/* Messages */
#otp-messages-wrapper {
    margin-top: 10px !important
}

.otp-messages {
  margin-top: 1rem;
}

.otp-messages .alert {
  margin-bottom: 0;
  border-radius: 6px;
  border: none;
  font-weight: 500;
}

.alert-success {
  background: linear-gradient(45deg, #d4edda, #c3e6cb);
  color: #155724;
}

.alert-danger {
  background: linear-gradient(45deg, #f8d7da, #f5c6cb);
  color: #721c24;
}

/* États de chargement */
.otp-send-btn:disabled,
.otp-verify-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.otp-send-btn.loading {
  position: relative;
  color: transparent;
}

.otp-send-btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid transparent;
  border-top: 2px solid #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Responsive Mobile */
@media (max-width: 768px) {
  .auth-content {
    padding: 30px 20px;
  }
  
  .auth-user-form .form-header {
    font-size: 1.5rem;
  }
  
  .auth-intro {
    margin-bottom: 1.5rem;
  }
  
  .auth-intro p {
    font-size: 0.95rem;
  }
  
  .auth-options li {
    font-size: 0.9rem;
  }
  
  .accordion-button {
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
  }
  
  .accordion-body {
    padding: 1.25rem 1rem;
  }
  
  .otp-digits-container {
    gap: 0.5rem;
    margin: 1.5rem 0;
    justify-content: center;
  }
  
  .otp-digit {
    width: 65px;
    height: 65px;
    font-size: 1.8rem;
    font-weight: bold;
    line-height: 1;
  }

  .otp-code-info {
    margin-bottom: 1rem;
    padding: 0.75rem;
  }

  .otp-send-btn,
  .otp-verify-btn {
    min-height: 45px;
    padding: 0.75rem 1.5rem;
  }
  
  .otp-step-2.keyboard-visible {
    padding-bottom: 200px;
  }
  
  .auth-secondary-actions {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .auth-separator {
    display: none;
  }
  
  .auth-link {
    display: block;
  }
}

@media (max-width: 480px) {
  .auth-content {
    padding: 20px 15px;
  }
  
  .auth-user-form .form-header {
    font-size: 1.35rem;
  }
  
  .auth-intro {
    margin-bottom: 1rem;
  }
  
  .auth-intro p {
    font-size: 0.9rem;
  }
  
  .auth-options li {
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
  }
  
  .accordion-button {
    padding: 0.75rem 0.875rem;
    font-size: 0.9rem;
  }
  
  .accordion-button i {
    font-size: 0.85rem;
  }
  
  .accordion-body {
    padding: 1rem 0.875rem;
  }
  
  .otp-digits-container {
    gap: 0.4rem;
    margin: 1rem 0;
  }
  
  .otp-digit {
    width: 60px;
    height: 60px;
    font-size: 1.6rem;
    font-weight: bold;
  }

  .otp-code-info {
    padding: 0.5rem;
    margin-bottom: 0.75rem;
  }

  .otp-send-btn,
  .otp-verify-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }
}

/* Dark mode intentionally removed: prefer site default colors to avoid unreadable overrides */

/* Accessibilité */
@media (prefers-reduced-motion: reduce) {
  .otp-step-2,
  .otp-digit,
  .accordion-button,
  .accordion-button::after {
    animation: none;
    transition: none;
  }
  
  .otp-digit:focus,
  .otp-digit.error {
    transform: none;
    animation: none;
  }
  
  .otp-send-btn.loading::after {
    animation: none;
  }
}

/* Focus management pour accessibilité */
.accordion-button:focus {
  box-shadow: 0 0 0 3px rgba(13, 117, 163, 0.25);
  outline: none;
}

.auth-link:focus {
  outline: 2px solid #0d75a3;
  outline-offset: 2px;
}

/* === BOUTONS === */
.otp-send-btn,
.otp-verify-btn {
  min-height: 48px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.otp-send-btn {
  background: linear-gradient(45deg, #0d75a3, #0b6187);
  border: none;
}

.otp-verify-btn {
  background: linear-gradient(45deg, #28a745, #1e7e34);
  border: none;
}

/* États de chargement */
.otp-send-btn:disabled,
.otp-verify-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.otp-send-btn.loading {
  position: relative;
  color: transparent;
}

.otp-send-btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid transparent;
  border-top: 2px solid #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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