/**
 * Styles des formulaires d'inscription Digitevent — Salon JMD
 * Charte graphique : Clash Grotesk, Rouge #e6311c, Noir #1d1d1b
 * Garantit un affichage 100 % fluide et responsive dans Elementor sans contrainte de largeur fixe.
 */

.jmd-form-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    font-family: "Clash Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1d1d1b;
    box-sizing: border-box;
}

.jmd-form-wrapper *,
.jmd-form-wrapper *::before,
.jmd-form-wrapper *::after {
    box-sizing: border-box;
}

/* ==========================================================================
   Cartes d'encapsulation conformes au design du site
   ========================================================================== */
.jmd-form-card {
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    position: relative;
    width: 100%;
}

/* Variantes Visiteur, Exposant et Minimaliste (sans filet ni ombre) */
.jmd-form-card--visiteur,
.jmd-form-card--exposant,
.jmd-form-card--minimal {
    border: none;
    box-shadow: none;
    border-radius: 0;
    background: transparent;
}

/* ==========================================================================
   Bandeau d'en-tête optionnel
   ========================================================================== */
.jmd-form-header {
    padding: 18px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 2px solid #f0f0f0;
    background: #fafafa;
}

.jmd-form-card--visiteur .jmd-form-header {
    background: #e6311c;
    color: #ffffff;
    border-bottom: none;
}

.jmd-form-card--exposant .jmd-form-header {
    background: #1d1d1b;
    color: #ffffff;
    border-bottom: none;
}

.jmd-form-header-title {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
    color: inherit !important;
    letter-spacing: 0.02em;
}

/* ==========================================================================
   Conteneur de l'iFrame & Loader
   ========================================================================== */
.jmd-iframe-container {
    --jmd-iframe-height: 1650px;
    position: relative;
    width: 100% !important;
    max-width: 100% !important;
    min-height: var(--jmd-iframe-height, 1650px);
    background: #ffffff;
}

.jmd-form-wrapper--exposant .jmd-iframe-container {
    --jmd-iframe-height: 1450px;
}

.jmd-form-card--minimal .jmd-iframe-container {
    background: transparent;
}

.jmd-digievent-iframe {
    width: 100% !important;
    max-width: 100% !important;
    min-height: var(--jmd-iframe-height, 1650px);
    height: var(--jmd-iframe-height, 1650px);
    border: 0 !important;
    display: block;
    margin: 0;
    padding: 0;
    background: transparent;
    transition: height 0.2s ease, opacity 0.25s ease;
}

/* Indicateur de chargement */
.jmd-iframe-loader {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.92);
    z-index: 2;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.jmd-iframe-container.is-loaded .jmd-iframe-loader {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.jmd-iframe-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(230, 49, 28, 0.2);
    border-top-color: #e6311c;
    border-radius: 50%;
    animation: jmdFormSpin 0.8s linear infinite;
}

.jmd-iframe-loader-text {
    font-size: 14px;
    font-weight: 500;
    color: #555555;
}

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

/* Message d'alerte visible uniquement pour les administrateurs si l'URL manque */
.jmd-form-admin-notice {
    padding: 28px 24px;
    background: #fff8e5;
    border: 2px dashed #dba617;
    border-radius: 8px;
    color: #1d2327;
    text-align: center;
    font-size: 14px;
    line-height: 1.6;
}

.jmd-form-admin-notice a {
    color: #e6311c;
    font-weight: 600;
    text-decoration: underline;
}

/* ==========================================================================
   Adaptations Responsives (Tablette & Mobile)
   ========================================================================== */
@media (max-width: 1024px) {
    .jmd-iframe-container,
    .jmd-digievent-iframe {
        min-height: calc(var(--jmd-iframe-height, 1650px) + 150px);
        height: calc(var(--jmd-iframe-height, 1650px) + 150px);
    }
}

@media (max-width: 768px) {
    .jmd-form-header {
        padding: 14px 18px;
    }

    .jmd-form-header-title {
        font-size: 17px;
    }

    .jmd-iframe-container,
    .jmd-digievent-iframe {
        min-height: calc(var(--jmd-iframe-height, 1650px) + 300px);
        height: calc(var(--jmd-iframe-height, 1650px) + 300px);
    }
}
