/* ==========================================================================
   CLIMATHERM — CONTACT FORM 7
   Version finale corrigée
   ========================================================================== */


/* ==========================================================================
   1. VARIABLES
   ========================================================================== */

.ct-contact-form {
    --ct-primary: #1a5270;
    --ct-secondary: #0c78ac;
    --ct-border: #dadada;
    --ct-white: #ffffff;
    --ct-text: #575757;
    --ct-placeholder: #878787;
    --ct-yellow: #fbb800;
    --ct-error: #b42318;
    --ct-success: #176b3a;
    --ct-radius: 10px;

    width: 100%;
    max-width: 820px;

    margin: 0 auto;
    padding: 0;

    color: var(--ct-text);

    font-family: "Roboto", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;

    text-align: left;
}


/* ==========================================================================
   2. RESET DIVI / WORDPRESS / CONTACT FORM 7
   ========================================================================== */

.climatherm-form-shell,
.climatherm-form-shell .et_pb_code_inner,
.climatherm-form-shell .wpcf7,
.climatherm-form-shell .wpcf7-form {
    width: 100% !important;
    max-width: none !important;

    margin: 0 !important;
    padding: 0 !important;

    text-align: left !important;
}

.ct-contact-form,
.ct-contact-form *,
.ct-contact-form *::before,
.ct-contact-form *::after {
    box-sizing: border-box;
}

.ct-contact-form p,
.ct-contact-form fieldset,
.ct-contact-form legend,
.ct-contact-form label {
    margin: 0 !important;
    padding: 0 !important;
}

.ct-contact-form fieldset {
    min-width: 0;
    border: 0;
}

.ct-contact-form br {
    display: none !important;
}

.ct-contact-form .wpcf7-form-control-wrap {
    display: block;

    width: 100%;
    min-width: 0;

    margin: 0 !important;
    padding: 0 !important;
}

/*
 * Protection complémentaire si CF7 injecte encore des paragraphes.
 */
.ct-form-grid > p {
    display: contents !important;
}

.ct-form-field > p,
.ct-form-consent > p,
.ct-form-footer > p {
    margin: 0 !important;
    padding: 0 !important;
}


/* ==========================================================================
   3. ESPACEMENTS GÉNÉRAUX
   ========================================================================== */

.ct-form-block {
    width: 100%;
}

.ct-form-block + .ct-form-block {
    margin-top: 30px;
}

/*
 * Espacement renforcé entre :
 * Email / Téléphone
 * et
 * Vous êtes
 */
.ct-contact-form > .ct-form-grid + .ct-profile-field {
    margin-top: 42px !important;
}


/* ==========================================================================
   4. GRILLES EN DEUX COLONNES
   ========================================================================== */

/*
 * Nom / Prénom
 * Email / Téléphone
 * Type de besoin / Type de bâtiment
 */
.ct-contact-form .ct-form-grid {
    display: grid !important;

    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: 32px;
    row-gap: 26px;

    align-items: start;

    width: 100%;
    min-width: 0;
}

.ct-form-field {
    display: flex;
    flex-direction: column;

    width: 100%;
    min-width: 0;

    gap: 9px;
}


/* ==========================================================================
   5. LABELS
   ========================================================================== */

.ct-form-field > label,
.ct-form-field > legend,
.ct-profile-field > legend {
    display: block;

    width: 100%;

    color: var(--ct-primary) !important;

    font-family: "Roboto", Arial, sans-serif !important;
    font-size: 17px !important;
    font-weight: 500 !important;
    line-height: 1.3 !important;

    text-align: left !important;
}

.ct-required {
    color: var(--ct-yellow);
}


/* ==========================================================================
   6. CHAMPS GÉNÉRAUX
   ========================================================================== */

body .ct-contact-form input[type="text"],
body .ct-contact-form input[type="email"],
body .ct-contact-form input[type="tel"],
body .ct-contact-form input[type="url"],
body .ct-contact-form select,
body .ct-contact-form textarea {
    display: block;

    width: 100% !important;
    max-width: none !important;

    margin: 0 !important;

    color: var(--ct-primary) !important;
    background-color: var(--ct-white) !important;
    background-image: none;

    border: 1px solid var(--ct-border) !important;
    border-radius: var(--ct-radius) !important;

    outline: 0;

    font-family: "Roboto", Arial, sans-serif !important;
    font-weight: 400 !important;

    text-align: left !important;
    text-indent: 0 !important;

    box-shadow: none !important;

    transition:
        border-color 160ms ease,
        box-shadow 160ms ease,
        background-color 160ms ease;
}


/* ==========================================================================
   7. INPUTS ET SELECTS
   ========================================================================== */

body .ct-contact-form input[type="text"],
body .ct-contact-form input[type="email"],
body .ct-contact-form input[type="tel"],
body .ct-contact-form input[type="url"],
body .ct-contact-form select {
    height: 62px !important;
    min-height: 62px !important;

    padding: 0 20px !important;

    font-size: 18px !important;
    line-height: normal !important;
}


/* ==========================================================================
   8. TEXTAREA
   ========================================================================== */

body .ct-contact-form textarea {
    display: block;

    width: 100% !important;

    height: 172px;
    min-height: 172px !important;
    max-height: 400px;

    padding: 17px 20px !important;

    font-size: 17px !important;
    line-height: 1.5 !important;

    text-align: left !important;
    text-align-last: left !important;
    vertical-align: top !important;

    white-space: normal;
    overflow-wrap: break-word;

    resize: vertical;
}

body .ct-contact-form textarea::placeholder {
    color: var(--ct-placeholder) !important;

    opacity: 1;

    text-align: left !important;
    text-align-last: left !important;

    white-space: normal;
}


/* ==========================================================================
   9. PLACEHOLDERS
   ========================================================================== */

body .ct-contact-form input::placeholder {
    color: var(--ct-placeholder) !important;
    opacity: 1;

    text-align: left !important;
}

body .ct-contact-form input:hover,
body .ct-contact-form select:hover,
body .ct-contact-form textarea:hover {
    border-color: #b8b8b8 !important;
}

body .ct-contact-form input:focus,
body .ct-contact-form select:focus,
body .ct-contact-form textarea:focus {
    border-color: var(--ct-secondary) !important;

    box-shadow:
        0 0 0 3px rgba(12, 120, 172, 0.14) !important;
}


/* ==========================================================================
   10. AUTOCOMPLÉTION CHROME / SAFARI
   ========================================================================== */

body .ct-contact-form input:-webkit-autofill,
body .ct-contact-form input:-webkit-autofill:hover,
body .ct-contact-form input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--ct-primary) !important;

    -webkit-box-shadow:
        0 0 0 1000px var(--ct-white) inset !important;

    transition:
        background-color 9999s ease-out 0s;
}


/* ==========================================================================
   11. MENUS DÉROULANTS
   ========================================================================== */

.ct-select-wrapper {
    position: relative;

    display: block;

    width: 100%;
    min-width: 0;
}

.ct-select-wrapper::after {
    content: "";

    position: absolute;
    top: 50%;
    right: 23px;

    width: 11px;
    height: 11px;

    border-right: 3px solid var(--ct-primary);
    border-bottom: 3px solid var(--ct-primary);

    pointer-events: none;

    transform:
        translateY(-68%)
        rotate(45deg);
}

body .ct-contact-form select {
    padding-right: 54px !important;

    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

body .ct-contact-form select::-ms-expand {
    display: none;
}


/* ==========================================================================
   12. PROFIL : PARTICULIER / PROFESSIONNEL
   ========================================================================== */

.ct-profile-field {
    display: block;

    width: 100%;
    min-width: 0;
}

.ct-profile-field > legend {
    margin-bottom: 10px !important;
}

/*
 * Particulier et Professionnel restent sur la même ligne.
 */
.ct-contact-form .ct-profile-field .wpcf7-radio {
    display: grid !important;

    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px;

    width: 100%;
    min-width: 0;
}

.ct-profile-field .wpcf7-list-item {
    display: block;

    width: 100%;
    min-width: 0;

    margin: 0 !important;
    padding: 0 !important;
}

.ct-profile-field .wpcf7-list-item > label {
    position: relative;

    display: flex;
    align-items: center;

    width: 100%;
    min-width: 0;
    min-height: 62px;

    margin: 0 !important;
    padding: 0 20px !important;

    color: var(--ct-primary);
    background-color: var(--ct-white);

    border: 1px solid var(--ct-border);
    border-radius: var(--ct-radius);

    cursor: pointer;

    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease;
}

.ct-profile-field .wpcf7-list-item > label:hover {
    border-color: var(--ct-secondary);
}

.ct-profile-field input[type="radio"] {
    position: absolute;

    width: 1px !important;
    height: 1px !important;

    margin: -1px !important;
    padding: 0 !important;

    overflow: hidden;

    opacity: 0;
    pointer-events: none;

    clip: rect(0 0 0 0);
    clip-path: inset(50%);
}

.ct-profile-field .wpcf7-list-item-label {
    display: flex;
    align-items: center;

    min-width: 0;

    gap: 12px;

    color: var(--ct-primary);

    font-family: "Roboto", Arial, sans-serif;
    font-size: 17px;
    font-weight: 500;
    line-height: 1.25;

    text-align: left;
}

.ct-profile-field .wpcf7-list-item-label::before {
    content: "";

    display: block;

    flex: 0 0 18px;

    width: 18px;
    height: 18px;

    background-color: var(--ct-white);

    border: 1.5px solid #878787;
    border-radius: 50%;

    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease;
}

.ct-profile-field input[type="radio"]:checked
+ .wpcf7-list-item-label::before {
    background-color: var(--ct-primary);
    border-color: var(--ct-primary);

    box-shadow:
        inset 0 0 0 4px var(--ct-white);
}

.ct-profile-field .wpcf7-list-item > label:has(
    input[type="radio"]:checked
) {
    background-color: #f5fafc;
    border-color: var(--ct-secondary);
}

.ct-profile-field .wpcf7-list-item > label:has(
    input[type="radio"]:focus-visible
) {
    outline: 3px solid rgba(12, 120, 172, 0.18);
    outline-offset: 2px;
}


/* ==========================================================================
   13. CONSENTEMENT RGPD
   ========================================================================== */

.ct-form-consent {
    width: 100%;

    margin-top: 32px !important;
}

.ct-form-consent .wpcf7-form-control-wrap,
.ct-form-consent .wpcf7-acceptance,
.ct-form-consent .wpcf7-list-item {
    display: block;

    width: 100%;

    margin: 0 !important;
    padding: 0 !important;
}

.ct-form-consent .wpcf7-list-item > label {
    display: grid;

    grid-template-columns: 20px minmax(0, 1fr);
    column-gap: 18px;
    align-items: start;

    width: 100%;

    margin: 0 !important;
    padding: 0 !important;

    cursor: pointer;
}

.ct-form-consent input[type="checkbox"] {
    display: block;

    width: 19px !important;
    min-width: 19px !important;

    height: 19px !important;
    min-height: 19px !important;

    margin: 3px 0 0 !important;
    padding: 0 !important;

    background-color: var(--ct-white);

    border: 1.5px solid #878787 !important;
    border-radius: 3px !important;

    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;

    box-shadow: none !important;
}

.ct-form-consent input[type="checkbox"]:checked {
    background-color: var(--ct-primary);

    border-color: var(--ct-primary) !important;

    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");

    background-position: center;
    background-repeat: no-repeat;
    background-size: 13px;
}

.ct-form-consent input[type="checkbox"]:focus-visible {
    outline: 3px solid rgba(12, 120, 172, 0.18);
    outline-offset: 3px;
}

.ct-form-consent .wpcf7-list-item-label {
    color: var(--ct-primary);

    font-family: "Roboto", Arial, sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.55;

    text-align: left;
}

.ct-form-consent a {
    color: var(--ct-secondary);

    font-weight: 500;
    text-decoration: none;
}

.ct-form-consent a:hover,
.ct-form-consent a:focus-visible {
    text-decoration: underline;
}


/* ==========================================================================
   14. HONEYPOT
   ========================================================================== */

.ct-honeypot {
    position: absolute !important;
    top: auto !important;
    left: -10000px !important;

    width: 1px !important;
    height: 1px !important;

    overflow: hidden !important;
}


/* ==========================================================================
   15. PIED DU FORMULAIRE
   ========================================================================== */

.ct-form-footer {
    width: 100%;

    margin-top: 40px !important;
    padding-top: 30px !important;

    border-top: 1px solid #e5e5e5;
}

.ct-form-reassurance {
    display: flex;
    align-items: center;

    gap: 12px;

    color: var(--ct-text);

    font-family: "Roboto", Arial, sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
}

.ct-form-reassurance-icon {
    display: grid;
    place-items: center;

    flex: 0 0 18px;

    width: 18px;
    height: 18px;

    color: var(--ct-secondary);

    border: 2px solid var(--ct-secondary);
    border-radius: 50%;
}

.ct-form-reassurance-icon::before {
    content: "i";

    display: block;

    font-family: Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}


/* ==========================================================================
   16. BOUTON
   ========================================================================== */

.ct-submit-wrapper {
    position: relative;

    display: inline-flex;
    align-items: center;

    width: min(370px, 100%);

    margin-top: 34px;
}

body .ct-contact-form .ct-submit-button {
    display: block;

    width: 100% !important;
    min-width: 0 !important;

    height: 68px !important;
    min-height: 68px !important;

    margin: 0 !important;
    padding: 0 68px 0 42px !important;

    color: var(--ct-primary) !important;
    background-color: var(--ct-yellow) !important;
    background-image: none !important;

    border: 0 !important;
    border-radius: 999px !important;

    font-family: "Roboto", Arial, sans-serif !important;
    font-size: 21px !important;
    font-weight: 500 !important;
    line-height: 1 !important;

    text-align: left !important;

    opacity: 1 !important;

    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;

    box-shadow:
        0 11px 20px rgba(251, 184, 0, 0.23) !important;

    transition:
        background-color 160ms ease,
        box-shadow 160ms ease,
        transform 160ms ease;
}

body .ct-contact-form .ct-submit-button:hover {
    color: var(--ct-primary) !important;
    background-color: #ffc21c !important;

    transform: translateY(-2px);

    box-shadow:
        0 14px 24px rgba(251, 184, 0, 0.3) !important;
}

body .ct-contact-form .ct-submit-button:active {
    transform: translateY(0);
}

body .ct-contact-form .ct-submit-button:focus-visible {
    outline: 3px solid rgba(26, 82, 112, 0.25);
    outline-offset: 4px;
}

body .ct-contact-form .ct-submit-button:disabled {
    opacity: 0.65 !important;

    cursor: wait;

    transform: none;
}

.ct-submit-wrapper::before {
    content: "";

    position: absolute;
    top: 50%;
    right: 43px;

    width: 16px;
    height: 2px;

    background-color: var(--ct-primary);

    pointer-events: none;

    transform: translateY(-50%);
}

.ct-submit-wrapper::after {
    content: "";

    position: absolute;
    top: 50%;
    right: 43px;

    width: 8px;
    height: 8px;

    border-top: 2px solid var(--ct-primary);
    border-right: 2px solid var(--ct-primary);

    pointer-events: none;

    transform:
        translateY(-50%)
        rotate(45deg);
}

.ct-submit-wrapper .wpcf7-spinner {
    position: absolute;
    top: 50%;
    left: calc(100% + 12px);

    margin: 0 !important;

    transform: translateY(-50%);
}


/* ==========================================================================
   17. VALIDATION
   ========================================================================== */

body .ct-contact-form .wpcf7-not-valid {
    border-color: var(--ct-error) !important;
}

.ct-contact-form .wpcf7-not-valid-tip {
    display: block;

    margin: 7px 0 0 !important;
    padding: 0 !important;

    color: var(--ct-error);

    font-family: "Roboto", Arial, sans-serif;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
}

.ct-form-consent .wpcf7-not-valid-tip {
    margin-left: 38px !important;
}

.ct-contact-form .wpcf7-response-output {
    margin: 26px 0 0 !important;
    padding: 14px 17px !important;

    color: var(--ct-primary);
    background-color: rgba(12, 120, 172, 0.06);

    border: 1px solid var(--ct-secondary) !important;
    border-radius: var(--ct-radius);

    font-family: "Roboto", Arial, sans-serif;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.45;
}

.ct-contact-form form.sent .wpcf7-response-output {
    color: var(--ct-success);
    background-color: rgba(23, 107, 58, 0.07);

    border-color: var(--ct-success) !important;
}

.ct-contact-form form.invalid .wpcf7-response-output,
.ct-contact-form form.failed .wpcf7-response-output,
.ct-contact-form form.unaccepted .wpcf7-response-output,
.ct-contact-form form.spam .wpcf7-response-output {
    color: var(--ct-error);
    background-color: rgba(180, 35, 24, 0.06);

    border-color: var(--ct-error) !important;
}


/* ==========================================================================
   18. TABLETTE ET MOBILE
   Les groupes restent sur deux colonnes.
   ========================================================================== */

@media screen and (max-width: 767px) {

    .ct-contact-form {
        max-width: none;

        font-size: 15px;
    }

    .ct-form-block + .ct-form-block {
        margin-top: 24px;
    }

    .ct-contact-form > .ct-form-grid + .ct-profile-field {
        margin-top: 36px !important;
    }

    .ct-contact-form .ct-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;

        column-gap: 14px;
        row-gap: 22px;
    }

    .ct-contact-form .ct-profile-field .wpcf7-radio {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;

        gap: 12px;
    }

    .ct-form-field {
        gap: 7px;
    }

    .ct-form-field > label,
    .ct-form-field > legend,
    .ct-profile-field > legend {
        font-size: 15px !important;
        line-height: 1.3 !important;
    }

    .ct-profile-field > legend {
        margin-bottom: 8px !important;
    }

    body .ct-contact-form input[type="text"],
    body .ct-contact-form input[type="email"],
    body .ct-contact-form input[type="tel"],
    body .ct-contact-form input[type="url"],
    body .ct-contact-form select {
        height: 56px !important;
        min-height: 56px !important;

        padding: 0 15px !important;

        font-size: 16px !important;
    }

    body .ct-contact-form select {
        padding-right: 42px !important;
    }

    .ct-select-wrapper::after {
        right: 17px;

        width: 9px;
        height: 9px;

        border-right-width: 2.5px;
        border-bottom-width: 2.5px;
    }

    .ct-profile-field .wpcf7-list-item > label {
        min-height: 56px;

        padding: 0 15px !important;
    }

    .ct-profile-field .wpcf7-list-item-label {
        gap: 9px;

        font-size: 15px;
    }

    .ct-profile-field .wpcf7-list-item-label::before {
        flex-basis: 17px;

        width: 17px;
        height: 17px;
    }

    body .ct-contact-form textarea {
        height: 160px;
        min-height: 160px !important;

        padding: 15px 17px !important;

        font-size: 16px !important;
        line-height: 1.48 !important;

        text-align: left !important;
        text-align-last: left !important;
    }

    body .ct-contact-form textarea::placeholder {
        text-align: left !important;
        text-align-last: left !important;
    }

    .ct-form-consent {
        margin-top: 27px !important;
    }

    .ct-form-consent .wpcf7-list-item > label {
        grid-template-columns: 19px minmax(0, 1fr);
        column-gap: 13px;
    }

    .ct-form-consent .wpcf7-list-item-label {
        font-size: 14px;
        line-height: 1.5;
    }

    .ct-form-footer {
        margin-top: 32px !important;
        padding-top: 26px !important;
    }

    .ct-form-reassurance {
        align-items: flex-start;

        gap: 10px;

        font-size: 14px;
    }

    .ct-submit-wrapper {
        width: 100%;

        margin-top: 28px;
    }

    body .ct-contact-form .ct-submit-button {
        height: 60px !important;
        min-height: 60px !important;

        padding: 0 55px 0 26px !important;

        font-size: 18px !important;
    }

    .ct-submit-wrapper::before,
    .ct-submit-wrapper::after {
        right: 28px;
    }

    .ct-submit-wrapper .wpcf7-spinner {
        right: 18px;
        left: auto;
    }
}


/* ==========================================================================
   19. PETITS MOBILES
   ========================================================================== */

@media screen and (min-width: 360px) and (max-width: 479px) {

    .ct-contact-form .ct-form-grid {
        column-gap: 10px;
        row-gap: 20px;
    }

    .ct-contact-form .ct-profile-field .wpcf7-radio {
        gap: 10px;
    }

    .ct-form-field > label,
    .ct-profile-field > legend {
        font-size: 13px !important;
    }

    body .ct-contact-form input[type="text"],
    body .ct-contact-form input[type="email"],
    body .ct-contact-form input[type="tel"],
    body .ct-contact-form input[type="url"],
    body .ct-contact-form select {
        height: 52px !important;
        min-height: 52px !important;

        padding: 0 12px !important;

        font-size: 14px !important;
    }

    body .ct-contact-form select {
        padding-right: 34px !important;
    }

    .ct-select-wrapper::after {
        right: 13px;

        width: 8px;
        height: 8px;

        border-right-width: 2px;
        border-bottom-width: 2px;
    }

    .ct-profile-field .wpcf7-list-item > label {
        min-height: 54px;

        padding: 0 11px !important;
    }

    .ct-profile-field .wpcf7-list-item-label {
        gap: 7px;

        font-size: 13px;

        white-space: nowrap;
    }

    .ct-profile-field .wpcf7-list-item-label::before {
        flex-basis: 16px;

        width: 16px;
        height: 16px;
    }

    body .ct-contact-form textarea {
        font-size: 15px !important;
    }
}


/* ==========================================================================
   20. ÉCRANS INFÉRIEURS À 360PX
   ========================================================================== */

@media screen and (max-width: 359px) {

    .ct-contact-form .ct-form-grid,
    .ct-contact-form .ct-profile-field .wpcf7-radio {
        grid-template-columns: 1fr !important;
    }

    .ct-contact-form .ct-form-grid {
        row-gap: 20px;
    }

    .ct-contact-form .ct-profile-field .wpcf7-radio {
        gap: 10px;
    }
}


/* ==========================================================================
   21. ACCESSIBILITÉ
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {

    .ct-contact-form *,
    .ct-contact-form *::before,
    .ct-contact-form *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;

        transition-duration: 0.01ms !important;

        scroll-behavior: auto !important;
    }
}

/* ==========================================================================
   MOBILE — PASSAGE EN UNE SEULE COLONNE
   ========================================================================== */

@media screen and (max-width: 767px) {

    /* Nom, prénom, e-mail, téléphone, besoin et bâtiment */
    .ct-contact-form .ct-form-grid {
        grid-template-columns: 1fr !important;
        column-gap: 0 !important;
        row-gap: 22px !important;
    }

    /* Particulier et professionnel */
    .ct-contact-form .ct-profile-field .wpcf7-radio {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
}