:root {
    --couleur1   : #32004e;
    --couleur2   : #ecb745;
    --couleur3   : #69eea5;
    --couleur4   : #8213c2;
    --couleur5   : #bb0000;
    --couleur6   : #0066ff;
    --couleur7   : #156103;
    --bg-couleur0: #dddddd;
    --bg-couleur1: #c77373;
    --bg-couleur2: #73bdc7;
    --blanc      : #ffffff;
    --gris0      : rgba(238, 238, 238, 0.2);
    --gris1      : #cccccc;
    --gris3      : #696969;
    --noir       : #000000;

    --transition: 0.4s ease;
}




/* =========== */
.fields-to-extend {
    max-height: 12rem;
    overflow-y: hidden;
}

/* =========== */
.is_icon {
    -webkit-user-drag    : none;
    -webkit-touch-callout: none;
    user-select          : none;
    pointer-events       : auto;
}

.is_icon::selection {
    background: transparent;
}


/* ================================
   MESSAGES (toasts)
================================ */

.cd-message-container {
    position      : fixed;
    top           : 1rem;
    right         : 1rem;
    display       : flex;
    flex-direction: column;
    gap           : 0.5rem;
    z-index       : 999999;
    pointer-events: none;
}

.cd-message {
    min-width     : 220px;
    max-width     : min(360px, 90vw);
    padding       : 0.55rem 0.75rem;
    border-radius : 0.75rem;
    display       : flex;
    align-items   : flex-start;
    gap           : 0.5rem;
    font-size     : 0.85rem;
    box-shadow    : 0 10px 30px rgba(15, 23, 42, 0.3);
    background    : #0f172a;
    color         : #e5e7eb;
    opacity       : 0;
    transform     : translateY(-6px);
    transition    : opacity 0.18s ease, transform 0.18s ease;
    pointer-events: auto;
}

.cd-message.is-visible {
    opacity  : 1;
    transform: translateY(0);
}

.cd-message.is-leaving {
    opacity  : 0;
    transform: translateY(-6px);
}

.cd-message-icon {
    font-size : 1rem;
    margin-top: 1px;
}

.cd-message-text {
    flex: 1;
}

.cd-message-close {
    border     : none;
    background : transparent;
    cursor     : pointer;
    font-size  : 1rem;
    line-height: 1;
    color      : inherit;
}

/* variantes */
.cd-message-success {
    background : #ecfdf3;
    color      : #166534;
    border-left: 4px solid #16a34a;
}

.cd-message-error {
    background : #fef2f2;
    color      : #991b1b;
    border-left: 4px solid #dc2626;
}

.cd-message-warning {
    background : #fffbeb;
    color      : #92400e;
    border-left: 4px solid #f59e0b;
}

.cd-message-info {
    background : #eff6ff;
    color      : #1d4ed8;
    border-left: 4px solid #3b82f6;
}

/* ================================
   MODALE DE CONFIRMATION (PRO)
================================ */

.cd-confirm-backdrop {
    position       : fixed;
    inset          : 0;
    background     : rgba(6, 4, 100, 0.55);
    /* var(--couleur1) */
    backdrop-filter: blur(3px);
    display        : none;
    align-items    : center;
    justify-content: center;
    z-index       : 999998;
}

.cd-confirm-backdrop.is-open {
    display  : flex;
    animation: cdFadeIn .3s ease;
}

.cd-confirm-modal {
    width        : 100%;
    max-width    : 360px;
    padding      : 28px 22px 26px;
    background   : var(--blanc);
    border-radius: 22px;
    box-shadow   : 0 40px 80px rgba(0, 0, 0, .35);
    text-align   : center;
    transform    : translateY(-15px);
    animation    : cdModalIn .25s ease forwards;
}

.cd-confirm-icon {
    width          : 62px;
    height         : 62px;
    border-radius  : 50%;
    background     : rgba(239, 68, 68, 0.1);
    color          : var(--noir);
    display        : flex;
    align-items    : center;
    justify-content: center;
    margin         : 0 auto 10px;
    font-size      : 1.8rem;
}

#cd-confirm-title {
    font-size    : 1.05rem;
    color        : var(--couleur5);
    margin-bottom: 6px;
}

.cd-confirm-body {
    font-size    : 0.88rem;
    color        : var(--gris3);
    margin-bottom: 24px;
    line-height  : 1.5;
}

.cd-confirm-footer {
    display        : flex;
    justify-content: center;
    gap            : 12px;
}

.cd-btn {
    padding      : 10px 18px;
    border-radius: 999px;
    font-size    : 0.78rem;
    border       : none;
    cursor       : pointer;
    display      : flex;
    align-items  : center;
    gap          : 6px;
    transition   : .2s ease;
}

.cd-btn-secondary {
    background: var(--gris1);
    color     : var(--couleur5);
}

.cd-btn-secondary:hover {
    background: var(--gris3);
    color     : white;
}

.cd-btn-danger {
    background: var(--couleur2);
    color     : white;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.cd-btn-danger:hover {
    background: #b91c1c;
}


/* animations */

@keyframes cdFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes cdModalIn {
    from {
        opacity  : 0;
        transform: translateY(40px) scale(.95);
    }

    to {
        opacity  : 1;
        transform: translateY(0) scale(1);
    }
}

/* ================================
   OVERLAY DE CHARGEMENT / PROGRESSION
================================ */

.cd-loading-backdrop {
    position       : fixed;
    inset          : 0;
    background     : rgba(15, 23, 42, 0.45);
    display        : none;
    align-items    : center;
    justify-content: center;
    z-index       : 999997;
}

.cd-loading-backdrop.is-active {
    display: flex;
}

.cd-loading-box {
    min-width    : 220px;
    max-width    : 320px;
    background   : #0f172a;
    color        : #e5e7eb;
    border-radius: 0.9rem;
    padding      : 0.85rem 1rem;
    box-shadow   : 0 20px 60px rgba(0, 0, 0, 0.6);
    display      : flex;
    align-items  : center;
    gap          : 0.75rem;
    font-size    : 0.85rem;
}

.cd-loading-spinner {
    width           : 26px;
    height          : 26px;
    border-radius   : 999px;
    border          : 3px solid rgba(148, 163, 184, 0.8);
    border-top-color: #3b82f6;
    animation       : cd-spin 0.8s linear infinite;
}

.cd-loading-text {
    flex: 1;
}

/* animation spinner */
@keyframes cd-spin {
    to {
        transform: rotate(360deg);
    }
}


.cd-image-modal-backdrop {
    position       : fixed;
    inset          : 0;
    background     : rgba(0, 0, 0, 0.85);
    display        : none;
    align-items    : center;
    justify-content: center;
    z-index       : 999999;
}

.cd-image-modal-backdrop.is-open {
    display: flex;
}

.cd-image-modal {
    position  : relative;
    max-width : 90vw;
    max-height: 90vh;
}

.cd-image-modal-img {
    max-width    : 100%;
    max-height   : 90vh;
    border-radius: 12px;
    box-shadow   : 0 10px 50px rgba(0, 0, 0, 0.6);
}

.cd-image-modal-close {
    position     : absolute;
    top          : -20px;
    right        : -20px;
    background   : #111;
    border       : none;
    color        : #fff;
    width        : 38px;
    height       : 38px;
    border-radius: 50%;
    font-size    : 16px;
    cursor       : pointer;
}


/* ================================
   MODALE ÉDITION D'IMAGE (crop/zoom/rotation)
================================ */

.cd-image-editor-backdrop {
    position       : fixed;
    inset          : 0;
    background     : rgba(15, 23, 42, 0.95);
    display        : none;
    align-items    : stretch;
    justify-content: stretch;
    z-index       : 999999;
}

.cd-image-editor-backdrop.is-open {
    display  : flex;
    animation: cdFadeIn .25s ease;
}

/* Fullscreen modal */
.cd-image-editor-modal {
    width         : 100vw;
    height        : 100vh;
    max-width     : 100vw;
    max-height    : 100vh;
    background    : #0f172a;
    color         : #e5e7eb;
    border-radius : 0;
    /* plein écran */
    box-shadow    : none;
    display       : flex;
    flex-direction: column;
    overflow      : hidden;
}

.cd-image-editor-header {
    padding        : 0.85rem 1.6rem 0.6rem;
    display        : flex;
    align-items    : center;
    justify-content: space-between;
    border-bottom  : 1px solid rgba(148, 163, 184, 0.2);
}

.cd-image-editor-header h3 {
    font-size: 1rem;
    margin   : 0;
}

.cd-image-editor-close {
    border    : none;
    background: transparent;
    color     : #9ca3af;
    font-size : 1.4rem;
    cursor    : pointer;
}

/* Le corps prend tout l'espace entre header et footer */
.cd-image-editor-body {
    padding       : 1rem 1.6rem 0.75rem;
    display       : flex;
    flex-direction: column;
    gap           : 0.9rem;
    flex          : 1;
    overflow      : hidden;
}

.cd-image-editor-cropper {
    background     : #020617;
    border-radius  : 16px;
    padding        : 0.7rem;
    display        : flex;
    align-items    : center;
    justify-content: center;
    flex           : 1;
    min-height     : 0;
}

/* La zone de crop occupe tout l'espace dispo
   → l'image “prend l'écran” */
.cd-image-editor-crop-area {
    position     : relative;
    width        : 100%;
    height       : 100%;
    max-width    : none;
    border-radius: 16px;
    overflow     : hidden;
    background   : #020617;
    border       : 1px solid rgba(148, 163, 184, 0.4);
    cursor       : grab;
}

.cd-image-editor-crop-area.wide {
    /* on garde le même style, la hauteur reste gérée par le flex */
    color: #fff;
}

.cd-image-editor-crop-area.dragging {
    cursor: grabbing;
}

.cd-image-editor-img {
    position   : absolute;
    inset      : 50% auto auto 50%;
    transform  : translate(-50%, -50%);
    max-width  : none;
    max-height : none;
    will-change: transform;
}

/* Zone des contrôles sous l'image */
.cd-image-editor-controls {
    display        : flex;
    flex-wrap      : wrap;
    gap            : 0.75rem;
    align-items    : center;
    justify-content: space-between;
    font-size      : 0.82rem;
    margin-top     : 0.75rem;
}

.cd-image-editor-zoom {
    flex          : 1;
    display       : flex;
    flex-direction: column;
    gap           : 0.25rem;
}

.cd-image-editor-zoom label {
    font-size: 0.78rem;
    color    : #9ca3af;
}

.cd-image-editor-zoom input[type="range"] {
    width: 100%;
}

.cd-image-editor-buttons {
    display: flex;
    gap    : 0.4rem;
}

.cd-btn-icon {
    padding      : 0.5rem 0.7rem;
    border-radius: 999px;
    border       : 1px solid rgba(148, 163, 184, 0.4);
    background   : rgba(15, 23, 42, 0.8);
    color        : #e5e7eb;
    cursor       : pointer;
    font-size    : 0.8rem;
    display      : inline-flex;
    align-items  : center;
    gap          : 0.3rem;
}

.cd-btn-icon:hover {
    background: rgba(30, 64, 175, 0.8);
}

.cd-image-editor-footer {
    padding        : 0.7rem 1.6rem 0.9rem;
    border-top     : 1px solid rgba(148, 163, 184, 0.2);
    display        : flex;
    justify-content: flex-end;
    gap            : 0.5rem;
}

/* Bouton primaire (réutilisable) */
.cd-btn-primary {
    background: #0ea5e9;
    color     : #0f172a;
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.5);
}

.cd-btn-primary:hover {
    background: #0284c7;
    color     : #eff6ff;
}

/* L'image des tableaux (zoom plein écran) */
img.imgToModal {
    cursor: pointer;
}

/* ================================
   Prévisualisation des images
================================ */

.images-preview-grid {
    margin-top: 0.5rem;
    display   : flex;
    flex-wrap : wrap;
    gap       : 0.5rem;
}

.images-preview-item {
    width        : 72px;
    height       : 72px;
    border-radius: 12px;
    overflow     : hidden;
    border       : 1px solid rgba(148, 163, 184, 0.6);
    background   : #020617;
    position     : relative;
    cursor       : pointer;
}

.images-preview-item img {
    width     : 100%;
    height    : 100%;
    object-fit: cover;
    display   : block;
}

.images-preview-item span {
    position     : absolute;
    bottom       : 3px;
    right        : 4px;
    font-size    : 10px;
    padding      : 1px 4px;
    border-radius: 999px;
    background   : rgba(15, 23, 42, 0.85);
    color        : #e5e7eb;
}

/* ================================
   Cadre de rognage personnalisable
================================ */

.cd-image-editor-selection {
    position   : absolute;
    border     : 2px solid rgba(59, 130, 246, 0.95);
    box-shadow : 0 0 0 9999px rgba(15, 23, 42, 0.6);
    /* effet assombrissement autour */
    box-sizing : border-box;
    cursor     : move;
}

.cd-image-editor-selection::before,
.cd-image-editor-selection::after {
    content   : "";
    position  : absolute;
    border    : 1px dashed rgba(148, 163, 184, 0.6);
    inset     : 33.333% 0; /* lignes guides (règle des tiers) */
    pointer-events: none;
}

.cd-image-editor-selection::after {
    inset : 0 33.333%;
}

/* Poignées de redimensionnement */
.cd-handle {
    position      : absolute;
    width         : 12px;
    height        : 12px;
    border-radius : 50%;
    background    : #0ea5e9;
    border        : 2px solid #0f172a;
    box-sizing    : border-box;
    cursor        : pointer;
}

.cd-handle-nw { top: -6px; left: -6px; cursor: nwse-resize; }
.cd-handle-ne { top: -6px; right: -6px; cursor: nesw-resize; }
.cd-handle-sw { bottom: -6px; left: -6px; cursor: nesw-resize; }
.cd-handle-se { bottom: -6px; right: -6px; cursor: nwse-resize; }

.cd-handle-n  { top: -6px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.cd-handle-s  { bottom: -6px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.cd-handle-w  { left: -6px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
.cd-handle-e  { right: -6px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }


/* ===== */
/* ===== */
/* ===== */
/* ===== */
/* ===== */
.password-strength {
    margin-top : 5px;
    font-size  : 13px;
    font-weight: 600;
}

.password-strength.level-0 {
    color: #e53935;
}

/* Très faible = rouge foncé */
.password-strength.level-1 {
    color: #ff7043;
}

/* Faible = orange */
.password-strength.level-2 {
    color: #ffa726;
}

/* Moyen = jaune */
.password-strength.level-3 {
    color: #66bb6a;
}

/* Fort = vert */
.password-strength.level-4 {
    color: #2e7d32;
}

/* Très fort = vert foncé */

/* ===== */
/* ===== */
/* ===== */
/* ===== */
/* ===== */