/**** Importation des polices DM Sans et Alan Sans ****/

@import url('https://fonts.googleapis.com/css2?family=Alan+Sans:wght@300..900&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap');

/**** Variables css ****/

:root {
    /* Bleu */
    --dark-blue: #094067;
    --light-blue: #3da9fc;

    /* Blanc */
    --white: #fffffe;

    /* Noir */
    --light-dark: #5f6c7b;

    /* Rouge */
    --red: #ef4565;

    /* Polices */
    --font-title: "Alan Sans", sans-serif;
    --font: "DM Sans", sans-serif;
}

/**** Reset ****/

*,
::before,
::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

h1,
h2,
h3 {
    font-family: var(--font-title);
    color: var(--dark-blue);
}

h1,
h2 {
    text-align: center;
    line-height: 1.7;
}

h1 {
    font-size: 36px;
}

h2 {
    font-size: 30px;
}

h3 {
    font-size: 22px;
}

p {
    color: var(--light-dark);
    line-height: 1.9;
}

p,
a {
    font-size: 18px;
}

ul {
    list-style-type: none;
}

a {
    text-decoration: none;
    font-weight: 500;
    color: var(--dark-blue);
}

section {
    width: 100%;
    padding-top: 60px;
    display: flex;
    flex-direction: column;
}

input,
button {
    outline: none;
}

/**** body ****/

body {
    width: 100%;
    max-width: 1440px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font);
    background-color: var(--white);
    padding: 20px 50px;
}

/**** header ****/

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header__logo {
    width: 90px;
    height: 90px;
}

.header__logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: drop-shadow(0 0 5px #d8eefe);
}

.header__list {
    display: flex;
}

.header__list__item {
    padding: 0 10px;
}

.header__list__item:last-child {
    padding: 0 0 0 10px;
}

.header__list__item>a::after {
    content: "";
    display: block;
    width: 0;
    height: 3px;
    margin-top: 3px;
    background-color: var(--light-blue);
    transition: width 0.3s ease-in-out;
}

.header__list__item:hover>a::after {
    width: 100%;
}

.header__burger__btn {
    display: none;
}

/**** main ****/

.main__content {
    flex-grow: 1;
}

/**** section about ****/

.about__title {
    margin-top: 0;
    margin-bottom: 15px;
}

.about__subtitle {
    margin-bottom: 30px;
}

/**** section services *****/

.services__text {
    padding-block: 30px
}

.btn {
    text-align: center;
    width: 280px;
    margin: 0 auto;
    padding: 15px;
    background-color: var(--light-blue);
    color: var(--white);
    border-radius: 8px;
    transition: box-shadow 0.3s ease-in-out;
}

.btn:hover {
    box-shadow: 0 1px 6px 0 rgba(32, 33, 36, 0.69);
}

.services__article {
    display: flex;
    gap: 15px;
    justify-content: space-between;
    padding-top: 40px;
}

.service__card {
    width: 33%;
    height: 340px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 2px solid var(--dark-blue);
    will-change: transform;
    transition: transform 0.3s ease-in-out;
}

.service__card:hover {
    transform: scale(1.03);
}

.service__div,
.service__div img {
    width: 100%;
    height: 280px;
    border-radius: 8px 8px 0 0;
}

.service__card h3 {
    padding-block: 16px;
    text-align: center;
}

/**** section estimate ****/

.estimate {
    padding-bottom: 60px;
}

.estimate__text {
    padding-block: 30px;
}

.estimate__simulator {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.estimate__simulator__left,
.estimate__simulator__right {
    background-color: #d8eefe;
    border-radius: 8px;
    padding: 24px 20px;
    transition: box-shadow 0.3s ease-in-out;
}

.estimate__simulator__left:hover,
.estimate__simulator__right:hover {
    box-shadow: 0 1px 6px 0 rgba(32, 33, 36, 0.24);
}

.form__section h3 {
    margin-bottom: 30px;
}

.form__group {
    margin-bottom: 22px;
    font-weight: 600;
    font-size: 16px;
}

.form__group label {
    display: block;
    margin-bottom: 7px;
    color: var(--dark-blue);
}

input[type="number"] {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--light-blue);
    border-radius: 8px;
    background-color: var(--white);
    -moz-appearance: textfield;
    transition: border-color 0.3s ease-in-out;
}

input::-webkit-inner-spin-button,
input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"]:hover,
input[type="number"]:focus {
    border-color: var(--dark-blue);
}

.frequency__options {
    display: flex;
    gap: 16px;
    margin-top: 7px;
    justify-content: stretch;
}

.frequency__option {
    flex: 1;
    min-width: 0;
}

.frequency__option input[type="radio"] {
    display: none;
}

.frequency__option label {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    border: 2px solid var(--light-blue);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    background-color: var(--white);
    color: var(--dark-blue);
    transition: all 0.3s ease-in-out;
    outline: none;
    user-select: none;
    position: relative;
}

.frequency-option label:active,
.frequency-option label:focus {
    border-color: var(--dark-blue);
}

.frequency__option input[type="radio"]:checked+label {
    background-color: var(--light-blue);
    color: var(--dark-blue);
    border-color: var(--light-blue);
    z-index: 1;
}

.frequency__option label:hover {
    border-color: var(--dark-blue);
    background-color: var(--dark-blue);
    color: var(--white);
}

.checkbox__group {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background-color: var(--white);
    border-radius: 8px;
    border: 2px solid var(--light-blue);
    transition: border 0.3s ease-in-out;
}

.checkbox__group:hover {
    border-color: var(--dark-blue);
}

.checkbox__group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--dark-blue);
}

.checkbox__group label {
    margin: 0;
    cursor: pointer;
    flex: 1;
}

.calculate__btn,
.reset__btn {
    width: 100%;
    padding: 15px;
    background-color: var(--dark-blue);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 18px;
}

.calculate__btn {
    will-change: transform;
    transition: transform 0.3s ease-in-out;
}

.calculate__btn:hover {
    transform: translateY(-2px);
}

.reset__btn {
    transition: background-color 0.3s ease-in-out;
}

.reset__btn:hover {
    background-color: var(--red);
}

.error {
    background-color: var(--red);
    color: var(--white);
    padding: 14px;
    border-radius: 8px;
    margin-top: 13px;
    font-size: 16px;
    display: none;
}

.waiting__illustration {
    background-color: #d8eefe;
    border-radius: 8px;
    color: var(--white);
    padding: 24px 20px;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: slideIn 0.4s ease-in-out;
    text-align: center;
}

.waiting__illustration__img {
    width: 120px;
    height: 120px;
}

.waiting__illustration p {
    text-align: center;
    font-weight: 600;
    margin-top: 15px;
}

/* Accessibilité : éléments cachés et focus visible */
.sr__only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.results {
    color: var(--dark-blue);
    min-height: 350px;
    display: none;
    animation: slideIn 0.3s ease-in-out;
}

/**** Animation slideIn ****/

@keyframes slideIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.results h3 {
    margin-bottom: 18px;
    text-align: center;
}

.price__breakdown {
    display: grid;
    gap: 16px;
}

.price__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--light-blue);
    font-size: 16px;
}

.price__item:last-child {
    border-bottom: none;
    font-weight: 700;
    font-size: 18px;
    padding-top: 18px;
    color: var(--red);
}

/**** footer ****/

footer,
footer ul {
    display: flex;
    flex-direction: column;
}

footer h2 {
    margin-bottom: 30px;
}

footer ul {
    justify-content: center;
    align-items: center;
}

footer ul li i {
    padding-right: 10px;
}

footer ul li {
    margin-bottom: 20px;
    color: var(--dark-blue);
}

footer ul li a {
    transition: color 0.3s ease-in-out;
}

footer ul li a:hover {
    color: var(--light-blue);
}

.footer__text {
    text-align: center;
    font-weight: 600;
}

/**** Responsive design version tablette ****/

@media screen and (max-width: 991px) {
    .services__article {
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
    }

    .service__card {
        width: 45%;
        height: 300px;
        margin-bottom: 30px;
    }

    .service__card:last-child {
        margin-bottom: 0;
    }

    .service__card:hover {
        transform: scale(1.02);
    }

    .service__div,
    .service__div img {
        height: 240px;
    }

    .estimate__simulator {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}

/**** Responsive design version mobile ****/

@media screen and (max-width: 767px) {
    body {
        padding: 20px 25px;
    }

    h1 {
        font-size: 30px;
    }

    h2 {
        font-size: 26px;
    }

    h3 {
        font-size: 20px;
    }

    header {
        position: relative;
        align-items: normal;
    }

    .header__navigation {
        position: absolute;
        width: 100%;
        min-height: 50vh;
        right: 0;
        transform: translateY(-100%);
        background-color: var(--white);
        transition: transform 0.3s cubic-bezier(0.73, 0.11, 0.67, 0.84);
        z-index: 5;
    }

    .header__navigation,
    .header__list {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .header__navigation.active {
        transform: translate(0);
        border-bottom: 2px solid var(--dark-blue);
    }

    .header__link {
        display: block;
        margin: 15px 0;
    }

    .header__burger__btn {
        position: absolute;
        top: 20px;
        right: 0;
        width: 40px;
        height: 40px;
        padding-block: 15px;
        border: none;
        cursor: pointer;
        display: flex;
        justify-content: center;
        align-items: center;
        background-color: transparent;
        z-index: 10;
    }

    .header__burger__btn__bar {
        position: absolute;
        display: block;
        width: 100%;
        height: 2px;
        background-color: var(--dark-blue);
        transition: transform 0.3s ease-in-out,
            opacity 0.1s ease-in-out;
    }

    .b1 {
        transform: translateY(-10px);
    }

    .b3 {
        transform: translateY(10px);
    }

    .header__burger__btn.active .b1 {
        transform: translateY(0) rotate(135deg);
    }

    .header__burger__btn.active .b2 {
        opacity: 0;
    }

    .header__burger__btn.active .b3 {
        transform: translateY(0) rotate(-135deg);
    }

    .services__article,
    .frequency__options {
        flex-direction: column;
    }

    .service__card,
    .btn,
    .frequency__option,
    .frequency__option label {
        width: 100%;
    }

    .estimate__simulator {
        grid-template-columns: 1fr;
    }

    .frequency__options {
        gap: 10px;
    }

    .frequency__option label {
        justify-content: center;
        align-items: center;
        font-size: 16px;
        padding: 0;
        white-space: nowrap;
    }
}