/* ===== Modal d'inscription - toutes les classes commencent par "dm-" (aucun conflit avec Bootstrap) ===== */

.dm-overlay {
    /* Les couleurs --dm-ink / --dm-sea / --dm-sun ne sont plus redéfinies ici :
       la fenêtre suit désormais le thème choisi (voir la fin de app-theme.css). */
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, .55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    font-family: "Segoe UI", system-ui, sans-serif;
    color: #1c2330;
    line-height: 1.4;
}

    .dm-overlay *, .dm-overlay *::before, .dm-overlay *::after {
        box-sizing: border-box;
    }

    .dm-overlay.dm-open {
        display: flex;
    }

.dm-modal {
    position: relative;
    display: flex;
    gap: 24px;
    width: 100%;
    max-width: 1140px;
    max-height: 96vh;
    overflow: auto;
    background: #fff;
    border-radius: 22px;
    padding: 16px;
    box-shadow: 0 30px 80px rgba(16, 35, 63, .45);
    animation: dm-pop .25s ease-out;
}

@keyframes dm-pop {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.98);
    }
}

@media (prefers-reduced-motion: reduce) {
    .dm-modal {
        animation: none;
    }
}

.dm-close {
    position: absolute;
    top: 14px;
    right: 18px;
    z-index: 3;
    background: none;
    border: 0;
    font-size: 26px;
    line-height: 1;
    color: #667;
    cursor: pointer;
}

    .dm-close:hover {
        color: #000;
    }

/* ----- Panneau gauche ----- */
.dm-side {
    position: relative;
    overflow: hidden;
    flex: 0 0 38%;
    min-height: 420px;
    border-radius: 14px;
    background: linear-gradient(160deg, #10233f 0%, #0c4a5c 60%, #0f8b8d 130%);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 48px;
}

    .dm-side::before, .dm-side::after {
        content: "";
        position: absolute;
        border-radius: 50%;
        pointer-events: none;
    }

    .dm-side::before {
        width: 320px;
        height: 320px;
        right: -120px;
        top: -110px;
        background: radial-gradient(circle, rgba(255, 138, 91, .55), rgba(255, 138, 91, 0) 70%);
    }

    .dm-side::after {
        width: 380px;
        height: 380px;
        left: -160px;
        bottom: -170px;
        background: radial-gradient(circle, rgba(15, 139, 141, .7), rgba(15, 139, 141, 0) 70%);
    }

    .dm-side > * {
        position: relative;
        z-index: 1;
    }

    .dm-side h3 {
        margin: 0 0 22px;
        /* Cambria : chiffres de la même hauteur que les majuscules (Georgia a des chiffres « elzéviriens », plus petits) */
        font-family: Cambria, "Times New Roman", serif;
        font-variant-numeric: lining-nums;
        font-size: 26px;
        font-weight: 400;
        line-height: 1.25;
        color: #fff;
    }

    .dm-side ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .dm-side li {
        display: flex;
        gap: 12px;
        align-items: center;
        margin-bottom: 14px;
        font-size: 16px;
    }

        .dm-side li::before {
            content: "\2713";
            flex: none;
            width: 24px;
            height: 24px;
            border-radius: 50%;
            display: grid;
            place-items: center;
            font-size: 13px;
            font-weight: 700;
            background: var(--dm-sun);
            color: var(--dm-ink);
        }

/* ----- Panneau gauche enrichi : badge, points avec icône, pied ----- */
.dm-side-badge {
    align-self: flex-start;
    margin: 0 0 14px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--dm-ink, #10233f);
    background: var(--dm-sun, #ff8a5b);
}

.dm-side #dmSideRegister, .dm-side #dmSideLogin {
    display: flex;
    flex-direction: column;
}

.dm-side #dmSideRegister[hidden], .dm-side #dmSideLogin[hidden] {
    display: none;
}

.dm-side .dm-side-points li {
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
}

    .dm-side .dm-side-points li::before {
        content: none;
    }

.dm-side-ico {
    flex: none;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .18);
}

    .dm-side-ico svg {
        width: 20px;
        height: 20px;
        fill: none;
        stroke: #fff;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

.dm-side-points strong {
    display: block;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
}

.dm-side-points small {
    display: block;
    margin-top: 2px;
    font-size: 13.5px;
    line-height: 1.45;
    color: rgba(255, 255, 255, .78);
}

.dm-side-pied {
    margin: 8px 0 0;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, .18);
    font-size: 13px;
    color: rgba(255, 255, 255, .75);
}

/* ----- Formulaire ----- */
.dm-form {
    flex: 1;
    padding: 22px 26px 12px 8px;
}

.dm-title {
    margin: 0 0 26px;
    text-align: center;
    color: var(--dm-ink);
    /* Cambria : chiffres de la même hauteur que les majuscules (Georgia a des chiffres « elzéviriens », plus petits) */
    font-family: Cambria, "Times New Roman", serif;
    font-variant-numeric: lining-nums;
    font-size: 34px;
    font-weight: 400;
}

.dm-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 32px;
}

.dm-full {
    grid-column: 1 / -1;
}

/* Ligne Adresse (65 %) + Ville (35 %) : occupe toute la largeur du formulaire */
.dm-row-adresse {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 65fr 35fr;
    gap: 12px 32px;
}

/* Ligne « Adresse » : adresse un peu plus étroite, pour laisser de la place au code postal et à la ville */
.dm-row-adresse.dm-row-adresse-cp {
    grid-template-columns: 52fr 48fr;
}

/* Code postal (étroit) + ville, dans la colonne de droite de la ligne « Adresse » */
.dm-cp-ville {
    display: grid;
    grid-template-columns: minmax(84px, 2fr) 3fr;
    gap: 12px;
    min-width: 0;
}

    .dm-cp-ville > div {
        min-width: 0;
    }

.dm-label {
    display: block;
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 400;
}

    .dm-label b {
        color: #e5262b;
        font-weight: 400;
    }

.dm-input {
    display: block;
    width: 100%;
    height: 36px;
    padding: 0 14px;
    font-size: 16px;
    font-family: inherit;
    color: #1c2330;
    background: #f5f7fa;
    border: 1px solid #d4dae3;
    border-radius: 8px;
    transition: border-color .15s, box-shadow .15s;
}

    .dm-input:focus {
        outline: none;
        border-color: var(--dm-sea);
        box-shadow: 0 0 0 3px rgba(15, 139, 141, .2);
        background: #fff;
    }

.dm-legal {
    margin: 14px 0 0;
    font-size: 14px;
    line-height: 1.5;
}

    .dm-legal a {
        color: inherit;
    }

/* ----- Boutons ----- */
.dm-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.dm-submit {
    min-width: 260px;
    padding: 14px 28px;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--dm-sea), #0c6e8a);
    box-shadow: 0 8px 20px rgba(15, 139, 141, .35);
    transition: transform .15s, box-shadow .15s;
}

    .dm-submit:hover {
        background: linear-gradient(135deg, #12a0a2, #0c6e8a);
        transform: translateY(-2px);
        box-shadow: 0 12px 26px rgba(15, 139, 141, .4);
    }

    .dm-submit:disabled {
        opacity: .6;
        cursor: wait;
        transform: none;
    }

.dm-sep {
    width: 260px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #8a94a6;
    font-size: 13px;
}

    .dm-sep::before, .dm-sep::after {
        content: "";
        flex: 1;
        height: 1px;
        background: #dfe4ec;
    }

.dm-login {
    min-width: 260px;
    padding: 12px 24px;
    border-radius: 999px;
    cursor: pointer;
    background: #fff;
    color: var(--dm-ink);
    font-size: 15px;
    border: 2px solid var(--dm-sun);
    transition: background .15s;
}

    .dm-login u {
        text-decoration-color: var(--dm-sun);
        text-underline-offset: 3px;
        font-weight: 700;
    }

    .dm-login:hover {
        background: #fff3ed;
    }

    .dm-login:focus-visible, .dm-submit:focus-visible {
        outline: 3px solid var(--dm-ink);
        outline-offset: 3px;
    }

.dm-msg {
    min-height: 20px;
    margin: 0;
    font-size: 14px;
    text-align: center;
    font-weight:bold;
}

    .dm-msg.dm-error {
        color: #c62828;
    }

    .dm-msg.dm-ok {
        color: #1b7f4b;
    }

/* ----- Liste Pays avec drapeaux ----- */
.dm-cs {
    position: relative;
}

.dm-cs-btn {
    width: 100%;
    height: 36px;
    padding: 0 38px 0 14px;
    text-align: left;
    cursor: pointer;
    font-size: 16px;
    font-family: inherit;
    color: #1c2330;
    background: #f5f7fa;
    border: 1px solid #d4dae3;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    transition: border-color .15s, box-shadow .15s;
}

    .dm-cs-btn::after {
        content: "";
        position: absolute;
        right: 14px;
        top: 50%;
        width: 7px;
        height: 7px;
        border-right: 2px solid #667;
        border-bottom: 2px solid #667;
        transform: translateY(-70%) rotate(45deg);
        transition: transform .15s;
    }

    .dm-cs-btn[aria-expanded="true"]::after {
        transform: translateY(-30%) rotate(-135deg);
    }

    .dm-cs-btn:focus-visible, .dm-cs-btn[aria-expanded="true"] {
        outline: none;
        border-color: var(--dm-sea);
        box-shadow: 0 0 0 3px rgba(15, 139, 141, .2);
        background: #fff;
    }

    .dm-cs-btn.dm-invalid {
        border-color: #e5262b;
        box-shadow: 0 0 0 3px rgba(229, 38, 43, .15);
    }

.dm-input.dm-invalid {
    border-color: #e5262b;
    box-shadow: 0 0 0 3px rgba(229, 38, 43, .15);
}

.dm-placeholder {
    color: #8a94a6;
}

.dm-flag {
    width: 24px;
    height: 18px;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .15);
    flex: none;
}

.dm-cs-list {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    margin: 0;
    padding: 6px;
    list-style: none;
    max-height: 240px;
    overflow: auto;
    background: #fff;
    border: 1px solid #d4dae3;
    border-radius: 10px;
    box-shadow: 0 14px 32px rgba(16, 35, 63, .22);
    display: none;
}

    .dm-cs-list.dm-open {
        display: block;
    }

    .dm-cs-list li {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 9px 10px;
        border-radius: 7px;
        cursor: pointer;
        font-size: 15px;
    }

        .dm-cs-list li:hover {
            background: #e8f5f5;
        }

        .dm-cs-list li[aria-selected="true"] {
            font-weight: 700;
            background: #e8f5f5;
        }

/* ----- Indicatif téléphonique (drapeau + code pays) ----- */
.dm-tel {
    position: relative;
}

.dm-tel-prefix {
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 8px 0 6px;
    border-radius: 6px;
    background: #eef2f5;
    font-size: 14px;
    color: #5a6a7a;
    pointer-events: none;
}

    .dm-tel-prefix .dm-flag {
        width: 18px;
        height: 13px;
    }

/* Place réservée à l'indicatif (drapeau + « +213 ») : sélecteur plus précis que .dm-input (padding 0 14px) */
.dm-tel .dm-tel-input {
    padding-left: 90px;
}

@media (max-width: 820px) {
    .dm-modal {
        flex-direction: column;
    }

    .dm-side {
        flex-basis: auto;
        min-height: 0;
        padding: 24px;
    }

    /* Petit écran : le panneau gauche reste court (titre et points sans détail) */
    .dm-side h3 {
        margin-bottom: 14px;
        font-size: 22px;
    }

    .dm-side-points small,
    .dm-side-pied {
        display: none;
    }

    .dm-side .dm-side-points li {
        align-items: center;
        margin-bottom: 10px;
    }

    .dm-side-ico {
        width: 32px;
        height: 32px;
    }

    .dm-grid,
    .dm-row-adresse,
    .dm-row-adresse.dm-row-adresse-cp {
        grid-template-columns: 1fr;
    }

    .dm-form {
        padding: 8px;
    }
}

/* ===== Bascule Enregistrement / Connexion ===== */
.dm-overlay [hidden] {
    display: none !important;
}

.dm-form {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.dm-view {
    animation: dm-fade .3s ease-out;
}

@keyframes dm-fade {
    from {
        opacity: 0;
        transform: translateX(14px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .dm-view {
        animation: none;
    }
}

.dm-narrow {
    max-width: 420px;
    margin: 0 auto;
}

.dm-field {
    margin-bottom: 20px;
}

.dm-pwd {
    position: relative;
}

    /* Place pour l'icône œil (tous les champs mot de passe : wwwroot/js/dm-motdepasse.js) */
    .dm-pwd .dm-input,
    .dm-pwd input {
        padding-right: 44px;
    }

.dm-eye {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: none;
    cursor: pointer;
    padding: 2px;
    line-height: 0;
    opacity: .8;
}

    .dm-eye:hover,
    .dm-eye:focus-visible {
        opacity: 1;
    }

    .dm-eye img {
        width: 24px;
        height: 24px;
    }

.dm-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 14px;
}

.dm-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    cursor: pointer;
}

    .dm-check input {
        width: 16px;
        height: 16px;
        accent-color: var(--dm-sea);
    }

.dm-link {
    color: var(--dm-sea);
    font-weight: 600;
    text-decoration: none;
}

    .dm-link:hover {
        text-decoration: underline;
    }

/* ===== Connexion en 2 étapes ===== */
.dm-steps {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: -8px 0 26px;
    padding: 0;
    list-style: none;
    font-size: 14px;
    color: #8a94a6;
}

.dm-step {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .dm-step span {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        display: grid;
        place-items: center;
        font-size: 13px;
        font-weight: 700;
        background: #e6eaf0;
        color: #667;
    }

    .dm-step + .dm-step::before {
        content: "";
        width: 34px;
        height: 2px;
        background: #dfe4ec;
        margin-right: 2px;
    }

    .dm-step.dm-current {
        color: var(--dm-ink);
        font-weight: 600;
    }

        .dm-step.dm-current span {
            background: var(--dm-sea);
            color: #fff;
        }

    .dm-step.dm-done span {
        background: var(--dm-sun);
        color: var(--dm-ink);
    }

    .dm-step.dm-done {
        color: var(--dm-ink);
    }

.dm-recap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #e8f5f5;
}

.dm-recap-ico {
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--dm-sea);
    color: #fff;
    font-size: 14px;
}

.dm-recap div {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.dm-recap small {
    font-size: 12px;
    color: #5a6a7a;
}

.dm-recap strong {
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dm-linkbtn {
    background: none;
    border: 0;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
}

.dm-hr {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0;
    color: #8a94a6;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

    .dm-hr::before, .dm-hr::after {
        content: "";
        flex: 1;
        height: 1px;
        background: #dfe4ec;
    }

/* ----- Écran de confirmation après enregistrement ----- */
.dm-success {
    text-align: center;
    padding: 20px 10px;
}

.dm-success-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 26px;
    background: #e8f5f5;
    color: var(--dm-sea);
}

.dm-success h3 {
    margin: 0 0 10px;
    /* Cambria : chiffres de la même hauteur que les majuscules (Georgia a des chiffres « elzéviriens », plus petits) */
    font-family: Cambria, "Times New Roman", serif;
    font-variant-numeric: lining-nums;
    font-weight: 400;
    font-size: 24px;
    color: var(--dm-ink);
}

.dm-success p {
    margin: 0 0 24px;
    color: #5a6a7a;
    line-height: 1.6;
}

.dm-success .dm-submit {
    min-width: 200px;
}

/* ===== Couleurs disponibles partout sur le site (pas seulement dans la fenêtre) ===== */
:root {
    --dm-ink: #10233f;
    --dm-sea: #0f8b8d;
    --dm-sun: #ff8a5b;
}

/* ===== Boutons "pilule" au même style que la fenêtre, pour la barre de navigation ===== */
.dm-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 18px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: 2px solid transparent;
    white-space: nowrap;
    transition: transform .15s, box-shadow .15s, background .15s;
}

.dm-nav-btn-primary {
    background: linear-gradient(135deg, var(--dm-sea), #0c6e8a);
    color: #fff;
    box-shadow: 0 4px 10px rgba(15, 139, 141, .3);
}

    .dm-nav-btn-primary:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 14px rgba(15, 139, 141, .35);
    }

.dm-nav-btn-outline {
    background: #fff;
    color: var(--dm-ink);
    border-color: var(--dm-sun);
}

    .dm-nav-btn-outline:hover {
        background: #fff3ed;
    }

.dm-nav-btn:focus-visible {
    outline: 3px solid var(--dm-ink);
    outline-offset: 2px;
}

/* ===== Enregistrement en 3 pages (Établissement / Exercice / Accès) ===== */
.dm-page {
    animation: dm-fade .25s ease-out;
}

/* Petite phrase d'explication en haut d'une page ou d'une section */
.dm-intro {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #5b6576;
}

/* Les séparateurs « Établissement » / « Administrateur » de la page 3 : moins d'espace */
.dm-page .dm-hr {
    margin: 6px 0 0;
}

/* Rangée de boutons Précédent / Suivant / Enregistrer */
.dm-wizard-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

    .dm-wizard-nav .dm-submit,
    .dm-wizard-nav .dm-login {
        min-width: 180px;
    }

/* La liste Civilité garde la même allure que les autres champs */
select.dm-input {
    cursor: pointer;
}
