/* Réinitialisation des styles pour la saisie automatique */
input:-webkit-autofill,
input:-webkit-autofill:focus,
input:-webkit-autofill:hover,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0px 1000px transparent inset !important; /* Réinitialise la couleur de fond */
    transition: background-color 5000s ease-in-out 0s; /* Retarde la transition de la couleur de fond */
}

/* Réinitialisation des styles pour la saisie automatique du mot de passe */
input:-webkit-autofill::first-line {
    font-size: 16px; /* Réinitialise la taille de police pour la saisie automatique du mot de passe */
}

/* Mise en forme des labels même en cas d'autofill */
.inputbox label:-webkit-autofill {
    top: -5px !important;
}

* {
    margin: 0;
    padding: 0;
    font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", "Lucida Sans", Arial, sans-serif;
}

section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    background: url("../../../assets/img/connexion.webp") no-repeat; /* Correction ici */
    background-position: center;
    background-size: cover;
}

.form-box {
    position: relative;
    width: 400px;
    min-height: 550px;
    padding: 40px 0;
    background: transparent;
    border: none;
    border-radius: 20px;
    backdrop-filter: blur(15px) brightness(80%);
    display: flex;
    justify-content: center;
    align-items: center;
}

h2 {
    font-size: 2em;
    color: #fff;
    text-align: center;
}

.inputbox {
    position: relative;
    margin: 30px 0;
    width: 310px;
    border-bottom: 2px solid #fff;
}

.inputbox label {
    position: absolute;
    top: 50%;
    left: 5px;
    transform: translateY(-50%);
    color: #fff;
    font-size: 1em;
    pointer-events: none;
    transition: 0.5s;
}

/* animations: start */
input:focus~label,
input:valid~label {
    top: -5px;
}

/* animation:end */
.inputbox input {
    width: 100%;
    height: 50px;
    background: transparent;
    border: none;
    outline: none;
    font-size: 1em;
    padding: 0 35px 0 5px;
    color: #fff;
}

.inputbox ion-icon {
    position: absolute;
    right: 8px;
    color: #fff;
    font-size: 1.2em;
    top: 20px;
}

.forget {
    margin: -10px 0 17px;
    font-size: 0.9em;
    color: #fff;
    display: flex;
    justify-content: space-between;
}

.forget label input {
    margin-right: 3px;
}

.forget a {
    color: #fff;
    text-decoration: none;
}

.forget a:hover {
    text-decoration: underline;
}

button {
    width: 100%;
    height: 40px;
    border-radius: 40px;
    background-color: #fff;
    border: none;
    outline: none;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
}

.register {
    font-size: 0.9em;
    color: #fff;
    text-align: center;
    margin: 25px 0 10px;
}

.register p a {
    text-decoration: none;
    color: #fff;
    font-weight: 600;
}

.register p a:hover {
    text-decoration: underline;
}

@media screen and (max-width: 480px) {
    .form-box {
        width: 100%;
        border-radius: 0px;
    }
}

.float-titre {
    font-size: 2em;
    color: #282923;
    text-align: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1; /* Assurez-vous que les h2 sont au-dessus de l'image de fond */
}

.logo-container {
    position: absolute;
    left: 50%;
    bottom: 20px; /* Ajustez cette valeur selon vos besoins */
    transform: translateX(-50%);
    z-index: 1; /* Assurez-vous que le logo est au-dessus de l'image de fond */
}

.my-swal-container .swal2-modal {
    max-width: 75%;
}

.my-swal-container .swal2-popup .form-group {
    max-width: 75%;
    margin: auto; /* Pour centrer la div horizontalement */
}

/* ================= PASSWORD VALIDATION CLEAN ================= */

.inputbox {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

/* Valide */
.inputbox.valid {
    border-bottom: 2px solid #28a745;
    box-shadow: 0 5px 15px -10px rgba(40, 167, 69, 0.7);
}

/* Invalide */
.inputbox.invalid {
    border-bottom: 2px solid #dc3545;
    box-shadow: 0 5px 15px -10px rgba(220, 53, 69, 0.7);
}

/* ================= PASSWORD STRENGTH ================= */

.password-strength-container {
    margin-top: 12px;
}

.password-strength-bar {
    height: 8px;
    width: 100%;
    background: rgba(255,255,255,0.2);
    border-radius: 5px;
    overflow: hidden;
}

.password-strength-progress {
    height: 100%;
    width: 0%;
    transition: width 0.4s cubic-bezier(.4,0,.2,1), background 0.3s ease;
    border-radius: 5px;
}

/* Couleurs */
.strength-weak {
    background: #dc3545; /* Rouge */
}

.strength-medium {
    background: #fd7e14; /* Orange */
}

.strength-strong {
    background: #28a745; /* Vert */
}

.password-strength-text {
    font-size: 0.85rem;
    margin-top: 6px;
    font-weight: 500;
    transition: 0.3s ease;
}

/* Input states */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ================= INFO BUTTON RULES================= */
/* Bouton info */

.inputbox .fa-lock {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #ffffffcc;
    font-size: 1.1em;
    pointer-events: none; /* important */
}

/* Bouton info */
.password-info-toggle {
    position: absolute;
    right: 40px; /* Décalé pour laisser place au lock */
    top: 50%;
    transform: translateY(-50%);
    color: #ffffffcc;
    cursor: pointer;
    transition: 0.3s ease;
}

.password-info-toggle:hover {
    color: #fff;
    transform: translateY(-50%) scale(1.1);
}

/* Wrapper animé */
.password-rules-wrapper {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease;
}

.password-rules-wrapper.show {
    max-height: 200px;
    opacity: 1;
}

/* Style règles */
.password-rules {
    font-size: 0.8rem;
    margin-top: 10px;
    padding-left: 0;
}

.password-rules li {
    list-style: none;
    color: #ffffffcc;
    margin: 4px 0;
}