/* Style de base pour le body */
body {
    margin: 0;
    padding: 20px;
    font-family: Arial, sans-serif;
    background: url('./images/bg.jpg') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
    overflow-y: auto;
    box-sizing: border-box;
}

/* Police pour le texte général */
body, input, select, textarea, button {
    font-family: "Corporate S", sans-serif;
}

/* Formulaire principal */
form#carForm {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 500px; /* Limiter la largeur du formulaire */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: auto;
}

/* En-tête du formulaire */
.form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    width: 100%;
}

.form-header img {
    height: 40px; /* Réduire la taille des images */
    width: auto;
}

.form-header h1 {
    font-size: 1.4rem;
    text-align: center;
    margin: 0;
    font-weight: 700;
    color: #000000;
    flex-grow: 1;
}

/* Champs de saisie */
input, select, textarea {
    padding: 12px 15px;
    font-size: 1rem;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    transition: border-color 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

#selectFake {
    padding: 12px 15px;
    font-size: 1rem;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    transition: border-color 0.3s ease;
    width: 100%;
    max-width: 600px;
    cursor: pointer;
    user-select: none;
    box-sizing: border-box;
}

#selectFake:focus {
    outline: 3px solid #66b3ff;
    outline-offset: 2px;
}

input:focus, select:focus, textarea:focus {
    border-color: #66b3ff;
    outline: none;
}

/* Bouton d'envoi */
button[type="submit"] {
    background-color: #66b3ff;
    border: none;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: block;
    margin: 20px auto;
}

button[type="submit"]:hover {
    background-color: #4a90e2;
}

/* Popup voiture */
#carPopup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 10px;
    z-index: 1000;
    max-width: 640px;
    width: 90%;
    box-sizing: border-box;
}

#carPopup h2 {
    text-align: center;
    margin-bottom: 20px;
}

#carPopup > div {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
    width: 100%;
    margin: 0 auto;
}

#carPopup > div > div {
    width: 45%;
    box-sizing: border-box;
    text-align: center;
}

#carPopup img {
    width: 100%;
    cursor: pointer;
    border-radius: 6px;
    transition: transform 0.2s ease;
}

#carPopup img:hover, #carPopup img:focus {
    transform: scale(1.05);
    outline: 2px solid #66b3ff;
}

#carPopup span {
    display: block;
    margin-top: 8px;
    font-weight: 600;
    color: #333;
}

#carPopup button {
    margin-top: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    padding: 8px 20px;
    border: none;
    background: #f44336;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
}

/* Loading Overlay */
#loadingOverlay {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.8);
    justify-content: center;
    align-items: center;
}

#loadingOverlay img {
    width: 120px;
    height: 120px;
    animation: spin 1.5s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 600px) {
    /* Réduire la taille des images dans l'en-tête */
    .form-header img {
        height: 20px;
    }

    /* Réduire la taille du titre */
    .form-header h1 {
        font-size: 1.2rem;
    }

    /* Ajuster le formulaire */
    form#carForm {
        padding: 15px;
    }

    /* Adapter les images et texte du popup */
    #carPopup img {
        width: 80%;
        height: auto;
    }

    #carPopup > div > div {
        width: 100%;
    }

    button[type="submit"] {
        width: 100%;
    }
}

@media (max-width: 380px) {
    /* Réduire les images à 25px */
    .form-header img {
        height: 20px;
    }

    /* Ajuster la taille du titre */
    .form-header h1 {
        font-size: 1rem;
    }

    /* Réduire encore les tailles du formulaire et du popup */
    form#carForm {
        padding: 10px;
    }

    #carPopup {
        padding: 15px;
    }

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

    /* Ajuster la taille des champs */
    input, select, textarea, #selectFake {
        font-size: 0.85rem;
        padding: 8px 10px;
    }
}
