/* ==========================================================================
   Gravity Forms – Formulaire « Demande de devis » (classe CSS : sa-devis)

   Complète le style de base (forms.css) avec ce qui est propre au devis.

   Structure : les champs HTML « sa-devis-section » ouvrent chacun une partie,
   enveloppée côté PHP dans <div class="sa-devis-part"> (inc/gravity-forms.php).
     - .sa-devis-part--card  : carte (parties 1 et 2, côte à côte)
     - .sa-devis-part--plain : partie pleine largeur (partie 3)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Carte du formulaire
   -------------------------------------------------------------------------- */
html body .gform_wrapper.sa-devis_wrapper form.sa-devis {
    box-sizing: border-box;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.06);
    padding: 20px 40px 28px;
}

/* --------------------------------------------------------------------------
   Grille : 2 cartes côte à côte puis partie pleine largeur
   -------------------------------------------------------------------------- */
html body .gform_wrapper.sa-devis_wrapper .gform_fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 24px;
}

html body .gform_wrapper.sa-devis_wrapper .sa-devis-part {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 12px 8px;
    align-content: start;
    min-width: 0;
}

/* Champs empilés dans chaque partie */
html body .gform_wrapper.sa-devis_wrapper .sa-devis-part > .gfield {
    grid-column: 1 / -1;
}

html body .gform_wrapper.sa-devis_wrapper .sa-devis-part--card {
    box-sizing: border-box;
    background: var(--sa-card-bg);
    border: 1px solid #E4E4DE;
    border-top: 4px solid var(--sa-yellow);
    border-radius: 10px;
    padding: 24px;
}

html body .gform_wrapper.sa-devis_wrapper .sa-devis-part--plain {
    grid-column: 1 / -1;
    border-top: 1px solid var(--sa-line);
    padding-top: 16px;
    row-gap: 6px;
}

/* Quantité + unité sur une ligne */
html body .gform_wrapper.sa-devis_wrapper .sa-devis-part > .gfield.sa-qte {
    grid-column: 1 / span 8;
}

html body .gform_wrapper.sa-devis_wrapper .sa-devis-part > .gfield.sa-unite {
    grid-column: span 4;
    align-self: end;
}

/* --------------------------------------------------------------------------
   Titres de partie (champs HTML)
   -------------------------------------------------------------------------- */
html body .gform_wrapper.sa-devis_wrapper .sa-devis-step {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 8px;
    padding: 0;
    border: 0;
    font-family: inherit;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: normal;
    text-transform: none;
    color: var(--sa-black);
}

html body .gform_wrapper.sa-devis_wrapper .sa-devis-step::before,
html body .gform_wrapper.sa-devis_wrapper .sa-devis-step::after {
    display: none;
}

html body .gform_wrapper.sa-devis_wrapper .sa-devis-step__num {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--sa-yellow);
    color: var(--sa-black);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 800;
}

html body .gform_wrapper.sa-devis_wrapper .sa-devis-part--plain .sa-devis-step {
    margin-bottom: 14px;
}

/* --------------------------------------------------------------------------
   Pièces jointes : règles GF masquées (redondantes avec la description),
   conservées pour les lecteurs d'écran
   -------------------------------------------------------------------------- */
html body .gform_wrapper.sa-devis_wrapper .sa-upload .gform_fileupload_rules {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Consentement : un peu d'air au-dessus */
html body .gform_wrapper.sa-devis_wrapper .sa-consent {
    margin-top: 18px;
}

html body .gform_wrapper.sa-devis_wrapper .gform_footer {
    margin-top: 20px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    html body .gform_wrapper.sa-devis_wrapper .gform_fields {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 600px) {
    html body .gform_wrapper.sa-devis_wrapper form.sa-devis {
        padding: 16px 16px 24px;
        border-radius: 10px;
    }

    html body .gform_wrapper.sa-devis_wrapper .sa-devis-part--card {
        padding: 18px 16px;
    }

    html body .gform_wrapper.sa-devis_wrapper .sa-devis-part > .gfield.sa-qte {
        grid-column: 1 / span 7;
    }

    html body .gform_wrapper.sa-devis_wrapper .sa-devis-part > .gfield.sa-unite {
        grid-column: span 5;
    }
}
