/* Reset et styles de base */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f5f5f7;
    margin: 0;
    padding: 20px;
    color: #333;
    line-height: 1.5;
    min-height: 100vh;
    padding-top: 100px;
}

/* Container du formulaire */
form {
    background: rgba(255, 255, 255, 0.7);
    width: 100%;
    max-width: 800px;
    margin: 40px auto;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    position: relative;
    z-index: 10;
}

/* En-tête du formulaire */
h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #1a1a1a;
}

.form-description {
    color: #666;
    margin-bottom: 32px;
}

/* Sections du formulaire */
.form-section {
    background: rgba(255, 255, 255, 0.85);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    backdrop-filter: blur(5px);
    position: relative;
    z-index: 10;
}

.form-section h2 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Grille pour les inputs */
.input-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    width: 100%;
    margin-bottom: 16px;
}

/* Groupe d'inputs */
.input-group {
    width: 100%;
    margin-bottom: 16px;
}

/* Styles communs pour tous les inputs */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.5;
    transition: all 0.2s ease;
    background: #ffffff;
    color: #333;
    box-sizing: border-box;
    height: 48px;
    margin-bottom: 16px;
    font-family: inherit;
}

/* Style spécifique pour les textarea */
textarea {
    height: 120px;
    resize: vertical;
    min-height: 48px;
    padding: 12px 16px;
}

/* Focus states uniformes */
input:focus,
select:focus,
textarea:focus {
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
    outline: none;
}

/* Style des labels */
label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

/* Style pour les groupes d'inputs */
.form-group {
    margin-bottom: 24px;
}

/* Style pour les radio buttons et checkboxes */
.radio-group {
    display: flex;
    gap: 20px;
    margin: 10px 0;
    justify-content: center;
    width: 100%;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

input[type="radio"],
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

/* Style pour les inputs désactivés */
input:disabled,
select:disabled,
textarea:disabled {
    background-color: #f5f5f7;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Style pour les messages d'erreur */
.error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 4px;
}

/* Style pour les inputs en erreur */
input.error,
select.error,
textarea.error {
    border-color: #dc3545;
}

input.error:focus,
select.error:focus,
textarea.error:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* Style pour les inputs readonly */
input[readonly],
textarea[readonly] {
    background-color: #f8f9fa;
    cursor: default;
}

/* Style spécifique pour Type de Demande et Âge du Bâtiment */
#requestTypeSection .radio-group,
#houseAgeSection .radio-group {
    justify-content: flex-start;
}

#houseAgeSection .radio-label span {
    min-width: 100px;
}

/* Style pour les questions principales */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group > label {
    display: block;
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 0.5rem;
}

/* Sections conditionnelles */
#actionSection,
#houseAgeSection,
#dimensionSection,
#raisonSocialeSection {
    width: 100%;
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    box-sizing: border-box;
}

/* Bouton d'envoi */
.form-actions {
    margin-top: 32px;
    text-align: right;
}

button {
    background-color: #007AFF;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

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

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 16px;
    }
    
    form {
        padding: 24px;
        margin: 20px 0;
    }
    
    .input-grid {
        grid-template-columns: 1fr;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    select,
    textarea {
        font-size: 16px;
    }
}

@media (max-width: 600px) {
    #raisonSocialeSection,
    .coordonnees-group {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }
    
    #raisonSocialeSection input,
    .coordonnees-group input,
    .coordonnees-group select,
    .coordonnees-group textarea {
        width: 100%;
        max-width: 100%;
        margin-bottom: 15px;
    }
    
    .coordonnees-group {
        margin-bottom: 15px; /* Espacement entre les groupes */
    }
    
    .coordonnees-group input,
    .coordonnees-group select {
        margin-bottom: 10px; /* Espacement entre les champs */
    }
    
    .coordonnees-group textarea {
        width: 100%;
    }
}

@media (max-width: 768px) {
    form {
        width: 90%;
        padding: 20px;
    }
}

#unitDetails p {
    background-color: #f8f9fa;
    padding: 10px;
    border-left: 4px solid #0056b3;
    margin-bottom: 10px;
    border-radius: 4px;
}

/* Container for the input fields and buttons */
#dimensionSection {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 20px;
}

#additionalWidths {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#additionalWidths label {
    width: 100%;
    display: block;
    margin-bottom: 10px;
}

#buttonsContainer {
    margin-top: 10px;
    display: flex;
    justify-content: center;
}

#buttonsContainer button {
    margin: 0 5px;
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

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

/* Centering the submit button */
#submitButtonContainer {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

#submitButtonContainer button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#submitButtonContainer button:hover {
    background-color: #218838;
}

/* Styles pour la section des dimensions */
.width-input-group {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
    align-items: flex-end;
}

.width-input-group label {
    flex: 1;
    margin: 0;
}

.width-input-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    margin-top: 5px;
}

.width-input-group input:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.width-input-group input[type="number"] {
    width: 120px;
}

.button-group {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.calculate-section {
    margin-top: 24px;
    text-align: center;
}

/* Styles pour les résultats */
.unit-detail {
    background: #f8f9fa;
    padding: 16px;
    margin-bottom: 16px;
    border-radius: 8px;
    border-left: 4px solid #007AFF;
}

.totals {
    margin-top: 24px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.totals p {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
    font-weight: 500;
}

.barnier-message {
    margin-top: 16px;
    padding: 16px;
    background: #e8f4ff;
    border-radius: 8px;
    border-left: 4px solid #007AFF;
}

/* Boutons secondaires */
.secondary-button {
    background-color: #e9ecef;
    color: #495057;
    border: 1px solid #ced4da;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.secondary-button:hover {
    background-color: #dee2e6;
}

/* Bouton principal */
.primary-button {
    background-color: #007AFF;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

/* Texte d'information sur la hauteur fixe */
.info-text {
    color: #666;
    font-style: italic;
    margin: 10px 0;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 4px;
}

/* Champ du nom du lieu à protéger */
.location-input {
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.location-input label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.location-input input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
}

.location-input input:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* Styles pour la zone de message */
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #fff;
    transition: border-color 0.2s ease-in-out;
}

textarea:focus {
    outline: none;
    border-color: #0056b3;
    box-shadow: 0 0 0 2px rgba(0, 86, 179, 0.1);
}

textarea::placeholder {
    color: #999;
}

/* Style pour les boutons d'ajout/suppression de dimensions */
.dimension-buttons {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    justify-content: center;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.btn-danger:hover {
    background-color: #c82333;
}

/* Style pour les sections spécifiques */
#clientTypeSection .radio-group,
#actionSection .radio-group,
#houseAgeSection .radio-group {
    justify-content: center;
    width: 100%;
}

/* Header Styles */
.site-header {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    box-sizing: border-box;
    position: relative;
}

.navbar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Logo styles */
.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    margin: 0 auto 20px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px); /* Support pour Safari */
}

.logo-container img {
    max-width: 800px;
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
}

@media (max-width: 768px) {
    .logo-container {
        padding: 10px;
    }
    
    .logo-container img {
        max-width: 100%;
        max-height: 150px;
    }
}

.nav-links {
    display: flex;
    flex-direction: column;
    padding: 10px 15px;
    gap: 10px;
    margin-left: 40px;
    width: fit-content;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
}

.nav-links a {
    color: #2B5B84;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    white-space: nowrap;
    text-align: center;
}

.nav-links a:hover {
    color: #1a3f5c;
}

@media (max-width: 768px) {
    .nav-links {
        padding: 10px 20px;
    }
}

footer {
    position: relative;
    z-index: 1;
    margin-bottom: 20px;
}

.bgc-3409 {
    background-color: rgba(43, 91, 132, 0.9);
    padding: 15px 25px;
    border-radius: 16px;
    width: 800px;
    margin: 0 auto;
}

footer p {
    margin: 0;
    color: rgba(43, 91, 132, 0.7);
}

footer a {
    color: rgba(43, 91, 132, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: rgba(26, 63, 96, 0.7);
}

#footer .container {
    display: flex;
    justify-content: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 15px;
}

#footer .row {
    width: 100%;
    max-width: 900px;
    display: flex;
    justify-content: space-between;
}

#footer .col-md-3 {
    flex: 0 0 calc(33.333% - 40px);
    display: flex;
    flex-direction: column;
}

#footer h4 {
    color: #ffffff;
    font-weight: 600;
    margin-bottom: 25px;
    font-size: 1.3rem;
    line-height: 1;
}

#footer p {
    color: #ffffff;
    margin: 0;
    line-height: 1.3;
    font-size: 1rem;
    margin-bottom: 5px;
}

.footer-link {
    color: #ffffff;
    text-decoration: none;
    transition: opacity 0.3s ease;
    margin-bottom: 8px;
    display: block;
    font-size: 1rem;
    line-height: 1.2;
}

.footer-link:hover {
    color: #ffffff;
    opacity: 0.8;
    text-decoration: none;
}

#footer strong {
    display: block;
    margin-top: 15px;
    margin-bottom: 5px;
}

#footer .col-md-3:last-child {
    text-align: right;
    padding-right: 20px;
}

#footer .col-md-3:last-child p {
    text-align: right;
}

@media (max-width: 768px) {
    #footer .col-md-3:last-child,
    #footer .col-md-3:last-child p {
        text-align: center;
        padding-right: 0;
    }
}

.content-wrapper {
    position: relative;
    z-index: 2;
    padding-top: 150px !important;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 1200px) {
    .site-header {
        width: 100%;
    }
    
    .bgc-3409 {
        width: 90%;
        margin: 10px auto;
    }
}

@media (max-width: 1200px) {
    .site-header {
        width: 100%;
    }
    
    .nav-links {
        margin-right: 20px;
    }
}

@media (max-width: 768px) {
    .content-wrapper {
        padding-top: 120px !important;
    }
}

.popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.popup.show {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.popup-content {
    margin-bottom: 20px;
}

.popup-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.popup-button:hover {
    background-color: #45a049;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.overlay.show {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Styles de base */
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: url('img/inondation-gottardi.jpg') no-repeat center center;
    background-size: cover;
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
}

.content-wrapper {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#contactForm {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.85);
    padding: 40px;
    border-radius: 16px;
    backdrop-filter: blur(5px);
}

/* Styles du footer */
footer {
    padding: 40px 0;
    margin-top: auto;
    width: 100%;
}

footer .container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

footer h4 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 18px;
}

footer p {
    margin: 5px 0;
    color: #fff;
}

.footer-link {
    display: block;
    color: #fff;
    text-decoration: none;
    margin-bottom: 10px;
    transition: opacity 0.3s ease;
}

.footer-link:hover {
    opacity: 0.8;
}

/* Media Queries */
@media (max-width: 768px) {
    footer .container {
        width: 100%;
        max-width: 800px;
        padding: 0;
    }

    footer .row {
        flex-direction: column;
        align-items: center;
        max-width: 800px;
        margin: 0 auto;
        padding: 0 20px;
    }

    footer .col-md-3 {
        width: 100%;
        margin-bottom: 30px;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    footer {
        padding: 20px 0;
    }

    footer h4 {
        text-align: center;
    }

    footer p {
        text-align: center;
        margin: 3px 0;
    }

    .footer-link {
        text-align: center;
        margin: 5px 0;
    }

    footer .col-md-3 p, 
    footer .col-md-3 a {
        width: 100%;
        display: block;
        text-align: center;
    }
}

@media (max-width: 1024px) {
    body {
        background-attachment: scroll;
        background-size: cover;
        min-height: 100%;
        height: auto;
    }
    
    body::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: url('img/inondation-gottardi.jpg') no-repeat center center;
        background-size: cover;
        z-index: -1;
    }

    .content-wrapper {
        padding: 10px;
    }

    #contactForm {
        padding: 20px;
        margin: 10px auto;
    }
}