#ImgHead {

    margin-bottom: -36em;

    div {
        height: 480px;
        background: #4540E1;
    }

    h1 {
        width: 100% !important;
        font-size: 60px
    }

    p {
        font-size: 20px;

    }

    img {
        border-radius: 2em;
        max-height: 75%;
        max-width: 75%;
        margin: auto;
    }
}

.gridHeader {
    position: relative;
    top: -480px;
    background: transparent !important;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: 1fr;
    grid-column-gap: 20px;
}

.header-background {
    background-image: url('../img/offre-formation.png') !important;
    background-position: right !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
}


.gridHeader > div:nth-child(1) {
    background: transparent !important;
    width: 75%;
    margin: auto;
}

p.text-white {
    margin-top: 1em;
}

h1.text-white {
    margin-top: 1em;
}


h3, h4 {
    color: #0B034F;
}

p, ul {
    color: #585880 !important;
}

#categoriesFormation {
    margin-top: 15em;
}


#newsLetter {
    width: 75%;
    background: #4540E1;
    border-radius: 1em;
    margin: 3em auto auto auto;
    padding: 5em;
    text-align: center;

    h2 {
        padding-top: 0;
        margin-bottom: 1em !important;
    }

    p {
        font-size: 1.25em;
    }

    .small-text {
        font-size: 0.8em;
        font-style: italic;
    }

    .newsletter-options {
        width: 75%;
        margin: 1.5em auto;
        text-align: left;
    }

    .option-row {
        display: flex;
        align-items: flex-start;
        margin-bottom: 0.5em;
    }

    .option-row input[type="checkbox"] {
        margin-top: 0.25em;
        margin-right: 0.5em;
        min-width: 16px;
    }

    .newsletterFormulaire {
        width: 75%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        row-gap: 1em;
        margin: auto;
    }

    .form-row {
        display: flex;
        gap: 1em;
        width: 100%;
    }

    .form-group {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        flex: 1;
        text-align: left;
    }

    .form-group.full-width {
        width: 100%;
    }

    .newsletter-input {
        width: 100%;
        padding: 0.5em;
        border-radius: 0.25em;
        border: none;
    }

    .newsletter-btn {
        background: white !important;
        color: #4540E1 !important;
        border-radius: 0.25em;
        padding: 0.5em 2em;
        font-weight: bold;
        border: none;
        cursor: pointer;
        margin-left: auto;
        transition: all 0.3s ease;
    }
    
    .newsletter-btn:disabled {
        background: #cccccc !important;
        color: #888888 !important;
        cursor: not-allowed;
        opacity: 0.7;
    }
}

@media screen and (max-width: 991px) {
    #newsLetter {
        width: 90%;
        padding: 3em 2em;
        
        .newsletter-options {
            width: 90%;
        }
        
        .newsletterFormulaire {
            width: 90%;
        }
    }
}

@media screen and (max-width: 767px) {
    #newsLetter {
        padding: 2em;
        
        h2 {
            font-size: 1.5em;
        }
        
        p {
            font-size: 1em;
        }
        
        .newsletter-options {
            width: 100%;
        }
        
        .newsletterFormulaire {
            width: 100%;
        }
        
        .form-row {
            flex-direction: column;
            gap: 0.5em;
        }
        
        .newsletter-btn {
            margin: 0 auto;
            width: 100%;
            max-width: 200px;
        }
        
        .option-row {
            align-items: center;
        }
        
        .option-row input[type="checkbox"] {
            min-width: 20px;
            min-height: 20px;
            margin-right: 10px;
        }
    }
}

@media screen and (max-width: 575px) {
    #newsLetter {
        width: 95%;
        padding: 1.5em;
        
        .option-row {
            margin-bottom: 0.75em;
        }
        
        .option-row label {
            font-size: 0.9em;
        }
        
        .form-group label {
            font-size: 0.9em;
        }
        
        .newsletter-input {
            padding: 0.75em;
            font-size: 16px; /* Évite le zoom automatique sur iOS */
        }
        
        .newsletter-btn {
            padding: 0.75em 1em;
        }
    }
}

@media screen and (max-width: 399px) {
    #newsLetter {
        width: 100%;
        padding: 1em;
        border-radius: 0.5em;
        
        h2 {
            font-size: 1.25em;
        }
        
        .small-text {
            display: block;
            margin-top: 0.25em;
        }
        
        .option-row {
            display: grid;
            grid-template-columns: 24px 1fr;
            gap: 8px;
        }
        
        .option-row input[type="checkbox"] {
            margin-top: 3px;
        }
    }
}

.text-blue {
    color: #4540E1;
}

.btnFormation {
    background: #4540E1 !important;
    color: white !important;
    padding: 1em 2em !important;
    border-radius: 1em !important;
    font-weight: bold !important;
}

#RedirectToContact {
    background-color: #EEEEFD !important;
}

.grid2 {
    height: max-content;
    width: 75%;
    margin-left: auto;
    margin-right: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: 1fr;
    grid-column-gap: 20px;
    grid-row-gap: 20px;
}

.cardFormation {
    div > h2 {
        font-size: 30px !important;
    }

    width: 100%;
    margin-top: auto;
    margin-bottom: 0;
    padding: 5em;
    background: #FFFFFF 0% 0% no-repeat padding-box;
    box-shadow: 0px 0px 40px #0000000F;
    border-radius: 36px;
}

.cardFormation > div {
    padding-left: 100px;
    padding-top: 70px;
    padding-bottom: 70px;
    width: 75%
}

h2 {
    color: #0B034F;
}

.formulaire {
    input {
        width: 100%;
    }
}

@media screen and (max-width: 1199px) {
    .header-background {
        background-image: none !important;
    }
    
    .gridHeader {
        grid-template-columns: 1fr;
        padding-right: 1em;
        padding-left: 1em;
    }
    
    .gridHeader > div:nth-child(1) {
        width: 100%;
    }
    
    .cardFormation > div {
        width: 100%;
    }
}

@media screen and (min-device-width: 1200px) and (max-device-width: 1919px) {

    .grid2 {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(2, 1fr);
    }
}

@media screen and (min-device-width: 992px) and (max-device-width: 1199px) {

    .grid2 {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(2, 1fr);
    }

    .gridHeader {
        position: relative;
        top: -480px;
        background: transparent !important;
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
    }

    .gridHeader > div:nth-child(1) {
        width: 100%;
    }

    .cardFormation {
        div > h2 {
            font-size: 25px !important;
        }

    }

    .cardFormation > div {
        padding-left: 70px;
        padding-top: 50px;
        padding-bottom: 50px;
        width: 100%;
    }


}

@media screen and (min-device-width: 768px) and (max-device-width: 991px) {
    .grid2 {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(2, 1fr);
    }

    #ImgHead {

        & div {
            height: 360px;
        }

        h1 {
            font-size: 40px;
        }

        p {
            font-size: 17px;
        }

    }

    .gridHeader {
        top: -360px;
    }

    #categoriesFormation {
        margin-top: 19em;
    }

    .cardFormation {
        div > h2 {
            font-size: 25px !important;
        }

    }

    .cardFormation > div {
        padding-left: 70px;
        padding-top: 50px;
        padding-bottom: 50px;
        width: 100%;
    }

    .newsletterFormulaire {
        flex-wrap: wrap;
    }


    #RedirectToContact{
        h2{
            font-size: 2.5em !important;
        }
    }

}

@media screen and (min-device-width: 576px) and (max-device-width: 767px) {

    .grid2 {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(2, 1fr);
    }

    #ImgHead {

        & div {
            height: 430px;
        }

        h1 {
            font-size: 35px;
        }

        p {
            font-size: 15px;
        }

    }

    #categoriesFormation {
        margin-top: 15em;
    }


    .gridHeader {
        top: -430px;
    }

    .cardFormation {
        div > h2 {
            font-size: 25px !important;
        }

    }


    .cardFormation > div {
        padding-left: 70px;
        padding-top: 50px;
        padding-bottom: 50px;
        width: 100%;
    }


    #newsLetter{
        width: 90%;
        padding: 2em;
    }

    .newsletterFormulaire {
        flex-wrap: wrap;
    }


    #RedirectToContact > div {
        > div {
            width: 80% !important;
        }

        flex-direction: column;
    }

}


@media screen and (min-device-width: 400px) and (max-device-width: 575px) {
    .grid2 {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(2, 1fr);
    }


    #ImgHead {

        & div {
            height: 360px;
        }

        h1 {
            font-size: 35px;
        }

        p {
            font-size: 17px;
        }

    }


    .gridHeader {
        top: -360px;
        display: block;

    }

    div.d-flex:nth-child(2) {
        display: none !important;
    }


    #categoriesFormation {
        margin-top: 19em;
    }

    .cardFormation {
            padding: 1.5em !important;
    }


    #newsLetter{
        width: 90%;
        padding: 2em;
    }

    .newsletterFormulaire {
        flex-wrap: wrap;
    }

    #RedirectToContact > div {
        div {
            width: 80% !important;
        }

        h2 {
            font-size: 2em !important;
        }
        flex-direction: column;
    }


}

@media screen and (max-device-width: 399px) {
    .grid2 {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(2, 1fr);
    }


    #ImgHead {

        & div {
            height: 360px;
        }

        h1 {
            font-size: 35px;
        }

        p {
            font-size: 17px;
        }

    }

    .gridHeader {
        top: -360px;
        display: block;

    }

    div.d-flex:nth-child(2) {
        display: none !important;
    }


    .newsletterFormulaire {
        flex-wrap: wrap;
    }


}
