/* OMDS Monday frontend helpers */

.omds-monday-country-select {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 48px;
    padding: 14px 16px;
    border: 0;
    border-radius: 0;
    background-color: #eee;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
    box-sizing: border-box;
    appearance: auto;
    -webkit-appearance: menulist;
}

.et_pb_contact_field .omds-monday-country-select,
.et_pb_contact_form .omds-monday-country-select {
    width: 100%;
    margin: 0;
}

.omds-monday-form-loading {
    position: relative;
}

.omds-monday-form-loading button[type="submit"],
.omds-monday-form-loading input[type="submit"],
.omds-monday-form-loading .et_pb_contact_submit {
    pointer-events: none;
    opacity: .75;
}

.omds-monday-submit-loader {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    font-size: 14px;
    line-height: 1.4;
}

.omds-monday-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    display: inline-block;
    animation: omdsMondaySpin .8s linear infinite;
}

@keyframes omdsMondaySpin {
    to {
        transform: rotate(360deg);
    }
}


/* V15 - Loader central plus visible */
.omds-monday-form-loading {
    position: relative;
}

.omds-monday-form-loading::before {
    content: "";
    position: absolute;
    inset: -18px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 9998;
    border-radius: inherit;
}

.omds-monday-form-loading button[type="submit"],
.omds-monday-form-loading input[type="submit"],
.omds-monday-form-loading .et_pb_contact_submit {
    pointer-events: none;
}

.omds-monday-submit-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 9999;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 280px;
    justify-content: center;
    padding: 22px 26px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
    color: #222;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.35;
    text-align: center;
}

.omds-monday-spinner {
    width: 34px;
    height: 34px;
    border: 4px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    display: inline-block;
    flex: 0 0 auto;
    animation: omdsMondaySpin .8s linear infinite;
}

@media (max-width: 767px) {
    .omds-monday-submit-loader {
        width: calc(100% - 42px);
        min-width: 0;
        font-size: 16px;
        padding: 18px 20px;
    }
}

.omds-monday-form-loading button[type="submit"], .omds-monday-form-loading input[type="submit"], .omds-monday-form-loading .et_pb_contact_submit { opacity: 1 !important; }


/* V16 - Loader circulaire global, au-dessus du grisé Divi */
.omds-monday-form-loading::before,
.omds-monday-form-loading .omds-monday-submit-loader {
    display: none !important;
}

.omds-monday-global-loader {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.58);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    pointer-events: all;
}

.omds-monday-global-loader.is-visible {
    display: flex;
}

.omds-monday-progress-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 28px 32px;
    border-radius: 26px;
    background: rgba(255,255,255,.98);
    box-shadow: 0 24px 70px rgba(0,0,0,.22);
    min-width: 240px;
}

.omds-monday-progress-ring {
    --omds-progress: 0;
    width: 132px;
    height: 132px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background:
        conic-gradient(currentColor calc(var(--omds-progress) * 1%), rgba(0,0,0,.10) 0);
    color: #222;
}

.omds-monday-progress-inner {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: #fff;
    display: grid;
    place-items: center;
}

.omds-monday-progress-number {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.omds-monday-progress-text {
    font-size: 18px;
    font-weight: 700;
    color: #222;
    text-align: center;
}

@media (max-width: 767px) {
    .omds-monday-progress-card {
        min-width: 220px;
        padding: 24px 26px;
    }

    .omds-monday-progress-ring {
        width: 116px;
        height: 116px;
    }

    .omds-monday-progress-inner {
        width: 84px;
        height: 84px;
    }
}


/* V18 - Loader plus fluide + auto-fermeture */
.omds-monday-progress-ring {
    transition: background 160ms linear;
    will-change: background;
}

.omds-monday-progress-number {
    font-variant-numeric: tabular-nums;
}

.omds-monday-global-loader.is-success .omds-monday-progress-text::after {
    content: " terminé";
}

.omds-monday-global-loader.is-success .omds-monday-progress-card {
    transform: scale(1.02);
    transition: transform 220ms ease;
}

.omds-monday-global-loader {
    transition: opacity 180ms ease;
}


/* V22 - Loader simple non bloquant */
#omds-monday-global-loader,
.omds-monday-global-loader {
    display: none !important;
}

.omds-monday-simple-loader {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 2147483647;
    display: none;
    align-items: center;
    gap: 12px;
    max-width: calc(100vw - 44px);
    padding: 14px 18px;
    border-radius: 999px;
    background: rgba(255,255,255,.98);
    box-shadow: 0 12px 36px rgba(0,0,0,.22);
    color: #222;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    pointer-events: none;
}

.omds-monday-simple-loader.is-visible {
    display: flex;
}

.omds-monday-simple-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    display: inline-block;
    flex: 0 0 auto;
    animation: omdsMondaySpin .75s linear infinite;
}

@media (max-width: 767px) {
    .omds-monday-simple-loader {
        left: 16px;
        right: 16px;
        bottom: 16px;
        justify-content: center;
        border-radius: 16px;
    }
}


/* V23 - Loader simple centré, fixed, non bloquant */
.omds-monday-simple-loader {
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    border-radius: 18px !important;
    padding: 18px 22px !important;
    justify-content: center;
    text-align: center;
    min-width: 260px;
    pointer-events: none !important;
}

@media (max-width: 767px) {
    .omds-monday-simple-loader {
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: calc(100vw - 40px);
        min-width: 0;
        max-width: 420px;
    }
}
