/*!
 * EPO Forms — feuille de style unique (design v5 default).
 * Calée sur le design system europiecedor.fr / max-calculator / epo-gold :
 *   - Plus Jakarta Sans, palette marine #0F2744 + or #C9A24A + cream #FAF7F0
 *   - Card encapsulée bg blanc, radius 16, shadow douce
 *   - Layout mono-colonne
 *   - Inputs cream radius 8, focus or
 * Scoped sous .epo-form pour ne rien casser ailleurs sur le site.
 */

.epo-form,
.epo-form-section--design-v5 {
    --epo-marine: #0F2744;
    --epo-marine-2: #1A3554;
    --epo-or: #C9A24A;
    --epo-or-fonce: #A6852E;
    --epo-or-clair: #D9B766;
    --epo-cream: #FAF7F0;
    --epo-cream-2: #F2EDE0;
    --epo-gris-1: #F7F6F2;
    --epo-gris-3: #B8B5AD;
    --epo-text: #4A4742;
    --epo-label: #6E6A62;
    --epo-line: rgba(15, 39, 68, .10);
    --epo-line-str: rgba(15, 39, 68, .18);
    --epo-vert: #2C7A4B;
    --epo-alert: #B20000;
    --epo-ease: cubic-bezier(.25, 1, .5, 1);
}

/* =====================================================================
   SECTION WRAPPER (mode default — full-bleed bg gris chaud)
   Désactivé via attribut shortcode flat=1 quand le parent Flatsome
   gère déjà le bg.
   ===================================================================== */
.epo-form-section--design-v5 {
    background: var(--epo-gris-1);
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-top: -40px;
    margin-bottom: -40px;
    padding: 96px max(20px, calc((100vw - 720px) / 2)) 104px;
    box-sizing: border-box;
}
@media (max-width: 640px) {
    .epo-form-section--design-v5 {
        margin-top: -30px;
        margin-bottom: -30px;
        padding: 66px 28px 70px;
    }
}

/* =====================================================================
   FORM CARD (design v5 — par défaut, encapsulé)
   ===================================================================== */
.epo-form {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--epo-text);
    line-height: 1.55;
    letter-spacing: -.005em;
    background: #fff;
    max-width: 700px;
    margin: 0 auto;
    padding: 32px 28px 28px;
    border: 1px solid var(--epo-line);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(15, 39, 68, .08);
}
@media (max-width: 640px) {
    .epo-form { padding: 24px 20px 22px; border-radius: 12px; }
}
.epo-form *,
.epo-form *::before,
.epo-form *::after { box-sizing: border-box; }

/* En-tête : eyebrow + title + lead ------------------------------------ */
.epo-form__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--epo-label);
}
.epo-form__eyebrow::before {
    content: "";
    display: inline-block;
    width: 28px;
    height: 1px;
    background: var(--epo-line-str);
}
.epo-form__title {
    color: var(--epo-marine);
    margin: 0 0 10px;
    font-size: clamp(22px, 2.6vw, 28px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.025em;
}
.epo-form__desc {
    color: var(--epo-text);
    margin: 0 0 22px;
    font-size: 15px;
    line-height: 1.55;
}

/* Lignes ---------------------------------------------------------------- */
.epo-form__row { margin: 0 0 16px; }
.epo-form__row:last-of-type { margin-bottom: 0; }

.epo-form__label {
    display: block;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--epo-label);
}
.epo-form__req { color: var(--epo-or-fonce); margin-left: .2em; }
.epo-form__help {
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--epo-label);
    line-height: 1.45;
}

/* Inputs ---------------------------------------------------------------- */
.epo-form input[type="text"],
.epo-form input[type="email"],
.epo-form input[type="tel"],
.epo-form input[type="number"],
.epo-form select {
    width: 100%;
    min-height: 48px;
    padding: 0 16px;
    background: var(--epo-cream);
    border: 1px solid var(--epo-line);
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    color: var(--epo-marine);
    line-height: 1.45;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color .2s var(--epo-ease), background .2s var(--epo-ease), box-shadow .2s var(--epo-ease);
}
.epo-form textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--epo-cream);
    border: 1px solid var(--epo-line);
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    color: var(--epo-marine);
    min-height: 110px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color .2s var(--epo-ease), background .2s var(--epo-ease), box-shadow .2s var(--epo-ease);
}
.epo-form input::placeholder,
.epo-form textarea::placeholder { color: #A0A89E; font-weight: 400; }

.epo-form input:hover,
.epo-form select:hover,
.epo-form textarea:hover { border-color: var(--epo-line-str); }

.epo-form input:focus,
.epo-form select:focus,
.epo-form textarea:focus {
    outline: none;
    background: #fff;
    border-color: var(--epo-or);
    box-shadow: 0 0 0 3px rgba(201, 162, 74, .15);
}

/* Chevron select custom */
.epo-form select {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236E6A62' d='M6 7.5L0 1.5 1.5 0 6 4.5 10.5 0 12 1.5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* File input — dropzone cream + bouton intégré ------------------------- */
.epo-form input[type="file"] {
    width: 100%;
    padding: 12px 16px;
    background: var(--epo-cream);
    border: 1.5px dashed var(--epo-line-str);
    border-radius: 8px;
    font-size: 14px;
    color: var(--epo-label);
    cursor: pointer;
    transition: border-color .2s var(--epo-ease), background .2s var(--epo-ease);
}
.epo-form input[type="file"]:hover {
    border-color: var(--epo-or);
    background: var(--epo-cream-2);
}
.epo-form input[type="file"]::file-selector-button {
    margin-right: 14px;
    padding: 8px 16px;
    background: var(--epo-marine);
    color: #fff;
    border: 0;
    border-radius: 4px;
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .15s var(--epo-ease);
}
.epo-form input[type="file"]::file-selector-button:hover { background: var(--epo-or-fonce); }

/* Radios & checkboxes en pills cream ------------------------------------ */
.epo-form__choices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 2px;
}
.epo-form__choice {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: #fff;
    border: 1px solid var(--epo-line-str);
    border-radius: 100px;
    font-size: 14px;
    color: var(--epo-marine);
    cursor: pointer;
    user-select: none;
    transition: all .2s var(--epo-ease);
}
.epo-form__choice:hover {
    border-color: var(--epo-or);
    background: var(--epo-cream);
}
.epo-form__choice input {
    width: 16px;
    height: 16px;
    accent-color: var(--epo-or-fonce);
    margin: 0;
    flex-shrink: 0;
}
.epo-form__choice:has(input:checked) {
    border-color: var(--epo-or);
    background: var(--epo-cream);
    color: var(--epo-marine);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(15, 39, 68, .05);
}

/* Bouton submit — or doré + flèche ------------------------------------- */
.epo-form__row--submit { margin-top: 18px; }
.epo-form .epo-form__submit.epo-form__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55em;
    width: 100% !important;
    min-height: 0 !important;
    height: 54px !important;
    padding: 0 32px !important;
    background: var(--epo-or) !important;
    color: #fff !important;
    border: 0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 800;
    line-height: 1 !important;
    letter-spacing: -.005em;
    text-transform: none;
    text-shadow: none;
    cursor: pointer;
    box-shadow: inset 0 -1px 0 var(--epo-or-fonce), 0 4px 14px rgba(166, 133, 46, .22);
    transition: all .25s var(--epo-ease);
}
.epo-form .epo-form__submit.epo-form__submit::after {
    content: " →";
    display: inline-block;
    margin-left: 2px;
    transition: transform .25s var(--epo-ease);
}
.epo-form .epo-form__submit.epo-form__submit:hover {
    background: var(--epo-or-fonce) !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: inset 0 -1px 0 var(--epo-or-fonce), 0 10px 24px rgba(166, 133, 46, .32);
}
.epo-form .epo-form__submit.epo-form__submit:hover::after { transform: translateX(4px); }
.epo-form .epo-form__submit.epo-form__submit:active { transform: translateY(0); }
.epo-form .epo-form__submit.epo-form__submit:focus-visible {
    outline: none;
    box-shadow: inset 0 -1px 0 var(--epo-or-fonce), 0 0 0 4px rgba(201, 162, 74, .35);
}
.epo-form .epo-form__submit.epo-form__submit[disabled] {
    opacity: .55;
    cursor: wait;
    transform: none;
    box-shadow: none;
}
.epo-form .epo-form__submit.epo-form__submit[disabled]::after {
    content: "";
    width: 14px;
    height: 14px;
    margin-left: 10px;
    border: 2px solid rgba(255, 255, 255, .4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: epo-form-spin .7s linear infinite;
    transform: none;
}
@media (min-width: 720px) {
    .epo-form .epo-form__submit.epo-form__submit {
        width: auto !important;
        min-width: 260px;
    }
}
@keyframes epo-form-spin { to { transform: rotate(360deg); } }

/* Bouton "ouvrir popup" ------------------------------------------------- */
.epo-form__open.epo-form__open {
    display: inline-block;
    height: auto;
    min-height: 0 !important;
    padding: 13px 26px !important;
    margin: 0;
    background: var(--epo-marine);
    color: #fff;
    border: 0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    line-height: 1.2 !important;
    text-shadow: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
    transition: background .2s var(--epo-ease), transform .05s var(--epo-ease), box-shadow .2s var(--epo-ease);
}
.epo-form__open.epo-form__open:hover {
    background: var(--epo-or-fonce);
    color: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
}
.epo-form__open.epo-form__open:active { transform: translateY(1px); }

/* États messages globaux ------------------------------------------------ */
.epo-form__messages {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    border-left: 3px solid;
    background: #fff;
    animation: epo-form-slide .25s var(--epo-ease);
}
.epo-form__messages:empty { display: none; }
.epo-form__messages.is-success {
    background: #F0FAF2;
    border-color: var(--epo-vert);
    color: #155028;
}
.epo-form__messages.is-error {
    background: #FEF4F4;
    border-color: var(--epo-alert);
    color: #7A1C1C;
}
.epo-form__messages.is-pending {
    background: #F5F9FF;
    border-color: var(--epo-marine);
    color: var(--epo-marine);
}
@keyframes epo-form-slide {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* États invalid — outline (Flatsome impose border shorthand !important) -- */
.epo-form .epo-form__row--invalid input[type="text"],
.epo-form .epo-form__row--invalid input[type="email"],
.epo-form .epo-form__row--invalid input[type="tel"],
.epo-form .epo-form__row--invalid input[type="number"],
.epo-form .epo-form__row--invalid select,
.epo-form .epo-form__row--invalid textarea {
    outline: 2px solid var(--epo-alert);
    outline-offset: -1px;
    background: #FFF5F5 !important;
}
.epo-form .epo-form__row--invalid input:focus,
.epo-form .epo-form__row--invalid select:focus,
.epo-form .epo-form__row--invalid textarea:focus {
    outline-color: var(--epo-alert);
    box-shadow: 0 0 0 3px rgba(178, 0, 0, .18);
}
.epo-form__field-error {
    color: var(--epo-alert);
    font-size: 13px;
    font-weight: 600;
    margin-top: 6px;
}

/* Honeypot — invisible et inaccessible clavier ------------------------- */
.epo-form__hp {
    position: absolute !important;
    left: -9999px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* HTML libre injecté via schema ----------------------------------------- */
.epo-form__html {
    margin-bottom: 16px;
    font-size: 14.5px;
    color: var(--epo-text);
}
.epo-form__html p { margin: 0 0 .8em; }

/* =====================================================================
   POPUP
   ===================================================================== */
.epo-form__overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 39, 68, .65);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: epo-form-fade .2s var(--epo-ease);
}
.epo-form__overlay[hidden] { display: none; }
.epo-form__modal {
    position: relative;
    background: #fff;
    padding: 0;
    border-radius: 16px;
    max-width: 580px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
    animation: epo-form-pop .25s cubic-bezier(.16, 1, .3, 1);
}
.epo-form__modal .epo-form {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    max-width: 100%;
}
@media (max-width: 640px) {
    .epo-form__overlay { padding: 0; align-items: stretch; }
    .epo-form__modal { max-width: 100%; max-height: 100vh; border-radius: 0; }
}
.epo-form__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    color: #888;
    border-radius: 6px;
    z-index: 2;
    transition: background .15s var(--epo-ease), color .15s var(--epo-ease);
}
.epo-form__close:hover { background: #f5f5f5; color: #000; }
.epo-form__close:focus-visible {
    outline: 2px solid var(--epo-or);
    outline-offset: 2px;
}
@keyframes epo-form-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes epo-form-pop {
    from { opacity: 0; transform: translateY(20px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* =====================================================================
   LAYOUT SPLIT — visual + form côte-à-côte
   Activé via preset admin (layout=split | split-reverse).
   ===================================================================== */
.epo-form-split {
    --epo-marine: #0F2744;
    --epo-or: #C9A24A;
    --epo-or-fonce: #A6852E;
    --epo-cream: #FAF7F0;
    --epo-cream-2: #F2EDE0;
    --epo-gris-1: #F7F6F2;
    --epo-text: #4A4742;
    --epo-label: #6E6A62;
    --epo-line: rgba(15, 39, 68, .10);
    --epo-line-str: rgba(15, 39, 68, .18);
    --epo-ease: cubic-bezier(.25, 1, .5, 1);

    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    color: var(--epo-text);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    padding: 64px max(20px, calc((100vw - 1200px) / 2));
    box-sizing: border-box;
}
.epo-form-split--bg-cream      { background: var(--epo-cream); }
.epo-form-split--bg-gris-chaud { background: var(--epo-gris-1); }
.epo-form-split--bg-blanc      { background: #fff; }
.epo-form-split--split-reverse .epo-form-split__visual   { order: 2; }
.epo-form-split--split-reverse .epo-form-split__form-col { order: 1; }

.epo-form-split *,
.epo-form-split *::before,
.epo-form-split *::after { box-sizing: border-box; }

/* Colonne visuelle ----------------------------------------------------- */
.epo-form-split__visual {
    background: #fff;
    border-radius: 16px;
    padding: 40px 36px 44px;
    box-shadow: 0 4px 20px rgba(15, 39, 68, .06);
    display: flex;
    flex-direction: column;
}
.epo-form-split__media {
    margin: -20px auto 20px;
    max-width: 320px;
}
.epo-form-split__media img,
.epo-form-split__image {
    width: 100%;
    height: auto;
    display: block;
}
.epo-form-split__textual { margin-top: auto; }
.epo-form-split__title {
    color: var(--epo-marine);
    font-size: clamp(24px, 2.6vw, 32px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.02em;
    margin: 10px 0 18px;
    text-align: center;
}
.epo-form-split__intro {
    color: var(--epo-text);
    font-size: 15px;
    line-height: 1.55;
    margin: 0 0 20px;
    text-align: center;
}
.epo-form-split__visual .epo-form__eyebrow {
    display: flex;
    justify-content: center;
    margin: 0 0 6px;
}
.epo-form-split__steps {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.epo-form-split__step {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 16px;
    align-items: start;
}
.epo-form-split__step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--epo-or);
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    box-shadow: inset 0 -1px 0 var(--epo-or-fonce);
}
.epo-form-split__step-title {
    color: var(--epo-marine);
    margin: 4px 0 4px;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.3;
}
.epo-form-split__step-text {
    color: var(--epo-text);
    font-size: 14.5px;
    line-height: 1.55;
    margin: 0;
}

/* Colonne form --------------------------------------------------------- */
.epo-form-split__form-col { display: flex; align-items: flex-start; }
.epo-form-split__card {
    background: #fff;
    border-radius: 16px;
    padding: 36px 32px 32px;
    box-shadow: 0 4px 20px rgba(15, 39, 68, .08);
    width: 100%;
}
.epo-form-split__form-title {
    color: var(--epo-marine);
    margin: 0 0 6px;
    font-size: clamp(20px, 2.2vw, 26px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.02em;
}
.epo-form-split__form-subtitle {
    color: var(--epo-label);
    margin: 0 0 22px;
    font-size: 14.5px;
    line-height: 1.5;
}
/* En mode split, le form lui-même n'a plus de card autour (le card est sur la
   colonne entière) — on retire bg/border/shadow/padding du .epo-form. */
.epo-form-split__card .epo-form {
    background: transparent;
    border: 0;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    max-width: 100%;
    margin: 0;
}

/* RGPD checkbox -------------------------------------------------------- */
.epo-form__row--rgpd { margin-top: 4px; margin-bottom: 16px; }
.epo-form__rgpd {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 13.5px;
    line-height: 1.45;
    color: var(--epo-text);
}
.epo-form__rgpd input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
    accent-color: var(--epo-or-fonce);
    cursor: pointer;
}
.epo-form__rgpd a {
    color: var(--epo-marine);
    text-decoration: underline;
    text-decoration-color: var(--epo-or);
    text-underline-offset: 2px;
}
.epo-form__rgpd a:hover { color: var(--epo-or-fonce); }
.epo-form__row--rgpd.epo-form__row--invalid .epo-form__rgpd {
    color: var(--epo-alert);
}
.epo-form__row--rgpd.epo-form__row--invalid .epo-form__rgpd input {
    outline: 2px solid var(--epo-alert);
    outline-offset: 2px;
}

/* Trust badges --------------------------------------------------------- */
.epo-form__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    justify-content: center;
    margin-top: 18px;
}
.epo-form__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--epo-or-fonce);
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: -.005em;
}
.epo-form__badge-icon {
    color: var(--epo-or);
    flex-shrink: 0;
}

/* Responsive ----------------------------------------------------------- */
@media (max-width: 900px) {
    .epo-form-split {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 40px 20px;
    }
    .epo-form-split--split-reverse .epo-form-split__visual,
    .epo-form-split--split-reverse .epo-form-split__form-col {
        order: initial;
    }
    .epo-form-split__visual {
        padding: 28px 24px 32px;
    }
    .epo-form-split__media {
        margin: -8px auto 16px;
        max-width: 240px;
    }
    .epo-form-split__card {
        padding: 28px 22px 24px;
    }
}
@media (max-width: 480px) {
    .epo-form-split {
        padding: 28px 14px;
    }
}
