:root {
    --navy: #003B75;
    --blue: #344b59;
    --orange: #EB0614;
    --light: #f4f6f7;
    --text: #26343d;
    --muted: #71808a;
    --border: #dce2e5;
    --white: #fff;
    --shadow: 0 12px 35px rgba(25, 45, 55, .09);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--light);
    color: var(--text);
    line-height: 1.5;
}

.wrap {
    width: min(1180px, calc(100% - 36px));
    margin: auto;
}


/* =========================
   HEADER / NAVIGATION
   ========================= */

.topbar {
    background: var(--navy);
    color: #fff;
    border-bottom: 4px solid var(--orange);
}

.nav {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
}

.brand-mark {
    font-weight: 900;
    font-size: 25px;
    letter-spacing: -2px;
}

.brand strong {
    display: block;
    font-size: 16px;
    letter-spacing: 2px;
}

.brand small {
    display: block;
    font-size: 9px;
    letter-spacing: 2px;
    opacity: .7;
}

.nav nav {
    display: flex;
    gap: 22px;
}

.nav nav a {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
}

.nav nav a:hover {
    color: #ffb25f;
}


/* =========================
   ALERTES
   ========================= */

.alerts {
    padding-top: 18px;
}

.alert {
    padding: 12px 16px;
    border-radius: 7px;
    margin-bottom: 8px;
}

.alert.success {
    background: #e6f5ea;
    color: #23613a;
}

.alert.error {
    background: #fde8e7;
    color: #8c2722;
}


/* =========================
   PAGE ACCUEIL
   ========================= */

.home-hero {
    padding: 72px 0 58px;
    max-width: 780px;
}

.eyebrow {
    color: var(--orange);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 11px;
}

.home-hero h1 {
    font-size: 56px;
    line-height: 1.02;
    margin: 12px 0 20px;
    letter-spacing: -2px;
}

.home-hero h1 span {
    color: var(--orange);
}

.home-hero p {
    font-size: 18px;
    color: var(--muted);
    max-width: 720px;
}


/* =========================
   TITRES DE SECTIONS
   ========================= */

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 30px;
    margin-bottom: 18px;
}

.section-heading h2 {
    font-size: 28px;
    margin: 7px 0 0;
}

.section-heading p {
    color: var(--muted);
    margin: 0 0 3px;
}


/* =========================
   CARTES PRODUITS
   ========================= */

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.product-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    color: var(--text);
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: .18s;
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: var(--orange);
}

.product-image {
    height: 245px;
    background: #e8edef;
    position: relative;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-arrow {
    position: absolute;
    right: 18px;
    top: 18px;
    background: var(--orange);
    color: #fff;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 22px;
}

.product-content {
    padding: 24px 26px 25px;
}

.product-kicker {
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--orange);
    font-weight: bold;
}

.product-content h3 {
    font-size: 30px;
    margin: 5px 0 4px;
}

.product-content p {
    margin: 0 0 18px;
    color: var(--muted);
    min-height: 44px;
}

.product-link {
    font-size: 13px;
    font-weight: 700;
}

.product-link b {
    color: var(--orange);
    margin-left: 8px;
}


/* =========================
   BANDEAU INFORMATIONS
   ========================= */

.info-strip {
    margin: 34px 0 10px;
    background: var(--navy);
    color: #fff;
    border-radius: 12px;
    padding: 24px 28px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.info-strip strong {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
}

.info-strip span {
    color: #c7d0d5;
    font-size: 13px;
}


/* =========================
   FIL D'ARIANE
   ========================= */

.breadcrumb {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 26px 0 15px;
    font-size: 13px;
}

.breadcrumb a {
    color: var(--muted);
    text-decoration: none;
}


/* =========================
   HERO BIBLIOTHÈQUE
   ========================= */

.library-hero {
    display: grid;
    grid-template-columns: 330px 1fr;
    gap: 35px;
    align-items: center;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 22px;
}

.library-visual {
    height: 240px;
}

.library-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.library-hero > div:last-child {
    padding: 25px 30px 25px 0;
}

.library-hero h1 {
    font-size: 44px;
    margin: 8px 0;
}

.library-hero p {
    color: var(--muted);
    max-width: 650px;
}


/* =========================
   PANELS
   ========================= */

.panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 24px;
}


/* =========================
   FILTRES / RECHERCHE
   ========================= */

.filters {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 10px;
}

.input,
.select,
button {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #cfd8dc;
    border-radius: 7px;
    font: inherit;
    background: #fff;
}

.btn {
    display: inline-block;
    background: var(--orange);
    border: 0;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 7px;
}

.btn.dark {
    background: var(--navy);
}


/* =========================
   BIBLIOTHÈQUE / DOCUMENTS
   ========================= */

.library-count {
    font-size: 13px;
    color: var(--muted);
    margin: 25px 0 12px;
}

.library-count strong {
    color: var(--text);
}

.docs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.doc {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    min-height: 235px;
}

.doc-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.doc-icon {
    font-size: 32px;
}

.badge {
    display: inline-block;
    background: #edf1f3;
    color: #50616b;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 11px;
}

.badge.orange {
    background: #fff0df;
    color: #c86b0b;
}

.doc h3 {
    font-size: 17px;
    margin: 12px 0 7px;
}

.doc p {
    font-size: 13px;
    color: var(--muted);
    margin: 0 0 14px;
}

.doc-details {
    display: flex;
    gap: 15px;
    font-size: 11px;
    color: #89959c;
    margin-top: auto;
}

.doc .actions {
    margin-top: 13px;
}

.empty {
    text-align: center;
    color: var(--muted);
    padding: 40px;
}


/* =========================
   FORMULAIRES
   ========================= */

.form {
    max-width: 620px;
    margin: 50px auto;
}

.form h1 {
    margin-top: 0;
}

.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.field {
    margin-bottom: 14px;
}

.field label {
    display: block;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 5px;
}

.hint {
    font-size: 12px;
    color: var(--muted);
}


/* =========================
   TABLEAUX
   ========================= */

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 13px;
}

th {
    background: #f5f7f8;
    font-size: 12px;
}


/* =========================
   ADMINISTRATION
   ========================= */

.admin-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.stat {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
}

.stat strong {
    font-size: 32px;
}

.stat span {
    display: block;
    color: var(--muted);
}

.actions-inline {
    display: flex;
    gap: 7px;
    align-items: center;
}

.actions-inline .btn {
    width: auto;
    padding: 7px 10px;
    font-size: 12px;
}


/* =========================
   FOOTER
   ========================= */

footer {
    margin-top: 60px;
    padding: 28px 0;
    color: #87939a;
    font-size: 12px;
    border-top: 1px solid var(--border);
}


/* =========================
   CONNEXION
   ========================= */

.login-brand {
    text-align: center;
    margin-bottom: 30px;
}

.password-note {
    padding: 14px;
    background: #fff6ea;
    border-left: 4px solid var(--orange);
    font-size: 13px;
}


/* =========================
   ZONE DE DÉPÔT
   ========================= */

.drop {
    border: 2px dashed #cbd5d9;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    background: #fafbfb;
}

.drop input {
    margin-top: 10px;
}


/* =========================
   MINIATURES DOCUMENTS
   ========================= */

/*
 * La miniature conserve son cadre,
 * mais l'image entière est maintenant visible.
 *
 * object-fit: contain évite tout recadrage.
 */

.doc-thumbnail {
    display: block;
    position: relative;
    height: 155px;
    margin: -18px -18px 16px;
    overflow: hidden;
    background: #f1f3f4;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
}

.doc-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform .2s;
}

.doc-thumbnail:hover img {
    transform: scale(1.04);
}

.thumbnail-zoom {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(39, 54, 66, .88);
    color: #fff;
    font-weight: 700;
}


/* =========================
   RESPONSIVE - TABLETTE
   ========================= */

@media (max-width: 850px) {

    .product-grid,
    .docs,
    .admin-grid {
        grid-template-columns: 1fr 1fr;
    }

    .library-hero {
        grid-template-columns: 1fr;
    }

    .library-hero > div:last-child {
        padding: 25px;
    }

    .filters {
        grid-template-columns: 1fr 1fr;
    }

}


/* =========================
   RESPONSIVE - MOBILE
   ========================= */

@media (max-width: 560px) {

    .nav nav {
        gap: 8px;
    }

    .nav nav a {
        font-size: 12px;
    }

    .product-grid,
    .docs,
    .admin-grid,
    .row,
    .filters,
    .info-strip {
        grid-template-columns: 1fr;
    }

    .home-hero {
        padding-top: 45px;
    }

    .home-hero h1 {
        font-size: 40px;
    }

    .section-heading {
        display: block;
    }

    .section-heading p {
        margin-top: 8px;
    }

    .library-hero h1 {
        font-size: 35px;
    }

}