/*** Variables  CSS ****/

:root {
    --bg-color: #121214;
    --card-bg: #1a1a1e;
    --primary-color: #ffcc00;
    --primary-hover: #e6b800;
    --text-color: #fffffe;
    --text-muted: #a0a0a5;
    --border-color: #2a2a30;
    --success-color: #00e676;
}

/**** Reset ****/

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

h1,
h2,
h3 {
    font-family: "Montserrat", sans-serif;
}

select,
button,
input {
    font-family: "Inter", sans-serif;
    border: none;
    outline: none;
}

a {
    text-decoration: none;
}

button {
    cursor: pointer;
    font-weight: 600;
    border-radius: 6px;
    font-size: 1rem;
}

ul {
    list-style-type: none;
}

/**** body ****/

body {
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-color);
    color: var(--text-color);
    padding: 1rem;
    font-family: "Inter", sans-serif;
    line-height: 1.5;
}


/**** body, main, footer__links ****/

body,
.main__content,
.appointment__item,
.footer__links {
    display: flex;
    flex-direction: column;
}

/**** header ****/

header {
    margin-bottom: 1.5rem;
}

header h1 {
    font-size: 1.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0;
}

header h1 span {
    color: var(--primary-color);
}

header p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: 0.4rem;
}

/**** header, footer ****/

header,
footer {
    width: 100%;
    text-align: center;
}

/**** main ****/

.main__content {
    flex-grow: 1;
    gap: 1.5rem;
    margin-block: 1.2rem;
}

/**** sections ****/

.step__section {
    transition: all 0.3s ease-in-out;
}

.step__section:nth-of-type(1):hover h2 i.fa-calendar-days {
    transform: scale(1.25) rotate(-5deg);
}

.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
    transition: box-shadow 0.3s ease-in-out;
}

.card:hover {
    box-shadow: 0 4px 15px rgba(255, 204, 0, 0.4);
}

h2 {
    font-size: 1.2rem;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.4rem;
    display: inline-block;
}

h2 i {
    color: var(--primary-color);
    font-size: 1.15rem;
}

h2 i,
button[type="submit"] i {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.step__section:nth-of-type(2):hover h2 i.fa-user {
    transform: translateY(-3px);
}

/**** formulaire ****/

.form__group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

input[type="date"],
input[type="text"],
input[type="email"],
input[type="tel"],
select {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
    font-size: 1.1rem;
    appearance: none;
    transition: border-color 0.3s ease-in-out;
}

input:focus,
select:focus {
    border-color: var(--primary-color);
}

/**** Grille des boutons d'horaires (adaptés pour le tactile) ****/

.slots__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.slot__btn {
    opacity: 0;
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.75rem 0.5rem;
    transition: all 0.3s ease-in-out;
    animation: fadeInSlot 0.3s ease forwards;
    /* Le décalage (delay) est injecté dynamiquement par le JavaScript */
    animation-delay: calc(var(--delay) * 0.04s);
}

/**** Animation fadeInSlot ****/

@keyframes fadeInSlot {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.slot__btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.slot__btn.selected,
.slot__btn.selected:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #000000;
}

.slot__btn:disabled {
    background-color: #222226;
    color: #444444;
    border-color: #222226;
    cursor: not-allowed;
    text-decoration: line-through;
}

button[type="submit"] {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-color);
    color: #000000;
    margin-top: 0.5rem;
    transition: all 0.3s ease-in-out;
}

button[type="submit"]:disabled {
    background-color: #2a2a30;
    color: #666666;
    cursor: not-allowed;
}

button[type="submit"] i {
    font-size: 1.05rem;
}

button[type="submit"]:hover:not(:disabled) i.fa-circle-check {
    transform: scale(1.3);
}

.info__text {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.95rem;
    grid-column: 1 / -1;
    text-align: center;
    padding: 0.75rem 0;
}

/**** section appointments__section ****/

.appointments__section:hover h2 i.fa-dumbbell {
    transform: rotate(360deg);
}

.appointment__item {
    background-color: var(--bg-color);
    border-left: 4px solid var(--success-color);
    padding: 1rem;
    border-radius: 0 8px 8px 0;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.appointment__info h3 {
    color: var(--primary-color);
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.appointment__info p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-block: 0.6rem;
}

.appointment__info p i {
    width: 16px;
}

.cancel__btn {
    background-color: #ff5252;
    color: var(--text-color);
    padding: 0.6rem;
}

/**** footer ****/

footer {
    margin-top: auto;
    padding: 2rem 0 1rem 0;
}

footer p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.footer__links {
    gap: 0.5rem;
}

.footer__links a {
    color: var(--primary-color);
    font-size: 1rem;
    transition: color 0.3s ease-in-out;
}

.footer__links a:hover {
    color: var(--primary-hover);
}

/**** Responsive design écran supérieur ou égal à 992px ****/

@media screen and (min-width: 992px) {
    body {
        padding: 2rem 4rem;
        align-items: center;
    }

    header {
        margin-bottom: 2.5rem;
        max-width: 800px;
    }

    header h1 {
        font-size: 2.5rem;
    }

    .main__content {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
        margin-bottom: 2rem;
    }

    .main__content,
    footer {
        max-width: 1240px;
    }

    .step__section {
        width: 450px;
    }

    .appointments__section {
        grid-column: 1 / -1;
    }

    .card {
        padding: 2rem;
    }

    .appointment__item,
    footer {
        justify-content: space-between;
        align-items: center;
    }

    .cancel__btn {
        padding: 0.5rem 1rem;
    }

    .appointment__item,
    .footer__links {
        flex-direction: row;
    }

    footer {
        display: flex;
        padding-top: 3rem;
    }

    footer p {
        margin-bottom: 0;
    }

    .footer__links {
        gap: 1.5rem;
    }
}

/**** Responsive design pour les très grands écrans (1200px et plus) */

@media screen and (min-width: 1200px) {
    body {
        padding-block: 3rem;
    }
}