body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
    color: #333;
}

header {
    background-image: url('images/fonddevis.jpg');
    background-size: cover;
    color: #004690;
    padding: 1em 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

header h1 {
    text-align: center;
    font-size: 1.9em;
    padding: 0 30px; /* Ajout de padding pour le texte */
}

main {
    max-width: 1200px;
    margin: 2em auto;
    background-color: #fff;
    padding: 2em;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

fieldset {
    border: none;
    margin-bottom: 1.5em;
    padding: 1.5em;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    background-color: #f9f9f9;
}

legend {
    padding: 0 10px;
    font-weight: bold;
    font-size: 1.2em;
    color: #004080;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1em;
}

.grid-4 > div {
    display: flex;
    flex-direction: column;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 1em;
}

.column-a, .column-b, .column-c {
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.dimension-input, .acoustique-input {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

input[type="text"], input[type="email"], input[type="number"], select, textarea, input[type="file"] {
    padding: 0.5em;
    border: 1px solid #ccc;
    border-radius: 4px;
    transition: border-color 0.3s;
}

input[type="text"]:focus, input[type="email"]:focus, input[type="number"]:focus, select:focus, textarea:focus, input[type="file"]:focus {
    border-color: #023753;
    outline: none;
}

button {
    background-color: #023753;
    color: #fff;
    border: none;
    padding: 0.5em 1em;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #0056b3;
}

button.delete-chassis {
    background-color: #FF0000;
}

button.delete-chassis:hover {
    background-color: #cc0000;
}

button.add-chassis {
    background-color: #28a745;
}

button.add-chassis:hover {
    background-color: #218838;
}

button.info-btn {
    background-color: #023753;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    margin-left: 0.5em;
}

.button-row {
    display: flex;
    justify-content: space-between;
    margin-top: 1em; /* Ajout de marge supérieure pour espacement */
}

.popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    padding: 1em;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    max-width: 80%;
    max-height: 80%;
    overflow: auto;
}

.popup img {
    width: 100%;
    height: auto;
}

.close-popup {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    font-size: 1.2em;
    color: #333;
}

/* Media Queries for Responsiveness */
@media (max-width: 1200px) {
    header {
        height: 250px;
    }

    main {
        padding: 1.5em;
    }

    fieldset {
        padding: 1em;
    }
}

@media (max-width: 992px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

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

    main {
        padding: 1.5em;
    }

    fieldset {
        padding: 1em;
    }

    .button-row {
        order: 2;
        width: 100%;
    }

    .column-c {
        order: 1;
    }

    .button-row {
        flex-direction: column;
        margin-top: 1em;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        height: 200px; /* Augmente la hauteur du header en mobile */
        text-align: center;
    }

    header h1 {
        padding: 20px; /* Augmente le padding autour du titre */
        margin-top: auto; /* Positionne le titre plus bas */
    }

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

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

    main {
        padding: 1em;
    }

    fieldset {
        padding: 1em;
    }

    .button-row {
        order: 2;
        width: 100%;
    }

    .column-c {
        order: 1;
    }

    .button-row {
        flex-direction: column;
        margin-top: 1em;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5em;
    }

    button {
        width: 100%;
        margin-bottom: 10px;
    }

    .button-row {
        order: 2;
        width: 100%;
    }

    .column-c {
        order: 1;
    }

    .button-row {
        flex-direction: column;
        margin-top: 1em;
    }
}
