:root {
    --violet: #8a39e1;
    --violet-dark: #6a21c2;
    --gray: #d8d8dc;
    --text-gray: #777;
    --text-dark: #222;
}

/* ------- MENU LATERAL ------- */
/* ===== HEADER MENU ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--violet-dark);
    color: #fff;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    z-index: 1100;
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
}

.header .logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: .4px;
    white-space: nowrap;
}


.menu-btn {
    font-size: 28px;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    position: absolute;
    left: 15px;   /* Éloigne du bord droit */
    top: 50%;
    transform: translateY(-50%);
    z-index: 1300; /* Toujours visible au-dessus de tout */
}


/* ===== MENU LATÉRAL ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: -260px;
    width: 260px;
    height: 100%;
    background: #fff;
    box-shadow: 2px 0 10px rgba(0,0,0,.12);
    transition: .3s ease;
    z-index: 1150;
    padding-top: 75px;
}

.sidebar.open {
    left: 0;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 22px;
    text-decoration: none;
    color: #222;
    font-weight: 600;
    border-bottom: 1px solid #f0f0f0;
    font-size: 15px;
}

.sidebar a:hover {
    background: var(--violet);
    color: #fff;
}

/* ===== OVERLAY ===== */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 1140;
}

.overlay.show {
    display: block;
}

/* Ajustement contenu */
.container {
    margin-top: 80px;
}



/* Global */
body {
    margin: 0;
    font-family: "Segoe UI", sans-serif;
    background: #f6f6fb;
}

/* Décalage pour le menu */
.container {
    max-width: 780px;
    margin: 100px auto 30px auto; /* 100px pour le header */
    background: #fff;
    padding: 28px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.07);
}



/******** HEADER ********/
.top-status {
    border-bottom: 2px solid #ece9f4;
    margin-bottom: 28px;
    padding-bottom: 16px;
}

.top-status h3 {
    color: var(--violet-dark);
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 800;
}

.top-status h2 {
    color: var(--violet-dark);
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 800;
}

.top-status small {
    color: var(--text-gray);
    font-size: 13px;
}

.estimate span {
    color: var(--violet-dark);
    font-weight: bold;
    font-size: 14px;
    display: block;
    margin-top: 4px;
}

/******** TIMELINE ********/
.timeline {
    position: relative;
}

.step {
    display: flex;
    gap: 18px;
    position: relative;
    padding-bottom: 45px;
}

.step::before {
    content: "";
    position: absolute;
    left: 18px;
    top: 37px;
    width: 3px;
    height: calc(100% - 34px);
    background: var(--gray);
    z-index: 0;
}

.step.done::before,
.step.current::before {
    background: var(--violet);
}

.icon {
    width: 34px;
    height: 34px;
    border: 3px solid var(--gray);
    border-radius: 50%;
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
}

.step.done .icon {
    background: var(--violet);
    border-color: var(--violet);
    color: #fff;
}
.step.done .icon::after {
    content: "✔";
}

.step.current .icon {
    border-color: var(--violet);
    background: #fff;
    color: var(--violet);
}

.content h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.content span {
    font-size: 12px;
    color: var(--text-gray);
}

.content p {
    margin: 6px 0 0;
    color: var(--violet-dark);
    font-size: 13px;
}

.step:last-child::before {
    display: none;
}

/******** INFO DOSSIER ********/
.info-block {
    margin-top: 30px;
    padding: 18px;
    background: #faf9ff;
    border-left: 4px solid var(--violet);
    border-radius: 8px;
}

.info-block p {
    margin: 6px 0;
    font-size: 14px;
    color: var(--text-dark);
}

/******** DOCUMENTS STYLE ********/
h3.docs-title {
    margin-top: 35px;
    color: var(--violet-dark);
    font-size: 20px;
}



.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin-top: 15px;
}

.doc-card {
    display: flex;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0,0,0,0.06);
    border: 1px solid #eee;
    position: relative;
}

.doc-side {
    width: 6px;
    background: var(--violet);
}

.doc-body {
    flex: 1;
    padding: 12px 14px 45px 14px;
    position: relative;
}

/* Header doc : titre + icône aide */
.doc-header {
    display: flex;
    align-items: center;
    gap: 6px;
}

.doc-owner {
    font-size: 12px;
    color: var(--text-gray);
}

.doc-title {
    margin: 3px 0 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dark);
}

/* Icône d'aide */
.doc-help-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e9dbfb;
    color: var(--violet-dark);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: .2s;
}
.doc-help-circle:hover {
    background: var(--violet-dark);
    color: #fff;
    transform: scale(1.05);
}

.doc-icon {
    position: absolute;
    top: 14px;
    right: 12px;
    font-size: 26px;
    opacity: 0.7;
}

/* Bouton Upload */
.upload-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: #111;
    color: #fff;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}
.upload-btn:hover { background: var(--violet-dark); }

/* Nom document perso pour "Autre document" */
.input-doc-name {
    width: 100%;
    padding: 6px 8px;
    font-size: 13px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin: 4px 0 8px;
}

/* Compteur de fichiers */
.file-count {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-gray);
    font-style: italic;
}

/* Infos de fichiers */
.info-sup {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-gray);
    font-style: italic;
}

/* Bouton suppression de carte (uniquement pour Autre document) */
.delete-card {
    position: absolute;
    top: 6px;
    right: 6px;
    background: #e74c3c;
    color: #fff;
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.delete-card:hover {
    background: #c0392b;
}

/******** APERÇU DES DOCUMENTS ********/
.preview-list {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.preview-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    background: #fafafa;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #eee;
}

.preview-thumb {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f8;
    font-size: 11px;
    font-weight: 600;
    color: var(--violet-dark);
}

.preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.preview-name {
    font-weight: 600;
    color: var(--text-dark);
    word-break: break-all;
}

.preview-actions {
    display: flex;
    gap: 6px;
    margin-top: 2px;
}

.preview-actions button {
    border: none;
    font-size: 11px;
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
}

.preview-view {
    background: var(--violet);
    color: #fff;
}
.preview-view:hover { background: var(--violet-dark); }

.preview-delete {
    background: #eee;
    color: #333;
}
.preview-delete:hover { background: #ddd; }

/******** BOUTONS ********/
.add-other-btn {
    margin-top: 20px;
    background: var(--violet);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
}
.add-other-btn:hover { background: var(--violet-dark); }

.submit-btn {
    margin-top: 25px;
    width: 100%;
    background: #07ad24;
    color: #fff;
    padding: 14px;
    font-size: 15px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 700;
}
.submit-btn:hover {
    background: #06881d;
}

/******** MODALS (CONFIRM + PREVIEW + INFO) ********/
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,.5);
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.modal-content {
    background: #fff;
    width: 90%;
    max-width: 420px;
    padding: 22px;
    border-radius: 14px;
    text-align: center;
    position: relative;
}

.modal-icon {
    font-size: 40px;
}

.modal-content h3 {
    margin: 10px 0;
    color: var(--violet-dark);
}

.modal-content p {
    font-size: 14px;
    color: var(--text-dark);
    line-height: 1.4;
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 18px;
    gap: 12px;
}

.btn-cancel, .btn-confirm {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

.btn-cancel {
    background: #ccc;
    color: #111;
}
.btn-cancel:hover { background: #bbb; }

.btn-confirm {
    background: #07ad24;
    color: #fff;
}
.btn-confirm:hover { background: #06881d; }

.preview-modal-content {
    max-width: 720px;
}

.preview-close {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 22px;
    cursor: pointer;
}

#previewModalBody {
    margin-top: 18px;
}

.preview-image {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 10px;
}

/* Modal info aide docs */
#infoModal .modal-content {
    max-width: 450px;
}

#infoModalText {
    margin-top: 8px;
}

/******** MOBILE ********/
@media (max-width: 600px) {
    .container { margin: 12px; padding: 20px; }
    .step { padding-bottom: 35px; }
}

/* ANIMATION PING */
.doc-help-circle {
    position: relative;
}

.doc-help-circle::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(138,57,225,0.5);
    animation: ping 1.8s cubic-bezier(0,0,0.2,1) infinite;
    pointer-events: none; /* Animation toujours active même après clic */
}


@keyframes ping {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    70% {
        transform: scale(2.6);
        opacity: 0;
    }
    100% {
        opacity: 0;
    }
}

@media(max-width: 900px) {
    .container {
        margin: 90px 10px 20px 10px;
    }
}