/* =====================================================
   MODALE 1 : "Votre présentation" (formulaire complet)
   Classes préfixées "dp-" — scopées sous .dp-modal
   ===================================================== */

.dp-modal {
    width: 100%;
    max-width: 980px;
    max-height: 94vh;
    background: #fff;
    border-radius: 22px;
    overflow: hidden;
    display: flex;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}

/* Overlay qui centre le modal en superposition */
.dp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 40, 90, 0.55);
    display: none;
    /* passer à "flex" en JS pour ouvrir */
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

/* ---------- Panneau gauche ---------- */
.dp-modal .dp-left {
    flex: 0 0 310px;
    background: linear-gradient(180deg, #eaf3ff 0%, #cfe4ff 100%);
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.dp-modal .dp-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 28px;
}

.dp-modal .dp-logo-image {
    display: block;
    width: 164px;
    height: auto;
    max-width: 100%;
}

.dp-modal .dp-left h1 {
    font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
    color: #062f8a;
    font-size: 24px;
    line-height: 1.25;
    font-weight: 700;
    margin-bottom: 16px;
}

.dp-modal .dp-left p {
    color: #2c63c8;
    font-size: 13.5px;
    line-height: 1.6;
    margin-bottom: 28px;
}

.dp-modal .dp-photo-block {
    margin-top: auto;
    display: flex;
    align-items: flex-end;
    gap: 14px;
}

.dp-modal .dp-photo-wrap-outer {
    position: relative;
    flex: 0 0 auto;
    width: 220px;
    height: 220px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.dp-modal .dp-blob {
    position: absolute;
    left: 10px;
    bottom: -8px;
    width: 200px;
    height: 180px;
    background: #cfe0fb;
    border-radius: 58% 42% 55% 45% / 55% 48% 52% 45%;
    z-index: 0;
}

.dp-modal .dp-doctor {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    overflow: hidden;
    background: #dcebff;
    position: relative;
    z-index: 1;
    box-shadow: 0 12px 28px rgba(22, 119, 255, 0.18);
}

.dp-modal .dp-doctor img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.dp-modal .dp-tag {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 24px;
    line-height: 1.15;
    color: #1677ff;
    margin-bottom: 18px;
}

.dp-modal .dp-tag-underline {
    display: block;
    width: 92px;
    height: 4px;
    background: #1677ff;
    border-radius: 3px;
    margin-top: 4px;
}

/* ---------- Panneau droit ---------- */
.dp-modal .dp-right {
    flex: 1 1 auto;
    padding: 30px 34px 24px;
    overflow-y: auto;
    position: relative;
}

.dp-modal .dp-close {
    position: absolute;
    top: 22px;
    right: 26px;
    background: none;
    border: none;
    font-size: 22px;
    color: #0d3b8f;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    z-index: 10;
}

.dp-modal .dp-close:hover {
    opacity: .7;
}

.dp-modal h2 {
    font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
    color: #0d3b8f;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 22px;
}

.dp-modal .dp-form-alert {
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.45;
}

.dp-modal .dp-form-alert--success {
    background: #ecfdf3;
    border: 1px solid #a7f3d0;
    color: #047857;
}

.dp-modal .dp-form-alert--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.presentation-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    z-index: 10002;
    width: min(calc(100% - 32px), 460px);
    padding: 14px 18px;
    border-radius: 14px;
    box-shadow: 0 14px 35px rgba(0, 24, 72, 0.2);
    font-size: 14px;
    line-height: 1.45;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -16px);
    transition: opacity .2s ease, transform .2s ease;
}

.presentation-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.presentation-toast--success {
    border: 1px solid #a7f3d0;
    background: #ecfdf3;
    color: #047857;
}

.presentation-toast--error {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.dp-modal .dp-upload-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.dp-modal .dp-upload-btn {
    position: relative;
    width: 56px;
    height: 56px;
    padding: 0;
    overflow: hidden;
    border-radius: 50%;
    background: #eaf3ff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: 0 0 auto;
}

.dp-modal .dp-upload-btn svg {
    width: 24px;
    height: 24px;
}

.dp-modal .dp-upload-title {
    font-weight: 700;
    font-size: 14.5px;
    color: #0d3b8f;
    margin: 0 0 2px;
}

.dp-modal .dp-upload-sub {
    font-size: 12.5px;
    color: #6b87b3;
    margin: 0;
    line-height: 1.4;
}

.dp-modal .dp-upload-filename {
    margin-top: 5px;
    color: #0d3b8f;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.dp-modal .dp-upload-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

.dp-modal .dp-upload-preview[hidden] {
    display: none;
}

.dp-modal .dp-upload-btn.has-photo > svg {
    visibility: hidden;
}

.dp-modal label {
    display: block;
    color: #1660d1;
    font-weight: 700;
    font-size: 13.5px;
    margin-bottom: 6px;
}

.dp-modal .dp-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 0 0 6px;
}

.dp-modal .dp-label-row label {
    margin: 0;
}

.dp-modal .dp-counter {
    font-weight: 400;
    font-size: 12px;
    color: #8ba3c9;
}

.dp-modal .dp-section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 14.5px;
    color: #0d3b8f;
    margin: 4px 0 12px;
}

.dp-modal .dp-section-label svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.dp-modal input,
.dp-modal textarea,
.dp-modal select {
    width: 100%;
    border: 1.5px solid #d7e7ff;
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 13.5px;
    font-family: inherit;
    color: #0d3b8f;
    background: #fff;
    outline: none;
}

.dp-modal input::placeholder,
.dp-modal textarea::placeholder {
    color: #a9bcd9;
}

.dp-modal input:focus,
.dp-modal textarea:focus,
.dp-modal select:focus {
    border-color: #1677ff;
}

.dp-modal textarea {
    height: 52px;
    resize: vertical;
}

.dp-modal select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230d3b8f' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    color: #a9bcd9;
}

.dp-modal .dp-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.dp-modal .dp-field {
    margin-bottom: 18px;
}

.dp-modal .dp-input-icon-wrap {
    position: relative;
}

.dp-modal .dp-input-icon-wrap input {
    padding-left: 42px;
}

.dp-modal .dp-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dp-modal .dp-input-icon.dp-linkedin {
    background: #0a66c2;
    border-radius: 4px;
}

.dp-modal .dp-input-icon.dp-linkedin svg {
    width: 13px;
    height: 13px;
}

.dp-modal .dp-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 6px 0 22px;
}

.dp-modal .dp-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    accent-color: #1677ff;
    flex: 0 0 auto;
    cursor: pointer;
}

.dp-modal .dp-checkbox label {
    font-weight: 400;
    font-size: 12.5px;
    line-height: 1.5;
    color: #4a6693;
    cursor: pointer;
    margin: 0;
}

.dp-modal .dp-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 22px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.dp-modal .dp-btn {
    border-radius: 30px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.dp-modal .dp-link-btn {
    background: none;
    border: none;
    color: #4a6693;
    padding: 8px 4px;
    font-size: 13.5px;
}

.dp-modal .dp-link-btn:hover {
    color: #0d3b8f;
}

.dp-modal .dp-primary {
    background: #1677ff;
    color: #fff;
    border: none;
    padding: 13px 28px;
}

.dp-modal .dp-primary:hover {
    background: #0f5ae0;
}

/* ---------- Responsive ---------- */
@media (max-width: 800px) {
    .dp-modal {
        flex-direction: column;
        width: min(100%, 560px);
        max-height: 96vh;
        overflow-y: auto;
    }

    .dp-modal .dp-close {
        position: fixed;
        top: max(12px, env(safe-area-inset-top));
        right: max(12px, env(safe-area-inset-right));
    }

    .dp-modal .dp-left {
        flex: 0 0 auto;
        flex-direction: column;
        align-items: stretch;
        padding: 22px 20px 18px;
        gap: 12px;
        overflow: visible;
    }

    .dp-modal .dp-left-text {
        flex: 0 0 auto;
        min-width: 0;
        width: 100%;
    }

    .dp-modal .dp-logo {
        margin-bottom: 8px;
        justify-content: flex-start;
    }

    .dp-modal .dp-logo-image {
        width: 118px;
    }

    .dp-modal .dp-left h1 {
        font-size: 16px;
        margin-bottom: 6px;
    }

    .dp-modal .dp-left p {
        font-size: 11.5px;
        margin-bottom: 0;
    }

    .dp-modal .dp-photo-block {
        margin-top: 0;
        flex: 0 0 auto;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        align-self: center;
    }

    .dp-modal .dp-photo-wrap-outer {
        width: 132px;
        height: 132px;
    }

    .dp-modal .dp-doctor {
        width: 112px;
        height: 112px;
    }

    .dp-modal .dp-blob {
        width: 124px;
        height: 112px;
        left: 4px;
        bottom: -6px;
    }

    .dp-modal .dp-tag {
        font-size: 13px;
        margin-bottom: 0;
        text-align: center;
    }

    .dp-modal .dp-tag-underline {
        width: 46px;
        height: 2.5px;
        margin: 2px auto 0;
    }

    .dp-modal .dp-right {
        padding: 22px 20px 20px;
        overflow: visible;
    }
}

@media (max-width: 520px) {
    .dp-modal-overlay {
        align-items: flex-start;
        padding: 8px;
    }

    .dp-modal {
        border-radius: 16px;
    }

    .dp-modal .dp-left,
    .dp-modal .dp-right {
        padding-left: 16px;
        padding-right: 16px;
    }

    .dp-modal .dp-left h1 {
        font-size: 21px;
        line-height: 1.2;
    }

    .dp-modal .dp-left p {
        font-size: 13px;
        line-height: 1.5;
    }

    .dp-modal .dp-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .dp-modal h2 {
        font-size: 20px;
    }

    .dp-modal .dp-actions {
        justify-content: center;
    }

    .dp-modal .dp-primary,
    .dp-modal .dp-link-btn {
        flex: 1 1 auto;
        text-align: center;
    }
}


/* =====================================================
   MODALE 2 : "Complétez votre présentation"
   Utilisée par #cpmOverlay (normal) ET #cpmOverlayDraft
   (brouillon) — mêmes classes "cpm-", DÉFINIES UNE SEULE
   FOIS ICI pour éviter toute duplication/collision.
   ===================================================== */

.cpm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 40, 90, 0.55);
    backdrop-filter: blur(3px);
    display: none;
    /* passer à "flex" en JS pour ouvrir */
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
    font-family: 'Segoe UI', Arial, sans-serif;
    box-sizing: border-box;
    overflow-y: auto;
    /* permet de scroller plutôt que de couper le contenu */
}

.cpm-overlay * {
    box-sizing: border-box;
}

.cpm-card {
    background: linear-gradient(180deg, #ffffff 0%, #f3f9ff 100%);
    border-radius: 26px;
    width: 100%;
    max-width: 900px;
    max-height: 92vh;
    overflow-y: auto;
    /* jamais "hidden" : on scrolle, on ne coupe rien */
    padding: 40px 48px;
    position: relative;
    box-shadow: 0 24px 70px rgba(0, 0, 20, 0.3);
    display: flex;
    align-items: center;
    gap: 32px;
}

.cpm-close {
    position: absolute;
    top: 22px;
    right: 26px;
    background: none;
    border: none;
    font-size: 24px;
    color: #0b2f6b;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    z-index: 10;
}

.cpm-close:hover {
    opacity: 0.7;
}

.cpm-left {
    flex: 1 1 auto;
    min-width: 0;
}

.cpm-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 26px;
}

.cpm-logo-image {
    display: block;
    width: 190px;
    height: auto;
    max-width: 100%;
}

.cpm-top-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.cpm-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #dbe9fd;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.cpm-icon svg {
    width: 30px;
    height: 30px;
}

.cpm-headline {
    font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
    font-weight: 700;
    font-size: 25px;
    line-height: 1.28;
    color: #0b2f6b;
    margin: 2px 0 0;
}

.cpm-subheadline {
    font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
    font-weight: 700;
    font-size: 17px;
    line-height: 1.35;
    color: #1c6dfc;
    margin: 0 0 14px;
}

.cpm-desc {
    font-size: 14px;
    line-height: 1.6;
    color: #3a6ab8;
    margin: 0 0 26px;
}

.cpm-btn-group {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: min(100%, 320px);
}

.cpm-btn-group .cpm-btn,
.cpm-btn-group .cpm-btn-secondary {
    width: 100%;
    justify-content: center;
    text-align: center;
}

.cpm-btn {
    background: #1c6dfc;
    color: #ffffff;
    border: none;
    border-radius: 40px;
    padding: 16px 28px;
    font-size: 15.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    line-height: 1.2;
}

.cpm-btn svg {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
}

.cpm-btn:hover {
    background: #0f5ae0;
}

.cpm-btn-secondary {
    background: #ffffff;
    color: #1c6dfc;
    border: 2px solid #1c6dfc;
    border-radius: 40px;
    padding: 15px 28px;
    font-size: 15.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
}

.cpm-btn-secondary:hover {
    background: #eaf3ff;
}

.is-loading {
    position: relative;
    pointer-events: none;
    opacity: .78;
}

.is-loading::after {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 10px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    vertical-align: -2px;
    animation: presentation-button-spin .7s linear infinite;
}

@keyframes presentation-button-spin {
    to { transform: rotate(360deg); }
}

.cpm-right {
    flex: 0 0 260px;
    width: 260px;
    height: 260px;
    position: relative;
}

.cpm-blob {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border-radius: 50%;
    background: #cfe0fb;
}

.cpm-photo {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border-radius: 50%;
    overflow: hidden;
}

.cpm-photo img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    object-position: center top;
    /* garde le visage visible */
    border-radius: 50%;
    display: block;
}

.cpm-spark {
    position: absolute;
    width: 5px;
    height: 20px;
    border-radius: 4px;
    background: #1c6dfc;
}

.sp-a {
    top: 18px;
    left: 4px;
    transform: rotate(-25deg);
}

.sp-b {
    top: 34%;
    right: -6px;
    transform: rotate(-15deg);
}

.sp-c {
    bottom: 10%;
    right: 4px;
    transform: rotate(20deg);
}

.cpm-heart {
    position: absolute;
    top: 40%;
    right: -18px;
    width: 48px;
    height: 42px;
    background: #1c6dfc;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 21s-7.5-4.6-10-9.3C.4 8.4 2.1 5 5.6 5c2 0 3.4 1 4.4 2.4C11 6 12.4 5 14.4 5 17.9 5 19.6 8.4 22 11.7 19.5 16.4 12 21 12 21z'/></svg>") center/contain no-repeat;
    mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 21s-7.5-4.6-10-9.3C.4 8.4 2.1 5 5.6 5c2 0 3.4 1 4.4 2.4C11 6 12.4 5 14.4 5 17.9 5 19.6 8.4 22 11.7 19.5 16.4 12 21 12 21z'/></svg>") center/contain no-repeat;
}

.cpm-heart::after {
    content: "";
    position: absolute;
    left: 8%;
    right: 8%;
    top: 42%;
    height: 16%;
    background: #ffffff;
    clip-path: polygon(0% 50%, 20% 50%, 30% 10%, 42% 90%, 54% 30%, 64% 50%, 100% 50%, 100% 40%, 64% 40%, 54% 70%, 42% 0%, 30% 60%, 20% 40%, 0% 40%);
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
    .cpm-card {
        flex-direction: column-reverse;
        padding: 30px 24px;
        gap: 20px;
        text-align: center;
    }

    .cpm-close {
        position: fixed;
        top: max(12px, env(safe-area-inset-top));
        right: max(12px, env(safe-area-inset-right));
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: #eaf3ff;
    }

    .cpm-right {
        flex: 0 0 150px;
        width: 150px;
        height: 150px;
        margin: 0 auto;
    }

    .cpm-top-row {
        flex-direction: column;
        align-items: center;
    }

    .cpm-logo {
        justify-content: center;
    }

    .cpm-headline {
        font-size: 20px;
    }

    .cpm-subheadline {
        font-size: 14.5px;
    }

    .cpm-desc {
        font-size: 13px;
    }

    .cpm-btn-group {
        width: 100%;
    }

    .cpm-heart,
    .cpm-spark {
        display: none;
    }
}

#cpmOverlayDraft .cpm-btn-group .cpm-btn {
    display: flex !important;
    align-items: center;
    justify-content: center !important;
    text-align: center;
    gap: 12px;
}

#cpmOverlayDraft .cpm-btn-group .cpm-btn svg {
    flex: 0 0 18px;
    margin: 0;
}

.cpm-delete-dialog {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(7, 29, 68, 0.58);
    backdrop-filter: blur(4px);
}

.cpm-delete-dialog[hidden] {
    display: none;
}

.cpm-delete-dialog__card {
    width: min(100%, 420px);
    padding: 30px 28px 24px;
    border: 1px solid #dbe9fd;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(0, 24, 72, 0.28);
    text-align: center;
}

.cpm-delete-dialog__icon {
    width: 44px;
    height: 44px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff1f2;
    color: #e11d48;
    font-size: 24px;
    font-weight: 800;
}

.cpm-delete-dialog__card h2 {
    margin: 0 0 10px;
    color: #0b2f6b;
    font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
    font-size: 20px;
}

.cpm-delete-dialog__card p {
    margin: 0 auto 24px;
    max-width: 320px;
    color: #58739f;
    font-size: 13.5px;
    line-height: 1.55;
}

.cpm-delete-dialog__actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.cpm-delete-dialog__actions button {
    min-width: 120px;
    border-radius: 12px;
    padding: 11px 18px;
    font: 700 13.5px 'Poppins', 'Segoe UI', Arial, sans-serif;
    cursor: pointer;
}

.cpm-delete-dialog__cancel {
    border: 1px solid #c9d9ef;
    background: #f7fbff;
    color: #41638f;
}

.cpm-delete-dialog__confirm {
    border: 1px solid #e11d48;
    background: #e11d48;
    color: #ffffff;
}

@media (max-width: 420px) {
    .cpm-delete-dialog__actions {
        flex-direction: column-reverse;
    }

    .cpm-delete-dialog__actions button {
        width: 100%;
    }
}