/*** STYLE ***/
.contact-cube {
    width: 50px;
    height: 50px;
    position: absolute;
    z-index: 0;
}

/*** CONTACT ***/
#contact {
    display: flex;
    width: 100%;
    flex-flow: row;
    gap: 5vw;
    padding: 0 7.5vw;
    margin: 15vh 0;
    margin-bottom: 25vh;
}

/*** INFOS ***/
#contact-infos {
    display: flex;
    flex-flow: column;
    width: calc(33% - 2.5vw);
}

#contact-infos>p {
    margin-top: 2.75vh;
}

/* Coordonnées */
#contact-infos>div {
    display: flex;
    flex-flow: row wrap;
    gap: 5vh 0;
}

#contact-infos>div>div {
    display: flex;
    flex-flow: column;
    width: 100%;
}

#contact-infos>div>div>h3 {
    font-size: 20px;
    font-weight: 700;
    line-height: 100%;
    margin-bottom: 1.5vh;
    display: flex;
    flex-flow: row;
    align-items: center;
}

#contact-infos>div>div>h3>svg {
    height: 24px;
    width: 24px;
    margin-right: 5px;
    fill: #e2001a;
}

#contact-infos>div>div>a {
    text-decoration: none;
    color: black;
    font-weight: 400;
    transition: all 0.3s ease-in-out;
    width: fit-content;
}

#contact-infos>div>div>a:hover {
    color: #e2001a;
}

#contact-infos>div>div>a:active {
    color: #af0404;
}

/*** FORMULAIRE ***/
#contact-form {
    display: flex;
    flex-flow: column;
    width: calc(66% - 2.5vw);
    background-color: #e3e3e3;
    padding: 5vh 5vw;
    position: relative;
}

#contact-form>h2>span {
    z-index: +1;
}

#contact-form>form {
    display: flex;
    flex-flow: row wrap;
    gap: 2.5vh 2.5vw;
}

#contact-form>form>div {
    position: relative;
    width: 100%;
}

/* Nom/ Prénom */
#contact-form>form>div:nth-of-type(2),
#contact-form>form>div:nth-of-type(3) {
    width: calc(50% - 1.25vw);
}

/* Code postal */
#contact-form>form>div:nth-of-type(5) {
    width: calc(25% - 1.25vw);
}

#contact-form>form>div:nth-of-type(5)>label>span:nth-of-type(2) {
    display: none;
}

/* Ville */
#contact-form>form>div:nth-of-type(6) {
    width: calc(75% - 1.25vw);
}

/* Mail */
#contact-form>form>div:nth-of-type(7) {
    width: calc(75% - 1.25vw);
}

/* Téléphone */
#contact-form>form>div:nth-of-type(8) {
    width: calc(25% - 1.25vw);
}

/* Style input */
#contact-form>form>div>input,
#contact-form>form>div>textarea {
    display: flex;
    flex-flow: column;
    background-color: transparent;
    border: none;
    border-bottom: #b7bdc1 solid 1px;
    height: 48px;
    width: 100%;
    color: black;
    font-size: 16px;
}

#contact-form>form>div>input::placeholder,
#contact-form>form>div>textarea::placeholder {
    opacity: 0;
}

#contact-form>form>div>label {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    transition: all 0.3s ease-in-out;
    color: #4a5257;
}

#contact-form>form>div:nth-of-type(9)>label {
    position: absolute;
    top: 7.5%;
    transform: translateY(-7.5%);
    transition: all 0.3s ease-in-out;
    color: #4a5257;
}

#contact-form>form>div>input:focus,
#contact-form>form>div>textarea:focus {
    outline: none;
    box-shadow: none;
    border-color: transparent;
    border-bottom: #4a5257 solid 1px;
    color: black;
}

#contact-form>form>div>input:focus+label,
#contact-form>form>div>input:not(:placeholder-shown)+label {
    transform: translateY(-30px);
    font-size: 13px;
    color: #4a5257;
}

#contact-form>form>div>textarea:focus+label,
#contact-form>form>div>textarea:not(:placeholder-shown)+label {
    transform: translateY(-15px);
    font-size: 13px;
    color: #4a5257;
}

#contact-form>form>div>textarea {
    height: 124px;
    padding-top: 14px;
}

/* Erreur */
input.empty-field,
textarea.empty-field {
    border-bottom: 1px solid #e2001a !important;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
        transform: rotate(-1deg);
    }

    50% {
        transform: translateX(5px);
        transform: rotate(1deg);
    }

    75% {
        transform: translateX(-5px);
        transform: rotate(-1deg);
    }

    100% {
        transform: translateX(0);
        transform: rotate(0deg);
    }
}

.error-message {
    position: absolute;
    color: #e2001a;
    font-size: 13px;
    width: 150%;
    max-width: 90vw;
}

/** Submit **/
#contact-form>form>div:last-of-type {
    display: flex;
    align-items: center;
    margin-top: 2.5vh;
    justify-content: space-between;
}

/* Bouton envoyer */
#contact-form>form>div>button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: transparent;
    border: #e2001a 2px solid;
    color: #e2001a;
    font-weight: 600;
    width: 100px;
    z-index: 3;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    padding: 5px;
    transition: all 0.2s ease-in-out;
}

#contact-form>form>div>button:after {
    content: '';
    position: absolute;
    top: 0;
    left: 100%;
    width: 100%;
    height: 100%;
    background-color: #e2001a;
    transition: left 1s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease-in-out;
    z-index: -1;
}

#contact-form>form>div>button>svg {
    width: 24px;
    fill: #e2001a;
    transform: rotate(-90deg);
    z-index: 3;
    transition: all 0.2s ease-in-out;
}

/* Hover */
#contact-form>form>div>button:hover:after {
    left: 0;
    transition: all 0.2s ease-in-out;
}

#contact-form>form>div>button:hover {
    background-color: #e2001a;
    color: white;
}

#contact-form>form>div>button:hover>svg {
    fill: white;
}

/* Active */
#contact-form>form>div>button:active:after {
    background-color: #af0404;
}

#contact-form>form>div>button:active {
    border: #af0404 solid 2px;
}

#contact-form>form>div>button:active>svg {
    background-color: #af0404;
}

#contact-form>form>div:last-of-type>p {
    font-style: italic;
}

#contact-form>form>div:last-of-type>p.success {
    color: #155724;
}

#contact-form>form>div:last-of-type>p.error {
    color: #b81b2b;
}

/* Cubes */
#contact-form>div:nth-of-type(1) {
    background-color: white;
    bottom: 50px;
    right: 0;
}

#contact-form>div:nth-of-type(2) {
    background-color: #e3e3e3;
    bottom: 50px;
    right: -50px;
}

#contact-form>div:nth-of-type(3) {
    background-color: white;
    top: 55px;
    left: 0px;
    width: 75px;
    height: 75px;
}

#contact-form>div:nth-of-type(4) {
    background-color: #e3e3e3;
    top: 55px;
    left: -75px;
    width: 75px;
    height: 75px;
}

#contact-form>div:nth-of-type(5) {
    background-color: #e2001a;
    bottom: 150px;
    right: -50px;
    z-index: -1;
}

/*** RESPONSIVE ***/

@media (max-width: 1600px) {
    #contact-form>div:nth-of-type(3) {
        top: 0;
        left: 0;
        width: 50px;
        height: 50px;
    }

    #contact-form>div:nth-of-type(4) {
        top: 0;
        left: -50px;
        width: 50px;
        height: 50px;
    }
}


@media (max-width: 1300px) {

    /*** STYLE ***/
    .contact-cube {
        width: 50px;
        height: 50px;
        position: absolute;
        z-index: 0;
    }

    /*** CONTACT ***/
    #contact {
        flex-flow: column;
        gap: 10vh;
        padding: 0 5vw;
        margin: 10vh 0 25vh;
    }

    /*** INFOS ***/
    #contact-infos {
        flex-flow: column;
        width: 100%;
    }

    #contact-infos>p {
        margin-top: 0;
    }

    /* Coordonnées */
    #contact-infos>div {
        gap: 5vh 2.5vw;
        flex-flow: row;
        margin-top: 2.5vh;
    }

    #contact-infos>div>div {
        width: 100%;
    }


    /*** FORMULAIRE ***/
    #contact-form {
        width: 100%;
        padding: 5vh 5vw;
    }

    /* Style input */
    #contact-form>form>div>input {
        padding-top: 5px;
    }

    #contact-form>form>div>textarea {
        padding-top: 10px;
    }

    #contact-form>form>div:nth-of-type(9)>label {
        top: 10%;
        transform: translateY(-10%);
    }

    #contact-form>form>div>textarea:focus+label,
    #contact-form>form>div>textarea:not(:placeholder-shown)+label {
        transform: translateY(-10px);
    }


    /* Cubes */
    #contact-form>div:nth-of-type(1) {
        bottom: 50px;
        right: 0;
    }

    #contact-form>div:nth-of-type(2) {
        bottom: 50px;
        right: -50px;
    }

    #contact-form>div:nth-of-type(3) {
        top: 0;
        left: 0;
        width: 50px;
        height: 50px;
    }

    #contact-form>div:nth-of-type(4) {
        top: 0;
        left: -50px;
        width: 50px;
        height: 50px;
    }

    #contact-form>div:nth-of-type(5) {
        bottom: 150px;
        right: -50px;
    }

    #contact-form>form>div>textarea:focus+label,
    #contact-form>form>div>textarea:not(:placeholder-shown)+label {
        transform: translateY(-22.5px);
        font-size: 13px;
        color: #4a5257;
    }

    #contact-form>form>div:last-of-type {
        justify-content: initial;
        gap: 50px;
    }
}

@media (max-width: 800px) {

    /*** INFOS ***/
    #contact-infos {
        flex-flow: column;
        width: 100%;
    }

    #contact-infos>p {
        margin-top: 0;
    }

    /* Coordonnées */
    #contact-infos>div {
        gap: 5vh 2.5vw;
        flex-flow: row wrap;
        margin-top: 0;
    }

    #contact-infos>div {
        gap: 5vh 2.5vw;
    }

    #contact-infos>div>div {
        width: calc(50% - 1.25vw);
    }

    /*** FORMULAIRE ***/

    /* Code postal */
    #contact-form>form>div:nth-of-type(5)>label>span:nth-of-type(1) {
        display: none;
    }

    #contact-form>form>div:nth-of-type(5)>label>span:nth-of-type(2) {
        display: block;
    }

    /* Mail */
    #contact-form>form>div:nth-of-type(7) {
        width: calc(66% - 1.25vw);
    }

    /* Téléphone */
    #contact-form>form>div:nth-of-type(8) {
        width: calc(33% - 1.25vw);
    }
}

@media (max-width:700px) {
    #contact-form>form>div:last-of-type {
        flex-flow: column;
        gap: 20px;
        align-items: flex-start;
        padding-right: 30px;
    }
}

@media (max-width:480px) {

    /*** INFOS ***/
    /* Coordonnées */
    #contact-infos>div>div {
        width: 100%;
    }

    /*** FORMULAIRE ***/
    #contact-form>form>div {
        width: 100% !important;
    }

    /* Code postal */
    #contact-form>form>div:nth-of-type(5)>label>span:nth-of-type(1) {
        display: block;
    }

    #contact-form>form>div:nth-of-type(5)>label>span:nth-of-type(2) {
        display: none;
    }


    /* Cubes */
    #contact-form>div:nth-of-type(1) {
        bottom: 50px;
        right: 0;
        width: 30px;
        height: 30px;
    }

    #contact-form>div:nth-of-type(2) {
        bottom: 50px;
        right: -30px;
        width: 30px;
        height: 30px;
    }

    #contact-form>div:nth-of-type(3) {
        top: -1;
        left: 0;
        width: 50px;
        height: 51px;
    }

    #contact-form>div:nth-of-type(4) {
        top: 0;
        left: -50px;
        width: 50px;
        height: 50px;
    }

    #contact-form>div:nth-of-type(5) {
        bottom: 150px;
        right: -30px;
        width: 30px;
        height: 30px;
    }
}