.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    max-width: 900px;
    width: 100%;
    /* min-height: 400px; */
    /* adapté pour tous les éléments qui peuvent changer */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.forms-container {
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    /* overflow: hidden; */
}

.form-content {
    /* Transition sur opacity et transform SEULEMENT */
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* IMPORTANT : pas de position absolute ! */
    position: relative;
    
    /* Masqué par défaut mais prend sa place dans le flow */
    visibility: hidden;
    height: 0;
    overflow: hidden;
    
    /* Transition sur height et visibility */
    transition: 
        opacity 0.3s ease,
        transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0s linear 0.4s; /* Délai pour visibility */
}

.form-content.active {
    opacity: 1;
    transform: translateX(0);
    visibility: visible;
    height: auto;
    transition: 
        opacity 0.3s ease,
        transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0s linear 0s; /* Pas de délai pour l'affichage */
}


.image-section {
    background: linear-gradient(45deg, var(--primary-color), #2d1f0f);
    position: relative;
    overflow: hidden;
}

.image-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../assets/images/forms/aglae-login450.jpg') center/cover;
    opacity: 1;
}

.image-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(24, 20, 12, 0.6), rgba(45, 31, 15, 0.7));
}


/* Quand le mot de passe est saisi (via ng-if ou ng-show) */
.password-strength.show,
.form-content:has(input[ng-model*="password"]:not([value=""])) .password-strength {
    max-height: 200px; /* Hauteur suffisante pour le contenu */
    opacity: 1;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

/* Alternative avec :has() pour navigateurs modernes */
.form-content:has(input[type="password"]:not(:placeholder-shown)) .password-strength {
    max-height: 200px;
    opacity: 1;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

.form-section {
    padding: 3rem;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand-header {
    text-align: center;
    margin-bottom: 2rem;
}

.brand-title {
    font-family: 'AGLAE-title';
    color: var(--primary-color);
    font-size: 3rem;
    /* font-weight: 700; */
    /* margin-bottom: 0.5rem; */
    position: relative;
}

.brand-subtitle {
    font-family: 'Exo 2', sans-serif;
    color: var(--karate-gold);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0;
    letter-spacing: 1px;
}

.form-floating {
    margin-bottom: 1.5rem;
}

.form-floating > .form-control {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1rem 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.form-floating > .form-control:focus {
    border-color: var(--blue-color);
    box-shadow: 0 0 0 0.2rem rgba(20, 64, 207, 0.25);
    background: white;
}

.form-floating > label {
    color: #6c757d;
    font-weight: 500;
}

.btn-login {
    background: var(--blue-gradient);
    color: white;
}

.btn:disabled{
    color: white;
}

.btn-login:hover {
    background: linear-gradient(135deg, #044880, #0c4a7c);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(20, 39, 207, 0.4);
    color: white;
}

.btn-signup {
    background: var(--red-gradient);
    color: white;
}

.btn-signup:hover {
    background: linear-gradient(135deg, #bc2d12, #a8271e);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(207, 49, 20, 0.4);
    color: white;
}

.btn-switch {
    background: transparent;
    border: 2px solid var(--karate-gold);
    color: var(--karate-gold);
    border: 2px solid var(--karate-gold);
}

.btn-switch:hover {
    background: var(--karate-gold);
    /* border: 2px solid darkred; */
    color: white;
}

.divider {
    display: flex;
    align-items: center;
    margin: 2rem 0;
    color: #6c757d;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #dee2e6;
}

.divider span {
    padding: 0 1rem;
    font-weight: 500;
}

/* 5. MESSAGES D'ERREUR/SUCCÈS AVEC TRANSITION */
.error-message,
.success-message {
    /* max-height: 0;
    opacity: 0; */
    /* overflow: hidden;
    margin: 0;
    padding: 0; */
    
    transition: 
        max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.2s ease,
        margin 0.3s ease,
        padding 0.3s ease;
}

.error-message.show,
.success-message.show {
    max-height: 100px;
    opacity: 1;
    margin-top: 1rem;
    padding: 12px;
}

/* 6. GESTION DES DIFFÉRENTS SOUS-FORMULAIRES */
#signInForm,
#signUpForm,
#successMailSend,
#passwordChange,
#forgotPassword,
#accountValidated {
    /* Tous héritent des mêmes règles .form-content */
}

/* 7. HAUTEUR SPÉCIFIQUE SI NÉCESSAIRE */
#signInForm.active { min-height: auto; } /* Formulaire le plus petit */
#signUpForm.active { min-height: auto; } /* Plus grand avec validation password */
#successMailSend.active { min-height: auto; } /* Message de succès */
#passwordChange.active { min-height: auto; } /* Changement de mot de passe */
#accountValidated.active { min-height: auto; } /* Changement de mot de passe */



.input-group-text {
    background: transparent;
    border: 2px solid #e9ecef;
    border-right: none;
    color: var(--secondary-color);
}

.form-control.with-icon {
    border-left: none;
    padding-left: 0;
}

@media (max-width: 768px) {
    .form-section {
        padding: 2rem 1.5rem;
    }
    
    .brand-title {
        font-size: 1.5rem;
    }
    
    .image-section {
        min-height: 200px;
    }

    .form-content,
    .password-strength,
    .error-message,
    .success-message {
        /* Transitions plus rapides sur mobile */
        transition-duration: 0.2s;
    }

}

/* 10. FALLBACK pour navigateurs sans :has() */
@supports not selector(:has(*)) {
    /* Alternative avec classes JavaScript */
    .password-strength.js-show {
        max-height: 200px;
        opacity: 1;
        margin-top: 1rem;
        margin-bottom: 1.5rem;
    }
}

.floating-keywords {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 5;
}

.keyword {
    position: absolute;
    color: rgba(212, 175, 55, 0.8);
    font-weight: 600;
    font-size: 1.2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: keywordFloat 8s ease-in-out infinite;
    opacity: 0;
    filter: blur(0.5px);
    transition: all 0.3s ease;
    text-transform:uppercase;
}

.keyword:hover {
    filter: blur(0);
    opacity: 1 !important;
    transform: scale(2) !important;
}

.keyword:nth-child(1) { /* Karaté */
    top:15%;
    left: 10%;
    animation-delay: 0s;
}

.keyword:nth-child(2) { /* Self défense */
    top: 27%;
    right: 12%;
    animation-delay: 1.5s;
}

.keyword:nth-child(3) { /* Body Karaté */
    bottom: 22%;
    left: 15%;
    animation-delay: 3s;
}

.keyword:nth-child(4) { /* Apport Physique et Sportif */
    bottom: 9%;
    right: 11%;
    animation-delay: 4.5s;
}

@keyframes keywordFloat {
    0% { 
        opacity: 0; 
        transform: translateY(20px); 
        filter: blur(8px);
    }
    25% { 
        opacity: 0.6; 
        transform: translateY(0px); 
        filter: blur(0.5px);
    }
    50% { 
        opacity: 0.8; 
        transform: translateY(-10px); 
        filter: blur(0px);
    }
    75% { 
        opacity: 0.6; 
        transform: translateY(0px); 
        filter: blur(0.5px);
    }
    100% { 
        opacity: 0; 
        transform: translateY(20px); 
        filter: blur(8px);
    }
}

.strength-bar { height: 4px; background: #e9ecef; border-radius: 2px; }
.strength-fill { height: 100%; border-radius: 2px; transition: all 0.3s; }
.strength-weak { width: 25%; background: #dc3545; }
.strength-fair { width: 50%; background: #ffc107; }
.strength-good { width: 75%; background: #17a2b8; }
.strength-strong { width: 100%; background: #28a745; }
/* 11. BONUS : Animation des critères de validation */
.criteria-item {
    transition: all 0.2s ease;
    opacity: 0.6;
}

.criteria-item.valid {
    opacity: 1;
    transform: translateX(5px);
}

.validation-criteria {
    transition: all 0.3s ease;
}


/* forçage des classe is-valid/invalid/warning pour les champs textuels */
/* .form-floating > .form-control.is-valid {
    border-color: #488568 !important;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25) !important;
} */

.form-floating > .form-control.is-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.1rem rgba(220, 53, 69, 0.25) !important;
}

.form-floating > .form-control.is-warning {
    border-color: #ffc107 !important;
    box-shadow: 0 0 0 0.1rem rgba(255, 193, 7, 0.25) !important;
}