/* ================= MODALES GÉNÉRALES ================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17,24,39,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px; 
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: 0.2s ease-out;
    padding-top: 80px; /* distance depuis le haut */

}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(10px);
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 100%;

}

.modal-overlay.active .modal-card {
    transform: scale(1) translateY(0);
}

.modal-scrollable-content {
flex: 1;          /* New Prend tout l'espace entre le header et le footer */
    overflow-y: auto;
    overflow-x: hidden;
/*    padding: 24px;*/
    padding: 0;       /* On laisse le padding au form-body pour plus de propreté */
}

/* Le footer est "poussé" en bas et ne réduit jamais de taille */
.form-footer {
    flex-shrink: 0;   /* Empêche le footer de s'écraser */
    background: #f9fafb;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* HEADER */
.modal-header {
    text-align: center;
    margin-bottom: 16px;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 800;
}

.modal-header p {
    font-size: 14px;
    color: #6b7280;
}


.modal-lg { max-width: 500px; max-height: 90vh;width: 100%;   }
.modal-sm { max-width: 400px; width: 100%;   }


/* FORMULAIRES */
/* 16 Mars debut */
.modal-card.modal-lg {
    width: 100%;
    max-width: 720px;
}
/* 16 Mars fin */

.modal-card input,
.modal-card select,
.modal-card textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    outline: none;
    font-size: 14px;
}

.modal-card textarea {
    resize: vertical;
    min-height: 100px;
    max-height: 200px;
}

.welcome-section {
    text-align: center;
    margin-bottom: 32px;
}

.welcome-title {
    font-size: 26px;
    font-weight: 900;
    margin-bottom: 8px;
    /* Création d'un beau dégradé de couleur sur le texte */
    background: linear-gradient(90deg, #4f46e5, #9333ea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent; /* Fallback */
}

.welcome-subtitle {
    font-size: 15px;
    color: #6b7280;
    line-height: 1.5;
    max-width: 80%;
    margin: 0 auto;
}

/* BOUTONS */
.btn-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

.btn-submit {
    background: #4f46e5;
    color: #fff;
    padding: 12px;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    transition: 0.2s;
}

.btn-submit:hover {
    background: #4338ca;
}

.modal-footer {
    text-align: center;
    padding: 16px;
    font-size: 13px;
}

/* Le formulaire devient un conteneur Flex qui prend tout l'espace sous le header */
.profile-form, .modal-form-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden; /* Empêche le form lui-même de dépasser */
}