/* Variables de couleurs et polices */
:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --bg-color: #f9fafb;
    --text-color: #111827;
    --white: #ffffff;
    --gray: #6b7280;
    --error: #ef4444;
    --green: #067550;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    
}

/* --- Navigation --- */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: var(--white);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

nav a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
    margin-left: 15px;
}

/* --- Formulaires (Login/Register) --- */
.form-container {
    max-width: 800px;
    margin: 50px auto;
    background: var(--white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    
        
}
.form-container_poste{
    display: flex;
    justify-content: space-between;
    max-width: 1000px;
    margin: 50px auto;
    background: var(--white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    
}

.form-container-index {
    
    margin: 20px auto;
    background: var(--white);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    
}

.form-container-index h3 {
    margin-bottom: 15px;
    margin-top: 15px;
    color: var(--primary-color);
}
.form-container-index p {
    margin-bottom: 20px;
    color: var(--gray);
}

.form-container-index ul li {
    
    color: var(--gray);
    margin: 10px;
}
.index-content {   
    margin: 10px auto;
}
.index-content img {

    max-width: 50%; /* L'image ne dépassera jamais la largeur du div parent */
    height: auto;    /* Conserve le ratio de l'image pour éviter de l'écraser */
    display: block;  /* Supprime l'espace vide indésirable sous l'image */
    margin: 0 auto;
}
@media only screen and (min-width: 800px) { 


    .index-content {
    display: flex;
    justify-content: space-around;
    flex-wrap: nowrap;
    gap: 20px;
    
    margin: 10px auto;
}
.index-content img {

    max-width: 100%; /* L'image ne dépassera jamais la largeur du div parent */
    height: auto;    /* Conserve le ratio de l'image pour éviter de l'écraser */
    display: block;  /* Supprime l'espace vide indésirable sous l'image */
    margin: 0 auto;   
    
    
}
}

.w-100 {
    width: 100%;
    box-sizing: border-box;
    min-height: 100px;
}


h2 {
    margin-bottom: 20px;
    text-align: center;
    color: var(--primary-color);
}

input, select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    outline: none;
}

input:focus {
    border-color: var(--primary-color);
}

button {
   width: auto;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}
button a {
    color: white;
    text-decoration: none;
}
.bouton {
   width: auto;
    padding: 12px;
    background-color: rgb(218, 216, 216);
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

button:hover, .bouton:hover {
    background-color: var(--primary-hover);
}

/* --- Landing Page Hero --- */
header {
    text-align: center;
    padding: 100px 20px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 20px;
}

header p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}



.btn-main {
    display: inline-block;
    padding: 15px 30px;
    background: var(--white);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    transition: transform 0.2s;
}



.btn-main:hover {
    transform: scale(1.05);
}

.error-box {
    background-color: #fee2e2;
    border-left: 4px solid #ef4444;
    color: #b91c1c;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 0.9rem;
    text-align: left;
}

.error-box p {
    margin: 5px 0;
}

.profile-card {
    background: #f3f4f6;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    text-align: left;
}

.profile-card p {
    margin: 10px 0;
    font-size: 1.1rem;
}

.logo {
    font-weight: bold;
    font-size: 1.4rem;
    color: var(--primary-color);
}

.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    
    background: var(--white);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 15px;
    border: 1px solid var(--primary-color);
}

.forgot-password-link {
    text-align: right;
    margin-bottom: 15px;
    margin-top: 10px; /* Rapproche le lien du champ mot de passe */
}

.forgot-password-link a {
    font-size: 0.85rem;
    color: var(--gray);
    text-decoration: none;
}

.forgot-password-link a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.error-message {
    color: #ef4444;
    background: #fee2e2;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

/* Style du tableau */
.projet-table {
    table-layout: auto;
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-top: 20px;
}

.projet-table th, .projet-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.projet-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.projet-table tr:hover {
    background-color: #f9fafb;
}

.projet-table th:last-child, td:last-child {
  width: 0;
  white-space: nowrap;
}

/*.projet-table tr:last-child td {
    border-bottom: none;
}*/

/* Badge pour le numéro d'incrémentation */
.projet-table td:first-child {
    font-weight: bold;
    color: var(--gray);
}

.projet-table tfoot {
    background: #cecece;
}


.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
    gap: 20px;
    padding: 20px;
}

.lot-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.lot-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    border-bottom: 2px solid #3b82f6;
    padding-bottom: 10px;
}

.poste-item {
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.metrics {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.metrics input {
    width: 100%;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.total {
    font-weight: bold;
    color: #1e40af;
    align-self: center;
}

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #2ecc71;
    color: #fff;
    padding: 12px 18px;
    border-radius: 6px;
    opacity: 0;
    transform: translateY(10px);
    transition: 0.3s;
    z-index: 9999;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.fixed-lot {
    background: #f5f5f5;
    opacity: 0.7;
}
.fixed-lot .drag-handle {
    cursor: not-allowed;
}
.drag-handle {
    
    cursor: move;
    color: #999;
}
.para-handle {
    cursor: move;
    color: #999;
}

/* style.css */
.generalites-container {
    counter-reset: section; /* Initialise le compteur principal (1, 2, 3...) */
    max-width: 900px;
    margin: 20px auto;
}

/* Le bloc Paragraphe */
.paragraph-block {
    background: #f8f9fa;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    cursor: grab; /* Indique qu'on peut déplacer le bloc */
}

/* Titre du Paragraphe (1, 2...) */
.paragraph-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
}
.paragraph-title::before {
    counter-increment: section;
    content: counter(section) ". ";
}

/* Le conteneur des titres (items) */
.items-list {
    counter-reset: subsection; /* Initialise le sous-compteur (1.1, 1.2...) */
    min-height: 50px; /* Important pour pouvoir dropper dans une zone vide */
    padding-left: 20px;
    border-left: 2px solid #e9ecef;
}

/* L'item individuel */
.item-row {
    background: white;
    border: 1px solid #eee;
    margin-bottom: 8px;
    padding: 10px;
    border-radius: 4px;
    position: relative;
    cursor: grab;
}

/* Titre de l'item (1.1, 1.2...) */
.item-title::before {
    counter-increment: subsection;
    content: counter(section) "." counter(subsection) " ";
    font-weight: bold;
    color: #666;
}

/* Champs éditables */
[contenteditable="true"] {
    border-bottom: 1px dashed #ccc;
    outline: none;
    transition: border 0.3s;
}
[contenteditable="true"]:focus {
    border-bottom: 1px solid #007bff;
    background: #f0f8ff;
}

.btn-delete {
    float: right;
    color: red;
    cursor: pointer;
    font-size: 0.9rem;
}


/*claude*/

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
            background-color: #f5f5f5;
            padding: 20px;
        }

        .container {
            max-width: 1400px;
            margin: 0 auto;
            background: white;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }

        .container-dce {
            display: flex;
            max-width: 100%;
            margin: 0 auto;
            background: white;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }

        .header {
            padding: 24px;
            border-bottom: 1px solid #e0e0e0;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .header h1 {
            font-size: 24px;
            font-weight: 600;
            color: #333;
        }

        .header p {
            color: #666;
            font-size: 14px;
            margin-top: 4px;
        }

        .add-btn {
            background-color: #2196F3;
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 14px;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            transition: background-color 0.2s;
        }

        .add-btn:hover {
            background-color: #1976D2;
        }

        .info-box {
            background-color: #E3F2FD;
            border-left: 4px solid #2196F3;
            padding: 16px;
            margin: 24px;
            border-radius: 4px;
        }

        .info-box h3 {
            color: #1976D2;
            font-size: 14px;
            font-weight: 600;
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .info-box ul {
            list-style: none;
            color: #555;
            font-size: 13px;
        }

        .info-box ul li {
            padding: 4px 0;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .content {
            padding: 24px;
        }

        .section {
            background: #fafafa;
            border: 1px solid #e0e0e0;
            border-radius: 8px;
            margin-bottom: 16px;
            position: relative;
        }

        .section.dragging {
            opacity: 0.5;
        }

        .section-header {
            padding: 16px;
            background: white;
            border-radius: 8px 8px 0 0;
            display: flex;
            align-items: center;
            gap: 12px;
            cursor: move;
        }

        .section-number {
            width: 32px;
            height: 32px;
            background-color: #2196F3;
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            font-size: 14px;
            flex-shrink: 0;
        }

        .section-title {
            flex: 1;
            font-size: 16px;
            font-weight: 600;
            color: #333;
        }

        .section-title input {
            width: 100%;
            border: 1px solid transparent;
            background: transparent;
            font-size: 16px;
            font-weight: 600;
            padding: 4px 8px;
            border-radius: 4px;
            transition: all 0.2s;
        }

        .section-title input:hover {
            background: #f5f5f5;
            border-color: #e0e0e0;
        }

        .section-title input:focus {
            outline: none;
            background: white;
            border-color: #2196F3;
            box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
        }

        .section-actions {
            display: flex;
            gap: 8px;
        }

        .btn-icon {
            width: 32px;
            height: 32px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
            background: transparent;
        }

        .btn-add {
            color: #4CAF50;
            background: #E8F5E9;
        }

        .btn-add:hover {
            background: #4CAF50;
            color: white;
        }

        .btn-delete {
            color: #f44336;
            background: #FFEBEE;
        }

        .btn-delete:hover {
            background: #f44336;
            color: white;
        }

        .subsection {
            background: white;
            margin: 8px;
            padding: 12px;
            border-radius: 6px;
            border: 1px solid #e0e0e0;
            display: flex;
            align-items: center;
            gap: 12px;
            cursor: move;
        }

        .subsection.dragging {
            opacity: 0.5;
        }

        .subsection-number {
            width: 28px;
            height: 28px;
            background-color: #E3F2FD;
            color: #2196F3;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            font-size: 12px;
            flex-shrink: 0;
        }

        .subsection-title {
            flex: 1;
            font-size: 14px;
            font-weight: 500;
            color: #555;
        }

        .subsection-title input {
            width: 100%;
            border: 1px solid transparent;
            background: transparent;
            font-size: 14px;
            padding: 4px 8px;
            border-radius: 4px;
            transition: all 0.2s;
        }

        .subsection-title input:hover {
            background: #f5f5f5;
            border-color: #e0e0e0;
        }

        .subsection-title input:focus {
            outline: none;
            background: white;
            border-color: #2196F3;
            box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
        }

        .subsection-content {
            width: 100%;
            margin-top: 8px;
        }

        .subsection-content textarea {
            width: 100%;
            border: 1px solid #e0e0e0;
            border-radius: 4px;
            padding: 8px;
            font-size: 13px;
            font-family: inherit;
            resize: vertical;
            min-height: 60px;
            transition: all 0.2s;
        }

        .subsection-content textarea:focus {
            outline: none;
            border-color: #2196F3;
            box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
        }

        .drag-handle {
            cursor: move;
            color: #999;
        }

        .save-indicator {
            position: fixed;
            bottom: 20px;
            right: 20px;
            background: #4CAF50;
            color: white;
            padding: 12px 20px;
            border-radius: 6px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
            display: none;
            align-items: center;
            gap: 8px;
            animation: slideIn 0.3s ease;
        }

        @keyframes slideIn {
            from {
                transform: translateY(100px);
                opacity: 0;
            }
            to {
                transform: translateY(0);
                opacity: 1;
            }
        }

        .loading {
            display: inline-block;
            width: 16px;
            height: 16px;
            border: 2px solid #ffffff;
            border-radius: 50%;
            border-top-color: transparent;
            animation: spin 0.6s linear infinite;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }
    
/* ── Bouton Bibliothèque sur chaque ligne ── */
.btn-biblio {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: 1px solid #b0bcd8;
    color: var(--primary-color);
    border-radius: 5px;
    padding: 3px 3px;
    font-size: .78rem;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.btn-edit{
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: 1px solid #b0bcd8;
    color: var(--primary-color);
    border-radius: 5px;
    padding: 3px 3px;
    font-size: .78rem;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}

.btn-edit:hover{
background: var(--primary-color);
    color: #fff;
    border-color: #4f8ef7;
}


.btn-biblio:hover {
    background: #4f8ef7;
    color: #fff;
    border-color: #4f8ef7;
}
.btn-biblio.saved {
    background: #eaf3ff;
    border-color: #4f8ef7;
    color: #2b70e8;
}
.btn-biblio .icon { font-size: .85rem; }

/* ── Mini toast ── */
.g-toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    background: #1e2533;
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: .87rem;
    z-index: 3000;
    opacity: 0;
    transform: translateY(8px);
    transition: .28s ease;
    pointer-events: none;
    max-width: 320px;
}
.g-toast.show { opacity: 1; transform: translateY(0); }
.g-toast.ok   { background: #27ae60; }
.g-toast.err  { background: #e05252; }

.export-buttons {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    
}
.export-buttons > *:last-child {
        margin-left: auto;
    }


    .cookie-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #2c3e50;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 9999;
    font-family: sans-serif;
}

.cookie-container a { color: #3498db; text-decoration: underline; }

.btn-cookie {
    background: #27ae60;
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 5px;
    margin-left: 20px;
}

.btn-cookie:hover { background: #2ecc71; }