/*=======================================================================
  Styles spécifiques — Section contact / formulaire (offres.php)
=========================================================================

  1. Section contact
  2. Formulaire (#contact-form)
  3. Champs (inputs, textarea)
  4. Bouton de soumission
  5. Responsive
  6. Bouton dépliant "Demander une démonstration"
  7. Formulaire "Demander une démonstration"
  8. Modale de résultat (#form-modal)
  9. Validation des champs obligatoires

=========================================================================*/


/*========================
== 1. Section contact    ==
==========================*/
#contact-section {
    padding: 60px 20px;
    border-radius: 12px;
}

#contact-section h3 {
    font-weight: 600;
    color: #2f4f4f;
    letter-spacing: 0.5px;
}


/*========================
== 2. Formulaire         ==
==========================*/
#panel-contact {
    position: relative;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Bulle décorative derrière le formulaire (à l'origine sur #contact-form,
   qui était le conteneur visible ; c'est désormais #panel-contact).
   left ajusté par rapport à la valeur d'origine (190px) : la carte est
   désormais plus étroite (grille col-lg-6 offset-lg-3, champ Organisme
   ajouté), donc un décalage négatif est nécessaire pour que la bulle
   ressorte côté gauche plutôt que de déborder à droite. */
#panel-contact::before {
    content: '';
    background-image: url('/assets/img/blob_3.png');
    background-repeat: no-repeat;
    width: 460px;
    height: 440px;
    z-index: -1;
    position: absolute;
    left: -190px;
    bottom: -80px;
}


/*========================
== 3. Champs             ==
==========================*/
.form-label {
    font-weight: 500;
    color: var(--color-primary-light);
    margin-bottom: 6px;
}

.form-control {
    border-radius: 10px;
    border: 1px solid #ddd;
    padding: 12px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.form-control:focus {
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px var(--color-secondary-30);
    outline: none;
}

textarea.form-control {
    resize: none;
}


/*========================
== 4. Bouton soumission  ==
==========================*/
button[type="submit"] {
    display: block;
    width: 100%;
    background: var(--color-secondary);
    border: none;
    padding: 14px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
}

button[type="submit"]:hover {
    background: var(--color-secondary-light);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
    border: none;
}


/*========================
== 5. Responsive         ==
==========================*/
@media (max-width: 768px) {
    #panel-contact {
        padding: 20px;
    }
}


/*========================================================
== 6. Bouton dépliant "Demander une démonstration"
==========================================================*/
.toggle-demo-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 22px;
    background: white;
    border: 1px solid var(--color-light-grey);
    border-radius: 14px;
    color: var(--color-primary-light);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.toggle-demo-btn:hover {
    color: var(--color-primary);
    border-color: var(--color-secondary);
}

.toggle-demo-btn__icon {
    position: relative;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-left: 12px;
}

.toggle-demo-btn__icon::before,
.toggle-demo-btn__icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    background: currentColor;
    transform: translate(-50%, -50%);
    transition: transform 0.3s ease;
}

.toggle-demo-btn__icon::before {
    width: 100%;
    height: 2px;
}

.toggle-demo-btn__icon::after {
    width: 2px;
    height: 100%;
}

.toggle-demo-btn.active .toggle-demo-btn__icon::after {
    transform: translate(-50%, -50%) rotate(90deg) scaleY(0);
}

.toggle-demo-btn.active {
    background: var(--color-secondary);
    border-color: var(--color-secondary);
    color: white;
}

/*========================================================
== 7. Formulaire "Demander une démonstration"
==========================================================*/
/* Le panneau démo est désormais inséré directement dans la carte
   #panel-contact : pas de second encadré blanc, il hérite du fond
   et du padding de la carte principale. */

/* .demo-step__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--color-primary-light);
    margin-bottom: 12px;
} */

/* .demo-step__number {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--color-secondary-pale);
    color: var(--color-secondary);
    font-size: 0.85rem;
    font-weight: 700;
} */

/* .demo-step__number--alert {
    background: var(--color-tertiary-pale);
    color: var(--color-tertiary-dark);
} */

.demo-step__subtitle {
    color: var(--color-primary-light);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.demo-info-text {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--color-grey-mid);
    margin-bottom: 0;
}

.demo-info-text .icon-info {
    font-style: normal;
    line-height: 1;
}

/* Message : la commune recherchée est déjà présente dans l'Observatoire */
.demo-commune-status {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: var(--color-secondary-pale);
    border: 1px solid var(--color-secondary-light);
    color: #2f4f2f;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.85rem;
    margin: 10px 0 0;
}

.demo-commune-status::before {
    content: "\2713";
    flex: 0 0 auto;
    font-weight: 700;
    color: var(--color-secondary);
}

.demo-commune-status a {
    color: var(--color-secondary, #2f4f2f);
    font-weight: 600;
    text-decoration: underline;
    text-transform: none;
    font-size: 0.85rem;
}

/* Boîtes d'information (étape 4) */
.demo-box {
    border-radius: 10px;
    padding: 16px 18px;
    font-size: 0.9rem;
}

.demo-box p {
    font-size: 0.9rem;
}

.demo-box__title {
    font-weight: 5  00;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.demo-box--alert {
    background: #FBEAEA;
    border: 1px solid #E7A9A9;
    color: #7A2E2E;
}

.demo-box--alert p {
    color: #7A2E2E;
}

.demo-box--info {
    background: #F4F4F4;
    border: 1px solid var(--color-light-grey);
    color: var(--color-primary-light);
}

.demo-box--info p {
    color: var(--color-primary-light);
}

/* Cases à cocher */
.form-check {
    padding-left: 1.8em;
}

.form-check-input {
    border-radius: 4px;
    border: 1px solid var(--color-light-grey);
    width: 1.1em;
    height: 1.1em;
    margin-left: -1.8em;
}

.form-check-input:checked {
    background-color: var(--color-secondary);
    border-color: var(--color-secondary);
}

.form-check-label {
    color: var(--color-primary-light);
    font-size: 0.92rem;
    text-transform: none;
    font-weight: normal;
}

.form-check-label a {
    color: var(--color-secondary);
    font-size: 0.92rem;
    text-transform: none;
    text-decoration: underline;
}

/* Suggestions de communes */
.demo-commune-suggestions {
    position: absolute;
    z-index: 20;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--color-light-grey);
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    list-style: none;
    margin: 0;
    padding: 6px 0;
    max-height: 220px;
    overflow-y: auto;
}

.demo-commune-suggestions li {
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.92rem;
    color: var(--color-primary-light);
}

.demo-commune-suggestions li:hover {
    background: var(--color-secondary-pale);
    color: var(--color-primary);
}

/*========================================================
== 8. Modale de résultat (#form-modal)
==========================================================*/
/* Masquée par défaut, affichée via l'ajout de la classe .show en JS */
#form-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    padding: 20px;
}
 
#form-modal.show {
    display: flex;
}
 
/* Empêche le scroll de la page derrière la modale ouverte */
body.modal-open {
    overflow: hidden;
}
 
#form-modal .modal-content {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: white;
    border: none;
    border-radius: 15px;
    padding: 36px 30px 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    animation: form-modal-in 0.25s ease;
}
 
@keyframes form-modal-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
 
#form-modal-content {
    color: var(--color-primary-light);
    font-size: 1rem;
    margin: 0;
}
 
#form-modal .close {
    position: absolute;
    top: 10px;
    right: 16px;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--color-grey-mid);
    cursor: pointer;
    transition: color 0.2s ease;
}
 
#form-modal .close:hover {
    color: var(--color-primary);
}
 
@media (max-width: 576px) {
    #form-modal .modal-content {
        padding: 30px 20px 24px;
    }
}


/*========================================================
== 9. Validation des champs obligatoires
==========================================================*/
/* Couleur d'erreur (non définie dans la charte, rouge standard Bootstrap) */
:root {
    --color-error: #dc3545;
}

/* Champs texte / textarea / select invalides : bordure + léger halo rouge */
.form-control.is-invalid {
    border-color: var(--color-error);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.12);
}

/* Cases à cocher invalides : bordure rouge autour d'un conteneur dédié
   (.checkbox-field), plutôt que sur .form-check lui-même. .form-check
   positionne sa case via une marge négative (technique Bootstrap) ; lui
   appliquer directement bordure + padding romprait ce calcul et ferait
   chevaucher la case et la bordure. Le conteneur englobant, lui, n'a
   aucune contrainte de positionnement interne : un padding uniforme
   suffit à garder la case entièrement à l'intérieur. */
.checkbox-field.is-invalid {
    border: 1px solid var(--color-error);
    border-radius: 10px;
    padding: 12px 14px;
    background: rgba(220, 53, 69, 0.04);
}

/* Groupe "Votre besoin" (cases + zone de texte) : encadré rouge global */
#demo-need-group.is-invalid {
    border: 1px solid var(--color-error);
    border-radius: 12px;
    padding: 14px;
    background: rgba(220, 53, 69, 0.04);
}

/* Message d'erreur sous le champ concerné, masqué par défaut */
.field-error-message {
    display: none;
    color: var(--color-error);
    font-size: 0.85rem;
    margin: 6px 0 0;
}

.field-error-message.show {
    display: block;
}