/**
 * @file
 * Styles pour le formulaire de connexion Neolym
 */

/* Cacher le titre du bloc généré par Drupal */
.block-neolym-login .block__title {
  display: none;
}

/* Wrapper global */ 
.neolym-login-wrapper {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding-top: 3rem;
  padding-bottom: 3rem;
  gap: 1rem;
  justify-content: center;
  overflow-x: hidden;
}

@media (max-width: 768px) {
  .neolym-login-wrapper {
    padding: 0.5rem;
    gap: 0.5rem;
  }
}

/* Titre du formulaire */
.neolym-login-form__title h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
}

@media (max-width: 1024px) {
  .neolym-login-form__title h3 {
    font-size: 1rem;
  }
}

@media (max-width: 768px) {
  .neolym-login-form__title {
    display: none;
  }
}

/* Container des champs en ligne */
.neolym-login-form__fields {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: nowrap;
}

/* Le form Drupal qui s'insère doit aussi être en flex */
.neolym-login-form__fields > form,
.neolym-login-form__fields .neolym-login-form {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: nowrap;
  width: 100%;
}

/* Tablettes et petits écrans */
@media (max-width: 1024px) {
  .neolym-login-form__fields {
    gap: 0.5rem;
  }
  
  .neolym-login-form__fields > form,
  .neolym-login-form__fields .neolym-login-form {
    gap: 0.5rem;
  }
}

@media (max-width: 768px) {
  .neolym-login-form__fields {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  
  .neolym-login-form__fields > form,
  .neolym-login-form__fields .neolym-login-form {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
}

@media (max-width: 576px) {
  .neolym-login-form__fields {
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
  }
  
  .neolym-login-form__fields > form,
  .neolym-login-form__fields .neolym-login-form {
    flex-direction: column;
  }
}

/* Champ email (form-item) */
.neolym-login-form .form-item {
  flex: 1;
  min-width: 200px;
  margin: 0;
}

@media (max-width: 1024px) {
  .neolym-login-form .form-item {
    min-width: 180px;
  }
}

@media (max-width: 576px) {
  .neolym-login-form .form-item {
    width: 100%;
    min-width: auto;
  }
}

/* Masquer le label visuellement mais le garder pour l'accessibilité */
.neolym-login-form .form-item label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Style du champ email */
.neolym-login-form .form-item input[type="email"] {
  width: 100%;
  max-width: 350px;
  padding: 0.875rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  line-height: 1.5;
  transition: all 0.3s ease;
  background-color: #ffffff;
}

@media (max-width: 1024px) {
  .neolym-login-form .form-item input[type="email"] {
    padding: 0.75rem 0.875rem;
    font-size: 0.9375rem;
  }
}

@media (max-width: 576px) {
  .neolym-login-form .form-item input[type="email"] {
    padding: 0.75rem 0.875rem;
    font-size: 0.9375rem;
  }
}

.neolym-login-form .form-item input[type="email"]::placeholder {
  color: #999;
  opacity: 1;
}

.neolym-login-form .form-item input[type="email"]:focus {
  outline: none;
  border-color: #00bde2;
  box-shadow: 0 0 0 3px rgba(0, 189, 226, 0.1);
}

.neolym-login-form .form-item input[type="email"]:hover:not(:focus) {
  border-color: #4dd4f4;
}

/* Message d'erreur */
.neolym-login-form .form-item .form-item__error-message {
  margin-top: 0.5rem;
  color: #dc3545;
  font-size: 0.875rem;
}

/* Actions (bouton submit) */
.neolym-login-form .form-actions {
  margin: 0;
  flex-shrink: 0;
}

@media (max-width: 576px) {
  .neolym-login-form .form-actions {
    width: 100%;
  }
}

.neolym-login-form .form-actions button[type="submit"],
.neolym-login-form .form-actions input[type="submit"] {
  padding: 0.875rem 2rem;
  background-color: #00bde2;
  border: 2px solid #00bde2;
  border-radius: 8px;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

@media (max-width: 1024px) {
  .neolym-login-form .form-actions button[type="submit"],
  .neolym-login-form .form-actions input[type="submit"] {
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
  }
}

@media (max-width: 576px) {
  .neolym-login-form .form-actions button[type="submit"],
  .neolym-login-form .form-actions input[type="submit"] {
    width: 100%;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
  }
}

.neolym-login-form .form-actions button[type="submit"]:hover:not(:disabled),
.neolym-login-form .form-actions input[type="submit"]:hover:not(:disabled) {
  background-color: #009bbf;
  border-color: #009bbf;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 189, 226, 0.3);
}

.neolym-login-form .form-actions button[type="submit"]:active:not(:disabled),
.neolym-login-form .form-actions input[type="submit"]:active:not(:disabled) {
  transform: translateY(0);
}

.neolym-login-form .form-actions button[type="submit"]:disabled,
.neolym-login-form .form-actions input[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Variante pour fond sombre/image */
.neolym-login-form--light .neolym-login-form__title h3 {
  color: #ffffff;
}

.neolym-login-form--light .form-item input[type="email"] {
  background-color: rgba(255, 255, 255, 0.95);
  border-color: rgba(255, 255, 255, 0.3);
}

.neolym-login-form--light .form-item input[type="email"]:focus {
  background-color: #ffffff;
  border-color: #ffffff;
}

/* Bloc contenant le formulaire */
.block--neolym-login-login-form-block {
  width: 100%;
}

.block--neolym-login-login-form-block .block__title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.block--neolym-login-login-form-block .block__content {
  width: 100%;
}

/* Messages de statut/erreur - Styles communs */
.messages,
.alert {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  margin-left: auto;
  margin-right: auto;
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  line-height: 1.5;
  width: fit-content;
  max-width: 100%;
  text-align: center;
}

/* Masquer le bouton de fermeture dans les messages */
.messages .btn-close,
.alert .btn-close {
  display: none;
}

/* Messages de succès */
.messages--status,
.alert-success {
  background-color: #d1e7dd;
  color: #0f5132;
  border: 1px solid #badbcc;
}

/* Messages d'erreur */
.messages--error,
.alert-danger {
  background-color: #f8d7da;
  color: #842029;
  border: 1px solid #f5c2c7;
}

/* Lien de connexion alternative */
.neolym-login-alternative-link {
  padding: 1rem;
  text-align: center;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.neolym-login-alternative-link__text {
  margin: 0 0 0.5rem 0;
  font-size: 0.9375rem;
  color: #666;
}

.neolym-login-alternative-link__countdown {
  display: inline-block;
  margin-left: 0.25rem;
  color: #999;
  font-size: 0.875rem;
}

.neolym-login-alternative-link__link {
  display: inline-block;
  padding: 0.625rem 1.5rem;
  background-color: #00bde2;
  color: #ffffff;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all 0.3s ease;
}

.neolym-login-alternative-link__link:hover:not(.disabled) {
  background-color: #009bbf;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 189, 226, 0.3);
}

.neolym-login-alternative-link__link.disabled {
  background-color: #ccc;
  color: #888;
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.6;
}

.neolym-login-alternative-link__link.loading {
  background-color: #00bde2;
  opacity: 0.7;
  cursor: wait;
  pointer-events: none;
}

@media (max-width: 576px) {
  .neolym-login-alternative-link {
    padding: 0.75rem;
  }
  
  .neolym-login-alternative-link__text {
    font-size: 0.875rem;
  }
  
  .neolym-login-alternative-link__link {
    width: 100%;
    display: block;
    padding: 0.75rem 1rem;
  }
}

