/* =========================================================================
   JVP LIBRARY — Feuille de style unifiée
   Thème sombre violet, pensé pour compléter Bootstrap 5 (link CDN dans le
   <head> de chaque page). Ce fichier ne contient QUE du CSS : aucune page
   PHP, aucun script JS n'a été modifié pour cette uniformisation.
   ========================================================================= */

:root {
    --bg: #071026;
    --bg-soft: #07142a;
    --card: #0b1220;
    --field: #141d30;
    --line: #222d42;
    --line-soft: #263552;
    --muted: #9aa4b2;
    --text: #f5f5f5;
    --accent: #7c5cff;
    --accent-dark: #6847e8;
    --accent-2: #5b9dff;
    --teal: #17BEBB;
    --success: #2ecc71;
    --danger: #ff5c5c;
    --warning: #ffaa00;
    /* On aligne les variables Bootstrap sur l'identité visuelle du site */
    --bs-primary: var(--accent);
    --bs-primary-rgb: 124, 92, 255;
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--text);
    --bs-border-color: var(--line);
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
    color: var(--text);
    font-family: "Segoe UI", Arial, sans-serif;
    margin: 0;
    padding: 0;
}

a {
    color: var(--accent-2);
}


/* --- CONTENEUR GÉNÉRIQUE (Index.php) --- */

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px;
}


/* --- NAVBAR / HEADER --- */

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.site-title,
.brand {
    display: inline-block;
    margin: 0;
    padding: 8px 16px;
    border-radius: 12px;
    background: linear-gradient(90deg, rgba(124, 92, 255, .12) 0%, rgba(91, 157, 255, .08) 100%);
    color: #fff;
    font-family: Georgia, "Segoe UI", serif;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 1px;
    text-decoration: none;
    box-shadow: 0 12px 30px rgba(7, 18, 38, .6);
    transition: transform .25s ease, box-shadow .25s ease;
    animation: gentleFloat 5s ease-in-out infinite;
}

.site-title:hover,
.brand:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 22px 46px rgba(7, 18, 38, .7);
    color: #fff;
}

@keyframes gentleFloat {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
    100% {
        transform: translateY(0);
    }
}

.navbar {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-float {
    display: inline-block;
    font-weight: bold;
    background: linear-gradient(90deg, rgba(124, 92, 255, .12) 0%, rgba(91, 157, 255, .08) 100%);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(7, 18, 38, .18);
    padding: 8px 24px;
    animation: gentleFloat 4s ease-in-out infinite;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 18px;
    margin: 0;
    padding: 0;
    z-index: 1000;
    flex-wrap: wrap;
}

.nav-links li {
    display: inline;
}

.nav-links li a {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    padding: 10px 18px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
    transition: background .2s, color .2s;
}

.nav-links li a:hover {
    background: linear-gradient(90deg, var(--teal) 0%, #79ffd5 100%);
    color: #022027;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    width: 36px;
    height: 36px;
    cursor: pointer;
    margin-left: 16px;
    z-index: 1001;
}

.nav-toggle span {
    height: 4px;
    width: 100%;
    background: var(--accent);
    margin: 5px 0;
    border-radius: 2px;
    transition: .3s;
}

.nav-toggle.open span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

@media (max-width: 800px) {
    .nav-links {
        position: absolute;
        top: 60px;
        right: 0;
        background: var(--card);
        flex-direction: column;
        width: 200px;
        align-items: flex-start;
        gap: 0;
        box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
        border-radius: 0 0 12px 12px;
        overflow: hidden;
        max-height: 0;
        transition: max-height .3s ease;
    }
    .nav-links.open {
        max-height: 400px;
        padding-bottom: 10px;
    }
    .nav-links li {
        width: 100%;
    }
    .nav-links li a {
        display: block;
        width: 100%;
        border-radius: 0;
        background: none;
        padding: 14px 24px;
        border-bottom: 1px solid var(--line);
    }
    .nav-toggle {
        display: flex;
    }
}


/* --- BOUTONS GÉNÉRIQUES --- */

.btn {
    display: inline-block;
    padding: 10px 18px;
    margin-left: 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 10px 20px rgba(92, 77, 255, .18);
    transition: transform .25s ease, box-shadow .25s ease;
}

.btn:hover {
    transform: translateY(-8px);
    box-shadow: 0 18px 36px rgba(92, 77, 255, .28);
    color: #fff;
}

@media (min-width: 700px) {
    .btn {
        animation: gentleFloat 4s ease-in-out infinite;
    }
}

.whatsapp {
    display: inline-block;
    margin-left: 8px;
    padding: 8px 14px;
    background: linear-gradient(90deg, #25D366 0%, #0bb45a 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(37, 211, 102, .18);
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s;
}

.whatsapp:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(37, 211, 102, .26);
    opacity: .98;
    color: #fff;
}

.instagram {
    background: linear-gradient(90deg, #C13584 0%, var(--accent) 100%);
}

.instagram:hover {
    background: linear-gradient(90deg, var(--accent) 0%, #C13584 100%);
}

button {
    background-color: var(--accent);
    color: #fff;
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 10px;
    font-weight: bold;
    transition: background-color .3s ease, background .2s ease;
}

button:hover {
    background-color: var(--accent-dark);
}


/* --- ACCUEIL : STATS / A PROPOS (Index.php) --- */

.stats-box {
    background: var(--card);
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    text-align: center;
}


/* --- GRILLE DE LIVRES (Index.php + books.php) --- */

.book-grid,
.books {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.book,
.book-card {
    background: var(--card);
    border: 1px solid var(--field);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
    padding: 15px;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 250px;
    transition: transform .3s, box-shadow .3s;
}

.book:hover,
.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .15);
}

.book-image {
    width: 100%;
    height: 240px;
    background: var(--accent);
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #fff;
    overflow: hidden;
    padding: 0;
}

.book-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: 100%;
    object-fit: contain;
    display: block;
    margin: auto;
    background: #fff;
}

.book img {
    width: 100%;
    max-width: 160px;
    max-height: 200px;
    aspect-ratio: 3/4;
    margin: 8px auto 12px;
    display: block;
    object-fit: contain;
    border-radius: 10px;
    background: var(--field);
}

.book-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    margin-bottom: 12px;
    min-height: 0;
}

.book h5 {
    margin: 0 0 8px 0;
    font-size: 1rem;
    line-height: 1.4;
    color: #fff;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    word-break: break-word;
}

.book-author,
.book-category-name {
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.4;
    margin: 0 0 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-category-name {
    color: var(--accent-2);
    font-weight: 600;
}

.price,
p.price {
    margin: 5px 0 0 0;
    font-weight: bold;
    font-size: 1.05rem;
    color: var(--warning) !important;
}

.desc {
    margin-top: 8px;
    color: var(--muted);
    font-size: .85rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book a {
    text-decoration: none;
    width: 100%;
    display: block;
}

.btn-download,
.book button {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    transition: background .2s;
}

.btn-download:hover,
.book button:hover {
    background: var(--accent-2);
}


/* --- PAGE BOOKS.PHP : recherche --- */

.books-page {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px 64px;
}

.books-hero {
    background: linear-gradient(135deg, rgba(124, 92, 255, .14), rgba(91, 157, 255, .08));
    border-radius: 0 0 30px 30px;
    margin: 0 -24px 42px;
    padding: 34px 24px 40px;
    text-align: center;
}

.hero-copy {
    color: var(--muted);
    font-size: 1rem;
    margin: 16px auto 22px;
    max-width: 550px;
}

.search-box {
    margin: auto;
    max-width: 620px;
    position: relative;
}

.search-icon {
    color: var(--accent-2);
    left: 18px;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

#searchInput,
input[type="search"] {
    background: var(--field);
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    box-shadow: 0 10px 26px rgba(7, 18, 38, .3);
    color: var(--text);
    display: block;
    font-size: 1rem;
    margin: 0 auto 10px;
    min-width: 0;
    outline: none;
    padding: 16px 48px;
    transition: border-color .2s, box-shadow .2s;
    width: 100%;
}

#searchInput:focus,
input[type="search"]:focus {
    border-color: var(--accent);
    box-shadow: 0 12px 30px rgba(124, 92, 255, .22);
}

#clearSearch {
    background: transparent;
    border: 0;
    color: var(--muted);
    cursor: pointer;
    display: none;
    font-size: 1.4rem;
    line-height: 1;
    margin: 0;
    padding: 8px;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
}

#clearSearch.visible {
    display: block;
}

.books-intro {
    margin-bottom: 30px;
    text-align: center;
}

.books-intro h2 {
    color: #fff;
    font-family: Georgia, serif;
    font-size: clamp(1.6rem, 4vw, 2.25rem);
    margin: 0 0 8px;
}

.books-intro p {
    color: var(--muted);
    margin: 0;
}

#noResults {
    background: var(--card);
    border: 1px dashed var(--line-soft);
    border-radius: 14px;
    color: var(--muted);
    display: none;
    margin: 30px auto;
    max-width: 510px;
    padding: 28px;
    text-align: center;
}

#noResults strong {
    color: #fff;
    display: block;
    font-family: Georgia, serif;
    font-size: 1.2rem;
    margin-bottom: 6px;
}

#Intro {
    display: none;
}

.books-page>h3 {
    margin: 40px 0 18px;
}

@media (max-width: 640px) {
    .books-page {
        padding: 0 16px 44px;
    }
    .books-hero {
        margin: 0 -16px 30px;
        padding: 27px 16px 32px;
    }
}


/* --- ADMIN : dashboard paiements --- */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 2px solid var(--accent);
    margin-bottom: 20px;
    padding-bottom: 10px;
    flex-wrap: wrap;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

h1 {
    color: #fff;
    margin: 0;
    font-size: 24px;
}

.notif {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: bold;
    font-size: 14px;
}

.notif-success {
    background: #1e3d2f;
    border: 1px solid var(--success);
    color: var(--success);
}

.notif-error {
    background: #3d1e1e;
    border: 1px solid var(--danger);
    color: var(--danger);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .3);
}

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

th {
    background: var(--field);
    color: var(--accent);
    font-weight: bold;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: .5px;
}

tr:hover {
    background: var(--field);
}

.badge {
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.badge-attente {
    background: var(--warning);
    color: #000;
}

.badge-valide {
    background: var(--success);
    color: #fff;
}

.btn-action {
    background: var(--success);
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background .2s;
    margin: 0;
}

.btn-action:hover {
    background: #27ae60;
}

.btn-add-book,
.btn-logout {
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    padding: 9px 13px;
    text-decoration: none;
    white-space: nowrap;
}

.btn-add-book {
    background: var(--accent);
}

.btn-add-book:hover {
    background: var(--accent-dark);
    color: #fff;
}

.btn-logout {
    background: #c0392b;
}

.btn-logout:hover {
    background: #a93226;
    color: #fff;
}

small {
    color: var(--muted);
}


/* --- ADMIN : formulaire "Ajouter un livre" --- */

.topbar {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.back {
    border: 1px solid var(--line-soft);
    border-radius: 7px;
    color: var(--text);
    font-size: .9rem;
    padding: 9px 12px;
    text-decoration: none;
}

.back:hover {
    background: var(--field);
}

.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 14px 35px rgba(0, 0, 0, .22);
    padding: clamp(20px, 5vw, 34px);
    max-width: 760px;
    margin: 0 auto;
}

.panel-books-manager {
    max-width: 1240px;
    margin-top: 24px;
}

.book-manager-toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 20px;
}

.book-manager-toolbar h2 {
    margin: 0;
}

.book-search-box {
    max-width: 360px;
    min-width: min(100%, 260px);
    position: relative;
    width: 100%;
}

.book-search-box .search-icon {
    color: var(--accent-2);
    left: 15px;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.book-search-box input {
    padding-left: 42px;
    padding-right: 42px;
}

.book-search-box #clearBookSearch {
    background: transparent;
    border: 0;
    color: var(--muted);
    cursor: pointer;
    display: none;
    font-size: 1.35rem;
    line-height: 1;
    margin: 0;
    padding: 6px;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
}

.book-search-box #clearBookSearch.visible {
    display: block;
}

.book-manager-table-wrapper {
    overflow-x: auto;
}

.book-manager-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.book-manager-row {
    align-items: end;
    background: rgba(19, 28, 43, 0.8);
    border: 1px solid var(--line);
    border-radius: 10px;
    display: grid;
    gap: 10px;
    grid-template-columns: 70px minmax(180px, 2.2fr) minmax(120px, 1.1fr) minmax(180px, 1.8fr) minmax(110px, 0.9fr) minmax(90px, 0.7fr) 120px;
    padding: 10px 12px;
}

.book-manager-cell {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.book-manager-cell label {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.book-manager-cell input,
.book-manager-cell select {
    font-size: .9rem;
    padding: 8px 10px;
}

.book-id input {
    background: var(--field);
}

.book-actions {
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.book-actions button {
    background: var(--accent);
    border: 0;
    border-radius: 7px;
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    padding: 9px 12px;
    width: 100%;
}

.book-actions button:hover {
    background: var(--accent-dark);
}

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

.intro {
    color: var(--muted);
    line-height: 1.55;
    margin: 0 0 26px;
}

.grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.field.full {
    grid-column: 1 / -1;
}

.field label,
label {
    color: #dce5f5;
    font-size: .9rem;
    font-weight: 600;
}

.hint {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 400;
}

input,
select {
    background: var(--field);
    border: 1px solid var(--line-soft);
    border-radius: 7px;
    color: var(--text);
    font: inherit;
    outline: none;
    padding: 11px 12px;
    width: 100%;
}

input:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(124, 92, 255, .16);
}

.submit {
    background: var(--accent);
    border: 0;
    border-radius: 7px;
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    margin-top: 26px;
    padding: 12px 18px;
    width: 100%;
}

.submit:hover {
    background: var(--accent-dark);
}

.message {
    border-radius: 8px;
    margin-bottom: 20px;
    padding: 13px 15px;
}

.message.success {
    background: #153c2c;
    border: 1px solid #299c68;
    color: #a6f1ca;
}

.message.error {
    background: #432127;
    border: 1px solid #be4958;
    color: #ffbec6;
}

@media (max-width: 580px) {
    .grid {
        grid-template-columns: 1fr;
    }
    .field.full {
        grid-column: auto;
    }
}


/* --- LOGIN / NETTOYAGE (login.php, nettoyer_titres.php) --- */

.login-box {
    width: min(360px, calc(100% - 40px));
    background: var(--card);
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .3);
    margin: 0 auto;
}

.login-box h1 {
    font-size: 24px;
    margin: 0 0 22px;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 10px;
}

.login-box label {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 14px;
}

.login-box input {
    box-sizing: border-box;
    width: 100%;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--field);
    color: #fff;
    margin-bottom: 18px;
}

.login-box button {
    background: var(--accent);
    border: 0;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    font-weight: bold;
    padding: 11px 14px;
    width: 100%;
    margin-top: 0;
}

.login-box button:hover {
    background: var(--accent-dark);
}

.error {
    background: #3d1e1e;
    border: 1px solid var(--danger);
    border-radius: 6px;
    color: #ff9090;
    font-size: 14px;
    margin-bottom: 18px;
    padding: 12px;
}

body.centered-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

main.simple-panel {
    max-width: 680px;
    margin: 45px auto;
    background: var(--card);
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .3);
    padding: 30px;
}

main.simple-panel h1 {
    border-bottom: 2px solid var(--accent);
    font-size: 24px;
    margin-top: 0;
    padding-bottom: 10px;
}

main.simple-panel p {
    color: #c2cad5;
    line-height: 1.5;
}

.success {
    background: #1e3d2f;
    border: 1px solid var(--success);
    color: #8ff0b7;
}


/* --- CHECKOUT --- */

.checkout-container {
    background: var(--card);
    max-width: 500px;
    width: 100%;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--accent);
    box-shadow: 0 4px 20px rgba(0, 0, 0, .4);
    margin: 40px auto;
}

.checkout-container h2,
.checkout-container h3 {
    margin-top: 0;
    text-align: center;
    color: #fff;
}

.instructions-block {
    background: var(--field);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--warning);
    font-size: 14px;
}

.instructions-block ul {
    margin: 5px 0 0 0;
    padding-left: 20px;
}

.instructions-block li {
    margin-bottom: 5px;
    font-weight: bold;
}

.details-livre {
    background: var(--field);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    border-left: 4px solid var(--accent);
}

.details-livre h4 {
    margin: 0 0 5px 0;
    font-size: 18px;
}

.prix {
    color: var(--accent);
    font-size: 22px;
    font-weight: bold;
}

.form-group {
    margin-bottom: 15px;
}

.checkout-container .form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 14px;
}

.checkout-container .form-group input {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: var(--bg);
    color: #fff;
    font-size: 14px;
}

.btn-payer {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    border: none;
    color: #fff;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 0;
}

.btn-payer:hover {
    background: #633eff;
}

.success-msg {
    color: var(--success);
    background: #1e3d2f;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid var(--success);
    text-align: center;
}

.error-msg {
    color: var(--danger);
    background: #2c1616;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid var(--danger);
    text-align: center;
}

.back-home {
    display: block;
    text-align: center;
    color: var(--muted);
    margin-top: 15px;
    text-decoration: none;
    font-size: 14px;
}

.back-home:hover {
    color: #fff;
}


/* --- CONTACT --- */

.contact-section {
    max-width: 480px;
    margin: 40px auto 30px;
    padding: 28px 18px 18px;
    background: var(--card);
    border-radius: 18px;
    color: var(--text);
    box-shadow: 0 8px 32px rgba(92, 77, 255, .13);
    text-align: center;
    border: 1.5px solid rgba(124, 92, 255, .2);
}

.contact-section h2 {
    color: var(--teal);
    margin-bottom: 15px;
    font-size: 1.6rem;
    font-weight: 700;
}

.contact-section p {
    font-size: 1.08rem;
    margin-bottom: 26px;
    color: var(--muted);
}

.contact-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
    align-items: center;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}

.contact-form .form-group {
    position: relative;
    margin-bottom: 18px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 18px 18px 12px;
    border-radius: 12px;
    border: none;
    font-size: 1.12rem;
    background: var(--field);
    color: var(--text);
    box-shadow: inset 0 0 0 1px var(--line-soft);
    outline: none;
    transition: box-shadow .2s, border .2s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    box-shadow: inset 0 0 0 2px var(--teal);
}

.contact-form label {
    position: absolute;
    left: 20px;
    top: 18px;
    color: var(--muted);
    font-size: 1.08rem;
    pointer-events: none;
    background: transparent;
    transition: .18s cubic-bezier(.4, 0, .2, 1);
    padding: 0 4px;
    opacity: .85;
}

.contact-form input:focus+label,
.contact-form input:not(:placeholder-shown)+label,
.contact-form textarea:focus+label,
.contact-form textarea:not(:placeholder-shown)+label {
    top: -10px;
    left: 14px;
    font-size: .98rem;
    color: var(--teal);
    background: var(--card);
    opacity: 1;
}

.contact-form textarea {
    min-height: 110px;
    resize: vertical;
}

.contact-form button {
    padding: 16px 0;
    border: none;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--teal) 100%);
    color: #fff;
    font-size: 1.18rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 12px;
    box-shadow: 0 6px 24px rgba(92, 77, 255, .16);
    letter-spacing: .5px;
    transition: background .3s, transform .2s, box-shadow .2s;
}

.contact-form button:hover {
    background: linear-gradient(90deg, var(--teal) 0%, var(--accent) 100%);
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 12px 36px rgba(92, 77, 255, .22);
}

.footer {
    background: linear-gradient(90deg, var(--accent) 0%, var(--teal) 100%);
    color: #fff;
    text-align: center;
    padding: 18px 0 10px;
    margin-top: 40px;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: .5px;
    border-radius: 0 0 18px 18px;
    box-shadow: 0 -4px 18px rgba(92, 77, 255, .13);
}

@media (min-width: 600px) {
    .contact-section {
        max-width: 520px;
        padding: 36px 32px 24px;
    }
    .contact-buttons {
        flex-direction: row;
        justify-content: center;
        gap: 18px;
    }
    .contact-form {
        max-width: 420px;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .contact-section {
        padding: 12px 2vw 8px;
    }
    .contact-buttons .btn {
        font-size: .98rem;
        padding: 10px 8px;
    }
    .contact-form input,
    .contact-form textarea {
        font-size: .98rem;
        padding: 10px 8px;
    }
    .contact-form button {
        font-size: 1rem;
        padding: 10px 0;
    }
}


/* --- RESPONSIVE GÉNÉRAL --- */

@media (max-width: 900px) {
    .book-grid,
    .books {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

@media (max-width: 640px) {
    header {
        flex-direction: column;
        gap: 20px;
    }
    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    .book-grid,
    .books {
        grid-template-columns: 1fr;
        justify-items: center;
    }
    .book,
    .book-card {
        width: 95%;
        margin: 0 auto;
    }
}