/* ============================================================
   C.R.I.S.T. – Styles principaux
   Extrait et unifié depuis index.php / presentation.php
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f8fafc;
    color: #1e2937;
    line-height: 1.6;
}

/* ----- Header ----- */
.header {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
}

.logo img {
    height: 50px;
    margin-right: 12px;
}

.menu {
    display: flex;
    gap: 2rem;
}

.menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.menu a:hover {
    color: #bae6fd;
}

/* ----- Conteneur principal ----- */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Variante plus étroite pour la page Présentation */
.container--narrow {
    max-width: 900px;
}

/* ----- Titres ----- */
h1 {
    color: #1e40af;
    margin-bottom: 1.5rem;
    text-align: center;
}

h2 {
    color: #1e40af;
    margin: 2rem 0 1rem;
}

p {
    margin-bottom: 1rem;
}

/* ----- Tableau de suivi ----- */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    overflow: hidden;
}

th,
td {
    padding: 14px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

th {
    background: #1e40af;
    color: white;
}

tr:last-child td {
    border-bottom: none;
}

.en-cours {
    background: #fef3c7;
    font-weight: bold;
}

.terminee {
    color: #166534;
}

.prevue {
    color: #64748b;
}

/* Badges de statut */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-terminee {
    background: #dcfce7;
    color: #166534;
}

.status-encours {
    background: #fef3c7;
    color: #92400e;
}

.status-prevue {
    background: #f1f5f9;
    color: #475569;
}

/* Bloc État actuel */
.etat-actuel {
    background: white;
    padding: 1.5rem 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin: 1.5rem 0;
    border-left: 5px solid #3b82f6;
}

/* ----- Cartes (page Présentation) ----- */
.card {
    background: white;
    padding: 1.5rem 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin: 1.5rem 0;
}

.back {
    display: inline-block;
    margin-top: 1rem;
    color: #1e40af;
    text-decoration: none;
    font-weight: 500;
}

.back:hover {
    text-decoration: underline;
}

/* ----- Responsive ----- */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .menu {
        gap: 1.5rem;
    }

    table {
        font-size: 0.9rem;
    }

    th,
    td {
        padding: 10px 8px;
    }
}

/* ----- Grille de projets (canvas) ----- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.75rem;
    margin: 1rem 0 3rem;
}

.project-canvas {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-canvas:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(30, 64, 175, 0.15);
}

.project-canvas__image {
    aspect-ratio: 16 / 10;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.project-canvas__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
}

.project-canvas__body {
    padding: 1.25rem 1.5rem 1.5rem;
}

.project-canvas__body h3 {
    color: #1e40af;
    font-size: 1.25rem;
    margin-bottom: 0.35rem;
}

.project-canvas__body p {
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 0.85rem;
}

.project-canvas__status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ----- Auth dans le menu ----- */
.menu .nav-user {
    color: #bae6fd;
    font-weight: 500;
    margin-right: 0.25rem;
}
.menu .nav-login {
    background: rgba(255, 255, 255, 0.15);
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
}
.menu .nav-login:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

/* ----- Page Présentation ----- */
.presentation-list {
    margin: 0.75rem 0 1.25rem 1.25rem;
    padding: 0;
    list-style: disc;
}
.presentation-list li {
    margin-bottom: 0.55rem;
    color: #334155;
}
.presentation-sub {
    color: #1e40af;
    font-size: 1.05rem;
    margin: 1.25rem 0 0.5rem;
    font-weight: 600;
}
.card .presentation-sub:first-of-type {
    margin-top: 0.5rem;
}

/* ----- Admin C.R.I.S.T. ----- */
.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.admin-toolbar h1 {
    margin: 0;
    text-align: left;
    font-size: 1.5rem;
}
.btn-admin-primary {
    display: inline-block;
    padding: 0.55rem 1.1rem;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: white !important;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
}
.btn-admin-primary:hover { filter: brightness(1.05); }
.admin-table-wrap {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    overflow-x: auto;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    box-shadow: none;
}
.admin-table th, .admin-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}
.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    align-items: center;
}
.admin-actions a { color: #1e40af; font-weight: 500; }
.inline-form { display: inline; margin: 0; }
button.linkish {
    background: none;
    border: none;
    color: #1e40af;
    cursor: pointer;
    font: inherit;
    font-weight: 500;
    padding: 0;
}
button.linkish.danger { color: #b91c1c; }
.admin-flash {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}
.admin-flash-ok { background: #dcfce7; color: #166534; }
.admin-flash-err { background: #fef2f2; color: #b91c1c; }
.admin-hint { color: #64748b; font-size: 0.9rem; margin-top: 1rem; }
.admin-form label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 500;
    color: #334155;
}
.admin-form input[type="text"],
.admin-form input[type="number"],
.admin-form select,
.admin-form textarea {
    display: block;
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font: inherit;
}
.checkbox-label {
    font-weight: 400 !important;
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
}
.checkbox-label input { width: auto !important; margin: 0 !important; }
.membres-fieldset {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}
.membres-fieldset legend { padding: 0 0.5rem; color: #1e40af; font-weight: 600; }
.membres-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.35rem 1rem;
    max-height: 240px;
    overflow-y: auto;
}
.admin-form-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.25rem;
}
.admin-thumb {
    max-width: 180px;
    max-height: 120px;
    object-fit: contain;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

/* ----- Footer copyright (fixe) ----- */
.crist-site-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0.35rem 0.75rem;
    background: rgba(30, 64, 175, 0.95);
    color: #bfdbfe;
    font-size: 0.72rem;
    line-height: 1.3;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.crist-site-footer a {
    color: #ffffff;
    text-decoration: none;
    margin-left: 0.2rem;
}
.crist-site-footer a:hover {
    text-decoration: underline;
}
body {
    padding-bottom: 2.5rem;
}
