@media screen and (max-width: 1024px) {
    /* 1. On cache le formulaire statique pour libérer de l'espace */
    aside {
        display: none !important;
    }

    /* 2. On crée le bouton flottant "Je signe" */
    .sticky-petition-btn {
        display: block !important;
        position: fixed;
        bottom: 20px;
        left: 5%;
        width: 90%;
        background: #ef4444; /* Rouge action */
        color: white;
        padding: 18px;
        border-radius: 50px;
        text-align: center;
        font-weight: 900;
        font-size: 1.2rem;
        text-decoration: none;
        box-shadow: 0 10px 25px rgba(239, 68, 68, 0.4);
        z-index: 9999;
        border: none;
    }

    /* 3. On affiche le formulaire uniquement quand une classe 'show' est ajoutée */
    .form-overlay-mobile {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: white;
        z-index: 10000;
        overflow-y: auto;
        padding: 40px 20px;
        display: none; /* Caché par défaut */
    }
    
    .form-overlay-mobile.active {
        display: block;
    }
}

/* On cache le bouton sur PC */
.sticky-petition-btn { display: none; }

/* Ajout dans petition.css sous .form-overlay-mobile */
.form-overlay-mobile {
    padding: 60px 20px !important; /* Ajoute de l'espace pour ne pas coller à la croix */
    box-sizing: border-box;
}

.form-overlay-mobile input, 
.form-overlay-mobile select {
    font-size: 16px !important; /* Évite le zoom automatique sur iPhone au clic sur un champ */
}


/* --- GESTION DE L'OVERLAY MOBILE --- */

.form-overlay-mobile {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98); /* Fond blanc quasi opaque */
    z-index: 9999;
    display: none; /* CACHÉ PAR DÉFAUT */
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
    backdrop-filter: blur(10px);
}

/* Affiche l'overlay quand la classe .active est ajoutée par le script */
.form-overlay-mobile.active {
    display: flex;
}

/* --- BOUTON STICKY MOBILE --- */

.sticky-petition-btn {
    position: fixed;
    bottom: 20px;
    left: 5%;
    width: 90%;
    background: #ef4444;
    color: white;
    border: none;
    padding: 18px;
    border-radius: 15px;
    font-weight: 900;
    font-size: 1.1rem;
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.4);
    cursor: pointer;
    z-index: 999;
    display: none; /* Caché sur ordinateur */
}

/* --- RESPONSIVE : Affichage uniquement sur mobile --- */

@media (max-width: 1024px) {
    /* Cache la colonne de droite (Aside) sur mobile */
    aside {
        display: none;
    }

    /* Affiche le bouton rouge en bas de l'écran sur mobile */
    .sticky-petition-btn {
        display: block;
    }

    /* Ajuste la grille pour qu'elle ne fasse qu'une seule colonne */
    main style {
        grid-template-columns: 1fr !important;
    }
}