.mpms-wrap {
    --ok: #1e8e3e;
    --ok-bg: #e6f4ea;
    --pending: #d93025;
    --pending-bg: #fce8e6;
    --cancel: #5f6368;
    --cancel-bg: #f1f3f4;
    --preinscript:#1a56db;
    --preinscript-bg:#BFD1F8;
    --primary: #1a56db;
    --border: #e3e6ea;
    --radius: 12px;

    max-width: 900px;
    margin: 0 auto;
    font-size: 15px;
    line-height: 1.5;
    color: #202124;
}

/* Légende */
.mpms-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.mpms-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}
.mpms-badge--ok      { background: var(--ok-bg);      color: var(--ok); }
.mpms-badge--pending { background: var(--pending-bg); color: var(--pending); }
.mpms-badge--cancel  { background: var(--cancel-bg);  color: var(--cancel); }
.mpms-badge--preinscript { background: var(--preinscript-bg);      color: var(--preinscript); }

/* Carte concours */
.mpms-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
    margin-bottom: 24px;
    overflow: hidden;
}

.mpms-card__header {
    background: linear-gradient(135deg, #1a56db, #3b82f6);
    color: #fff;
    padding: 16px 20px;
}

.mpms-card__title {
    margin: 0 0 4px;
    font-size: 1.2em;
    color: #fff;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.mpms-card__type {
    background: rgba(255, 255, 255, .2);
    padding: 2px 10px;
    border-radius: 999px;
    font-size: .75em;
    font-weight: 500;
    font-style: italic;
}

.mpms-card__date {
    font-size: .9em;
    opacity: .95;
}

.mpms-card__body {
    padding: 8px 20px;
}

/* Départs */
.mpms-depart {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px dashed var(--border);
}
.mpms-depart:last-child { border-bottom: 0; }

.mpms-depart__info {
    display: flex;
    flex-direction: column;
}
.mpms-depart__time {
    color: #5f6368;
    font-size: .9em;
}

/* Archers */
.mpms-archers {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mpms-archer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    padding: 8px 12px;
    border-radius: 8px;
    border-left: 4px solid;
}
.mpms-archer--ok      { background: var(--ok-bg);      border-color: var(--ok);      color: var(--ok); }
.mpms-archer--pending { background: var(--pending-bg); border-color: var(--pending); color: var(--pending); }
.mpms-archer--cancel  { background: var(--cancel-bg);  border-color: var(--cancel);  color: var(--cancel); text-decoration: line-through; }
.mpms-archer--preinscript { background: var(--preinscript-bg);      border-color: var(--preinscript);      color: var(--preinscript); }


.mpms-archer__name { font-weight: 600; }

.mpms-archer__cat {
    background: rgba(255, 255, 255, .8);
    padding: 1px 8px;
    border-radius: 6px;
    font-size: .8em;
    font-weight: 700;
}

.mpms-archer__comment {
    flex-basis: 100%;
    opacity: .85;
    text-decoration: none;
}

/* Remarque */
.mpms-card__footer {
    background: #fff8e1;
    border-top: 1px solid #ffe082;
    padding: 12px 20px;
    font-size: .9em;
}

/* Mobile */
@media (max-width: 640px) {
    .mpms-wrap { font-size: 14px; }

    .mpms-card__header,
    .mpms-card__body,
    .mpms-card__footer { padding-left: 14px; padding-right: 14px; }

    .mpms-depart {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .mpms-depart__info {
        flex-direction: row;
        justify-content: space-between;
        align-items: baseline;
    }
}

/* ===== Page de sélection ===== */
.mpms-title {
    margin: 0 0 16px;
    font-size: 1.25em;
}

.mpms-empty {
    padding: 20px;
    text-align: center;
    background: #fff;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: #5f6368;
}

.mpms-choices {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mpms-choice {
    position: relative;
}

/* Radio masqué visuellement mais accessible au clavier */
.mpms-choice__input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.mpms-choice__card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    background: #fff;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background .15s;
}

.mpms-choice__card:hover {
    border-color: #9aa0a6;
    box-shadow: 0 3px 8px rgba(0, 0, 0, .1);
}

/* Pastille radio personnalisée */
.mpms-choice__check {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    margin-top: 2px;
    border: 2px solid #9aa0a6;
    border-radius: 50%;
    background: #fff;
    position: relative;
    transition: border-color .15s, background .15s;
}
.mpms-choice__check::after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: var(--ok);
    transform: scale(0);
    transition: transform .15s;
}

/* État sélectionné */
.mpms-choice__input:checked + .mpms-choice__card {
    border-color: var(--ok);
    background: var(--ok-bg);
    box-shadow: 0 3px 10px rgba(30, 142, 62, .2);
}
.mpms-choice__input:checked + .mpms-choice__card .mpms-choice__check {
    border-color: var(--ok);
}
.mpms-choice__input:checked + .mpms-choice__card .mpms-choice__check::after {
    transform: scale(1);
}

/* Focus clavier */
.mpms-choice__input:focus-visible + .mpms-choice__card {
    outline: 3px solid rgba(26, 115, 232, .5);
    outline-offset: 2px;
}

/* Contenu de la carte */
.mpms-choice__content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.mpms-choice__title {
    font-size: 1.05em;
    font-weight: 700;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
}
.mpms-choice__date {
    font-size: .9em;
    color: #1a73e8;
}
.mpms-choice__note {
    font-size: .88em;
    padding: 8px 10px;
    background: #fff8e1;
    border-left: 3px solid #ffc107;
    border-radius: 6px;
    color: #444;
}

/* Bouton */
.mpms-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
}
.mpms-btn {
    appearance: none;
    border: 0;
    padding: 12px 28px;
    font-size: 1em;
    font-weight: 600;
    color: #fff;
    background: #1a73e8;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(26, 115, 232, .35);
    transition: background .15s, transform .05s;
}
.mpms-btn:hover  { background: #1557b0; }
.mpms-btn:active { transform: translateY(1px); }
.mpms-btn:focus-visible {
    outline: 3px solid rgba(26, 115, 232, .5);
    outline-offset: 2px;
}

/* Mobile */
@media (max-width: 640px) {
    .mpms-choice__card { padding: 14px; gap: 12px; }
    .mpms-actions { justify-content: stretch; }
    .mpms-btn { width: 100%; padding: 14px; }
}

/* Carte = bouton de soumission */
.mpms-choice__card {
    appearance: none;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    text-align: left;
    font: inherit;
    color: inherit;
    background: #fff;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background .15s, transform .05s;
}

.mpms-choice__card:hover {
    border-color: var(--ok);
    background: var(--ok-bg);
    box-shadow: 0 3px 10px rgba(30, 142, 62, .2);
}

.mpms-choice__card:active {
    transform: translateY(1px);
}

.mpms-choice__card:focus-visible {
    outline: 3px solid rgba(26, 115, 232, .5);
    outline-offset: 2px;
} 

/* Flèche indiquant que la carte est cliquable */
.mpms-choice__arrow {
    flex: 0 0 auto;
    font-size: 2em;
    line-height: 1;
    color: #9aa0a6;
    transition: transform .15s, color .15s;
}
.mpms-choice__card:hover .mpms-choice__arrow {
    color: var(--ok);
    transform: translateX(4px);
}










:root {
    --ok: #1e8e3e;
    --ok-bg: #e6f4ea;
    --wait: #d93025;
    --wait-bg: #fce8e6;
    --cancel: #202124;
    --cancel-bg: #f1f3f4;
    --border: #dadce0;
    --radius: 12px;
    --primary: #1a73e8;
}

.mpms-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 12px;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: #202124;
    line-height: 1.4;
}

.mpms-title {
    margin: 0 0 18px;
    font-size: 1.4em;
}

[x-cloak] { display: none !important; }

/* ---------- Alerte globale ---------- */
.mpms-alert {
    padding: 12px 16px;
    margin-bottom: 18px;
    border-radius: 8px;
    font-weight: 500;
}
.mpms-alert-error {
    background: var(--wait-bg);
    color: var(--wait);
    border: 1px solid var(--wait);
}

/* ---------- Sections (cartes) ---------- */
.mpms-section {
    margin: 0 0 24px;
    padding: 0 18px 18px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
    min-width: 0;
}
.mpms-section legend {
    padding: 6px 14px;
    font-size: 1.05em;
    font-weight: 700;
    color: #fff;
    background: var(--primary);
    border-radius: 999px;
}

/* ---------- Tableaux ---------- */
.mpms-table-wrapper {
    overflow-x: auto;
    margin-top: 12px;
}
.mpms-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .95em;
}
.mpms-table th {
    padding: 10px 12px;
    text-align: left;
    font-size: .8em;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #5f6368;
    background: #f8f9fa;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
.mpms-table th:first-child { border-top-left-radius: 8px; }
.mpms-table th:last-child  { border-top-right-radius: 8px; }
.mpms-table td {
    padding: 10px 12px;
    vertical-align: top;
    border-bottom: 1px solid #eceff1;
}
.mpms-table tbody tr:hover td { background: #fafbfc; }
.mpms-table tbody tr:last-child td { border-bottom: 0; }

.mpms-cell-name { font-weight: 600; white-space: nowrap; }
.mpms-cell-comment { color: #5f6368; font-size: .9em; }

/* ---------- Champs ---------- */
.mpms-table input[type="text"],
.mpms-table input[type="date"],
.mpms-table input[type="time"],
.mpms-table select {
    width: 100%;
    box-sizing: border-box;
    min-height: 40px;
    padding: 8px 10px;
    font: inherit;
    color: inherit;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color .15s, box-shadow .15s;
}
.mpms-table input:focus,
.mpms-table select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, .25);
}

/* Champ en erreur (si votre JS ajoute .is-invalid / aria-invalid) */
.mpms-table input.is-invalid,
.mpms-table input[aria-invalid="true"],
.mpms-table select.is-invalid {
    border-color: var(--wait);
    background: var(--wait-bg);
}
.mpms-error-msg {
    display: block;
    margin-top: 4px;
    font-size: .8em;
    color: var(--wait);
}

/* ---------- Badges ---------- */
.mpms-badge,
.mpms-badge-depart {
    display: inline-block;
    padding: 4px 10px;
    font-size: .85em;
    font-weight: 600;
    border-radius: 999px;
    white-space: nowrap;
}
.mpms-badge-cat {
    color: #3c4043;
    background: #e8eaed;
}
.mpms-badge-depart {
    color: var(--primary);
    background: #e8f0fe;
}
.mpms-badge-empty {
    color: #5f6368;
    background: var(--cancel-bg);
}

/* ---------- Select d'état coloré (mêmes codes couleur que l'affichage) ---------- */
.mpms-select-etat { font-weight: 600; }
.mpms-table select.mpms-etat-inscript { color: var(--ok);     background: var(--ok-bg);     border-color: var(--ok); }
.mpms-table select.mpms-etat-demande  { color: var(--wait);   background: var(--wait-bg);   border-color: var(--wait); }
.mpms-table select.mpms-etat-annuler  { color: var(--cancel); background: var(--cancel-bg); border-color: var(--cancel); }
.mpms-table select.mpms-etat-preinscript  { color: var(--wait);   background: var(--cancel-bg);   border-color: var(--wait); }

/* ---------- Bouton ---------- */
.mpms-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}
.mpms-btn-submit {
    appearance: none;
    border: 0;
    padding: 12px 32px;
    font-size: 1em;
    font-weight: 600;
    color: #fff;
    background: var(--primary);
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(26, 115, 232, .35);
    transition: background .15s, transform .05s;
}
.mpms-btn-submit:hover:not(:disabled)  { background: #1557b0; }
.mpms-btn-submit:active:not(:disabled) { transform: translateY(1px); }
.mpms-btn-submit:disabled { opacity: .6; cursor: not-allowed; }
.mpms-btn-submit:focus-visible {
    outline: 3px solid rgba(26, 115, 232, .5);
    outline-offset: 2px;
}

/* ============================================ */
/* MOBILE : chaque ligne devient une carte       */
/* ============================================ */
@media (max-width: 760px) {

    .mpms-section { padding: 0 12px 12px; }

    .mpms-table-wrapper { overflow-x: visible; }

    .mpms-table,
    .mpms-table tbody,
    .mpms-table tr,
    .mpms-table td {
        display: block;
        width: 100%;
    }

    .mpms-table thead {
        /* masqué visuellement mais conservé pour les lecteurs d'écran */
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .mpms-table tr {
        margin-bottom: 14px;
        padding: 6px 12px;
        background: #fff;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
    }
    .mpms-table tbody tr:hover td { background: transparent; }

    .mpms-table td {
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding: 8px 0;
        border-bottom: 1px dashed #eceff1;
    }
    .mpms-table td:last-child { border-bottom: 0; }

    /* Libellé du champ affiché au-dessus de la valeur */
    .mpms-table td::before {
        content: attr(data-label);
        font-size: .75em;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .04em;
        color: #5f6368;
    }

    /* Le nom de l'archer sert de titre de carte */
    .mpms-cell-name {
        font-size: 1.05em;
        white-space: normal;
        border-bottom: 2px solid var(--border) !important;
    }
    .mpms-cell-name::before { display: none; }

    /* Badges : ne pas étirer sur toute la largeur */
    .mpms-badge,
    .mpms-badge-depart { align-self: flex-start; }

    /* Bouton pleine largeur */
    .mpms-actions { justify-content: stretch; }
    .mpms-btn-submit { width: 100%; padding: 14px; }

    /* Champs plus grands pour le tactile (évite aussi le zoom auto iOS) */
    .mpms-table input[type="text"],
    .mpms-table input[type="date"],
    .mpms-table input[type="time"],
    .mpms-table select {
        min-height: 44px;
        font-size: 16px;
    }
}