/* ==========================================================
   JEU DE MOI — MOTEUR D'AIDE RÉUTILISABLE
   v0.13.22
   ========================================================== */

html.jdm-help-open,
body.jdm-help-open {
    overflow: hidden;
}

.jdm-help-modal[hidden] {
    display: none !important;
}

.jdm-help-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.jdm-help-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 39, 69, 0.62);
    backdrop-filter: blur(2px);
}

.jdm-help-dialog {
    position: relative;
    z-index: 1;
    width: min(1220px, 100%);
    max-height: min(88vh, 920px);
    overflow: auto;
    background: #ffffff;
    border: 2px solid #d8e9f6;
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(8, 39, 69, 0.28);
    overscroll-behavior: contain;
}

.jdm-help-close {
    position: sticky;
    top: 12px;
    z-index: 3;
    float: right;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin: 12px 12px -54px 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #123a63;
    color: #ffffff;
    font: inherit;
    font-size: 27px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(18, 58, 99, 0.2);
}

.jdm-help-close:hover,
.jdm-help-close:focus-visible {
    background: #0a2f55;
}

.jdm-help-close:focus-visible,
[data-jdm-aide]:focus-visible,
a[href^="#aide-"]:focus-visible {
    outline: 3px solid #f5c542;
    outline-offset: 3px;
}

.jdm-help-content {
    clear: both;
    padding: 34px 42px 40px;
}

.jdm-help-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding-right: 54px;
    margin-bottom: 28px;
}

.jdm-help-badge {
    display: inline-flex;
    flex: 0 0 62px;
    width: 62px;
    height: 62px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #72b9e8;
    color: #ffffff;
    font-size: 34px;
    font-weight: 800;
}

.jdm-help-header h2 {
    margin: 0 0 4px;
    color: #123a63;
    font-size: clamp(25px, 3vw, 32px);
    line-height: 1.15;
}

.jdm-help-header p {
    margin: 0;
    color: #60758a;
    font-size: 17px;
}

.jdm-help-steps {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 10px;
    margin: 0 auto 18px;
}

.jdm-help-step {
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    color: #123a63;
    text-align: center;
}

.jdm-help-step b {
    display: flex;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    margin-bottom: 7px;
    border-radius: 50%;
    background: #123a63;
    color: #ffffff;
    font-size: 22px;
}

.jdm-help-step span {
    font-size: 13px;
    line-height: 1.25;
    font-weight: 700;
}

.jdm-help-arrow {
    flex: 0 0 auto;
    padding-top: 11px;
    color: #e3b600;
    font-size: 26px;
    font-weight: 800;
}

.jdm-help-lead {
    margin: 0 0 25px;
    color: #52677d;
    text-align: center;
    font-size: 17px;
    line-height: 1.55;
}

.jdm-help-callout {
    margin: 0 0 28px;
    padding: 22px 26px;
    background: #eef8ff;
    border-left: 5px solid #72b9e8;
    border-radius: 16px;
}

.jdm-help-callout h3,
.jdm-help-section-title {
    margin: 0 0 9px;
    color: #123a63;
}

.jdm-help-callout h3 {
    font-size: 21px;
}

.jdm-help-callout p {
    margin: 0;
    color: #52677d;
    line-height: 1.6;
}

.jdm-help-section-title {
    text-align: center;
    font-size: 22px;
}

.jdm-help-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.jdm-help-option {
    display: flex;
    gap: 15px;
    padding: 19px;
    background: #fff9e7;
    border: 1px solid #f0d989;
    border-radius: 15px;
}

.jdm-help-checkbox {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    margin-top: 1px;
    border: 2px solid #123a63;
    border-radius: 5px;
    background: #ffffff;
}

.jdm-help-option h4 {
    margin: 0 0 6px;
    color: #123a63;
    font-size: 18px;
}

.jdm-help-option p {
    margin: 0;
    color: #52677d;
    line-height: 1.5;
}

.jdm-help-note {
    margin: 15px 0 27px;
    color: #52677d;
    text-align: center;
}

.jdm-help-final {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 19px 22px;
    background: #f1f8f3;
    border-radius: 15px;
    color: #405d52;
    line-height: 1.6;
}

.jdm-help-final-icon {
    display: inline-flex;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #86c89b;
    color: #ffffff;
    font-size: 21px;
    font-weight: 800;
}

.jdm-help-final p {
    margin: 3px 0 0;
}

.jdm-help-footer {
    margin-top: 25px;
    text-align: center;
}

.jdm-help-footer button {
    min-width: 150px;
    min-height: 46px;
    padding: 10px 24px;
    border: 0;
    border-radius: 999px;
    background: #2d91da;
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.jdm-help-footer button:hover,
.jdm-help-footer button:focus-visible {
    background: #217fc2;
}

@media (max-width: 760px) {
    .jdm-help-modal {
        padding: 10px;
    }

    .jdm-help-dialog {
        max-height: 94vh;
        border-radius: 16px;
    }

    .jdm-help-content {
        padding: 28px 18px 28px;
    }

    .jdm-help-header {
        flex-direction: column;
        padding-right: 42px;
        text-align: center;
    }

    .jdm-help-steps {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 17px 8px;
    }

    .jdm-help-arrow {
        display: none;
    }

    .jdm-help-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 460px) {
    .jdm-help-steps {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================
   DIDACTICIEL PHOTOS — v0.13.21
   ========================================================== */

.jdm-help-badge-photos {
    background: #79c792;
}

.jdm-help-photo-principle {
    margin: 0 0 22px;
    padding: 19px 22px;
    background: #eef8ff;
    border-radius: 15px;
}

.jdm-help-photo-principle h3,
.jdm-help-photo-step h3 {
    margin: 0 0 8px;
    color: #123a63;
}

.jdm-help-photo-principle h3 {
    font-size: 21px;
}

.jdm-help-photo-principle p,
.jdm-help-photo-step p {
    color: #52677d;
    line-height: 1.55;
}

.jdm-help-photo-principle p {
    margin: 0;
}

.jdm-help-photo-step {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 16px;
    margin: 0 0 18px;
    padding: 18px;
    border: 1px solid #cfe3f5;
    border-radius: 15px;
    background: #ffffff;
}

.jdm-help-photo-number {
    display: flex;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #123a63;
    color: #ffffff;
    font-size: 23px;
    font-weight: 800;
}

.jdm-help-photo-body {
    min-width: 0;
}

.jdm-help-photo-body > p {
    margin: 0 0 10px;
}

.jdm-help-photo-split {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(320px, 1.35fr);
    gap: 18px;
    align-items: center;
}

.jdm-help-photo-note {
    margin: 12px 0 0 !important;
    padding: 12px 14px;
    background: #eef8ff;
    border-radius: 10px;
    font-size: 14px;
}

.jdm-help-photo-note-centered {
    text-align: center;
}

.jdm-help-photo-gallery {
    margin-top: 14px;
}

.jdm-help-photo-gallery-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.jdm-help-photo-shot {
    margin: 0;
    min-width: 0;
    padding: 8px;
    background: #f8fbfe;
    border: 1px solid #d7e6f2;
    border-radius: 11px;
}

.jdm-help-photo-shot img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 255px;
    object-fit: contain;
    object-position: center;
    border-radius: 7px;
}

.jdm-help-photo-shot figcaption {
    margin-top: 7px;
    color: #60758a;
    font-size: 12px;
    line-height: 1.35;
}

.jdm-help-photo-warning {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr);
    gap: 14px;
    align-items: center;
    margin-top: 14px;
    padding: 14px;
    background: #fff3f3;
    border: 1px solid #f0a6a6;
    border-radius: 12px;
}

.jdm-help-photo-warning h4 {
    margin: 0 0 7px;
    color: #c92d2d;
    font-size: 17px;
}

.jdm-help-photo-warning p {
    margin: 0;
}

.jdm-help-photo-branches {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.jdm-help-photo-branch {
    padding: 15px 16px;
    background: #fff9e7;
    border: 1px solid #f0d989;
    border-radius: 12px;
}

.jdm-help-photo-branch h4 {
    margin: 0 0 6px;
    color: #123a63;
    font-size: 17px;
}

.jdm-help-photo-branch p {
    margin: 0;
}

.jdm-help-photo-success {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: 14px;
    padding: 14px 15px;
    background: #f1f8f3;
    border-radius: 11px;
}

.jdm-help-photo-success > span {
    display: inline-flex;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #58b77c;
    color: #ffffff;
    font-weight: 800;
}

.jdm-help-photo-success p {
    margin: 1px 0 0;
}

@media (max-width: 820px) {
    .jdm-help-photo-split,
    .jdm-help-photo-gallery-two,
    .jdm-help-photo-warning,
    .jdm-help-photo-branches {
        grid-template-columns: 1fr;
    }

    .jdm-help-photo-shot img {
        max-height: none;
    }
}

@media (max-width: 560px) {
    .jdm-help-photo-step {
        grid-template-columns: 1fr;
    }

    .jdm-help-photo-number {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }
}


/* ==========================================================
   v0.13.22 — CAPTURES PLUS GRANDES + ZOOM
   ========================================================== */

/* Les captures du didacticiel Photos passent sur toute la largeur
   disponible : elles doivent être lisibles, pas seulement décoratives. */
.jdm-help-tutorial-photos .jdm-help-photo-split,
.jdm-help-tutorial-photos .jdm-help-photo-gallery-two,
.jdm-help-tutorial-photos .jdm-help-photo-warning {
    grid-template-columns: 1fr;
}

.jdm-help-tutorial-photos .jdm-help-photo-shot {
    width: 100%;
    max-width: 940px;
    margin-left: auto;
    margin-right: auto;
    padding: 12px;
}

.jdm-help-tutorial-photos .jdm-help-photo-shot img {
    width: 100%;
    max-height: none;
    cursor: zoom-in;
    border: 1px solid #e2ebf2;
    background: #ffffff;
}

.jdm-help-tutorial-photos .jdm-help-photo-shot img:hover {
    box-shadow: 0 5px 18px rgba(18, 58, 99, 0.14);
}

.jdm-help-tutorial-photos .jdm-help-photo-shot figcaption {
    font-size: 13px;
    text-align: center;
}

.jdm-help-tutorial-photos .jdm-help-photo-shot figcaption::after {
    content: " — cliquez sur l’image pour l’agrandir";
    font-weight: 700;
    color: #2d78b7;
}

/* Zoom plein écran des captures. */
.jdm-help-image-zoom[hidden] {
    display: none !important;
}

.jdm-help-image-zoom {
    position: fixed;
    inset: 0;
    z-index: 1000001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(5, 28, 49, 0.90);
}

.jdm-help-image-zoom img {
    display: block;
    width: 96vw;
    height: 90vh;
    max-width: none;
    max-height: none;
    object-fit: contain;
    background: transparent;
    border-radius: 0;
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.4);
}

.jdm-help-image-zoom-close {
    position: fixed;
    top: 18px;
    right: 22px;
    z-index: 2;
    display: inline-flex;
    width: 46px;
    height: 46px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #123a63;
    color: #ffffff;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.jdm-help-image-zoom-hint {
    position: fixed;
    left: 50%;
    bottom: 13px;
    transform: translateX(-50%);
    margin: 0;
    color: #ffffff;
    font-size: 14px;
    text-align: center;
}

@media (max-width: 760px) {
    .jdm-help-image-zoom {
        padding: 58px 8px 38px;
    }

    .jdm-help-image-zoom img {
        width: 98vw;
        height: 84vh;
        max-width: none;
        max-height: none;
    }
}

/* v0.13.24 — compléments Photos : Bonus/Malus et pions */
.jdm-help-photo-subblock {
    margin: 14px 0;
    padding: 16px 18px;
    background: #f3f8fc;
    border-radius: 12px;
}
.jdm-help-photo-subblock-highlight {
    background: #fff8e6;
    border: 1px solid #f1d47a;
}
.jdm-help-photo-subblock h4 { margin: 0 0 8px; color: #123a63; }
.jdm-help-photo-subblock p:last-child { margin-bottom: 0; }


/* ==========================================================
   v0.13.26 — SÉLECTION DES PHOTOS DE BOÎTE PLUS COMPACTE
   ========================================================== */
.jdm-help-tutorial-photos .jdm-help-photo-shot-boite-compact {
    max-width: 230px;
    padding: 6px;
}

.jdm-help-tutorial-photos .jdm-help-photo-shot-boite-compact figcaption {
    font-size: 14px;
    font-weight: 700;
    color: #123a63;
}

@media (max-width: 600px) {
    .jdm-help-tutorial-photos .jdm-help-photo-shot-boite-compact {
        max-width: 100%;
    }
}

/* v0.13.27 — capture boîte encore réduite de moitié sur écran large */


/* ==========================================================
   v0.13.51 — AIDE CONTEXTUELLE : SUIVI DE COMMANDE
   Le bouton est rendu directement avec le titre du bloc de suivi.
   Aucun script d'injection : le contexte de l'écran porte lui-même son aide.
   ========================================================== */
.jdm-tracking-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.jdm-context-help-button {
    display: inline-grid;
    place-items: center;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    margin: 0;
    padding: 0;
    border: 2px solid #e3262e !important;
    border-radius: 50%;
    background: #fff !important;
    color: #e3262e !important;
    font: 800 15px/1 Arial, sans-serif;
    cursor: pointer;
    box-shadow: none !important;
}

.jdm-context-help-button:hover {
    background: #fff3f3 !important;
}
