/* ============================================
   RECHERCHE ARTISTE PAR SIGNATURE
   ============================================ */

:root {
    --bg: #fcfcfc;
    --card: #ffffff;
    --accent: #CB191C;
    --accent-light: #e88686;
    --text: #131313;
    --text-light: #6b6767;
    --border: #ddd;
    --success: #1cb83b;
    --star: #e8de32;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* --- HEADER + NAV STICKY --- */
.sticky-top {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 100;
}

.sticky-top::after {
    content: '';
    display: block;
    height: 20px;
    background: -moz-linear-gradient(top, rgba(0,0,0,0.08) 0%, transparent 100%);
    background: -webkit-linear-gradient(top, rgba(0,0,0,0.08) 0%, transparent 100%);
    background: linear-gradient(to bottom, rgba(0,0,0,0.08) 0%, transparent 100%);
    pointer-events: none;
}

header {
    background: var(--accent);
    color: white;
    padding: 1.2rem 2rem;
}

.header-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

.header-link {
    text-decoration: none;
    color: white;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.header-link:hover .header-logo {
    opacity: 0.85;
}

.header-logo {
    height: 65px;
    width: auto;
    max-width: 250px;
    flex-shrink: 0;
    transition: opacity 0.2s;
    margin-right: 10px;
}

header .subtitle {
    font-size: 0.85rem;
    color: white;
    opacity: 1;
    font-weight: 600;
    letter-spacing: 0.2px;
    margin-bottom: 0.15rem;
    text-align: right;
}

@media (max-width: 600px) {
    .header-link {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    header .subtitle {
        text-align: left;
        font-size: 0.75rem;
    }
    .header-logo {
        height: auto;
        width: 170px;
        max-width: 170px;
        overflow: visible;
    }
}

/* --- NAVIGATION MODES --- */
.nav-modes {
    display: flex;
    justify-content: center;
    gap: 0;
    background: white;
    border-bottom: 2px solid var(--border);
}

.nav-link {
    padding: 0.8rem 2rem;
    text-decoration: none;
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.95rem;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--accent);
    background: #faf7f4;
}

.nav-link.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* --- MAIN --- */
main {
    max-width: 900px;
    margin: 1rem auto;
    padding: 0 1rem;
}

/* --- CHAMP RECHERCHE NOM --- */
.input-nom {
    flex: 1;
    max-width: 450px;
    width: 100%;
    min-width: 0;
    padding: 0.7rem 1rem;
    border: 2px solid var(--border);
    border-radius: 6px;
    font-size: 1.1rem;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    box-sizing: border-box;
}

.input-nom:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(139, 94, 60, 0.15);
}

/* --- NOUVELLE RECHERCHE (haut de page) --- */
.top-actions {
    text-align: right;
    margin-bottom: 0.5rem;
}

.btn-nouvelle-recherche {
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.4rem 1rem;
    border: 1px solid var(--accent-light);
    border-radius: 20px;
    transition: all 0.2s;
}

.btn-nouvelle-recherche:hover {
    background: var(--accent);
    color: white;
}

/* --- EFFACER MASQUE --- */
.masque-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.masque-header p {
    margin: 0;
}

.btn-effacer {
    background: none;
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-effacer:hover {
    border-color: #c62828;
    color: #c62828;
    background: #fff5f5;
}

/* --- SECTIONS --- */
section {
    background: var(--card);
    border-radius: 8px;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

section h2 {
    font-size: 1.1rem;
    color: var(--accent);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-light);
}

/* --- MODE TOGGLE (radio siècle/fourchette) --- */
.mode-toggle {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
}

.radio-label {
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.radio-label input[type="radio"] {
    accent-color: var(--accent);
}

/* --- FOURCHETTE D'ANNEES --- */
.fourchette-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.input-annee {
    width: 90px;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
    text-align: center;
}

.input-annee:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(139, 94, 60, 0.15);
}

.fourchette-sep {
    color: var(--text-light);
    font-size: 0.9rem;
}

.fourchette-presets {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.3rem;
}

.fourchette-presets button {
    background: #f0e6db;
    border: 1px solid var(--accent-light);
    border-radius: 15px;
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
    color: var(--accent);
    cursor: pointer;
    transition: all 0.2s;
}

.fourchette-presets button:hover {
    background: var(--accent);
    color: white;
}

/* --- FILTRES --- */
.filtre-row {
    display: flex;
    align-items: center;
    margin-bottom: 0.8rem;
    gap: 1rem;
}

.filtre-row label {
    min-width: 130px;
    font-weight: 600;
    font-size: 0.95rem;
}

.filtre-row select {
    flex: 1;
    max-width: 350px;
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.95rem;
    background: white;
}

.filtre-row select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(139, 94, 60, 0.15);
}

.filtre-row.futur {
    opacity: 0.4;
}

.filtre-row.futur select {
    background: #f0f0f0;
    cursor: not-allowed;
}

.tolerance {
    font-size: 0.8rem;
    color: var(--text-light);
    font-style: italic;
}

/* --- COMPTEUR --- */
.compteur {
    background: var(--accent);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    display: inline-block;
    font-weight: 600;
    font-size: 0.95rem;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

/* --- MASQUE SIGNATURE --- */
.masque-container p {
    color: var(--text-light);
}

.masque-cases {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.case-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lettre-case {
    width: 52px;
    height: 58px;
    border: 2px solid var(--border);
    border-radius: 6px;
    text-align: center;
    font-size: 1.6rem;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: var(--accent);
    background: white;
    text-transform: uppercase;
    transition: all 0.2s;
}

.lettre-case:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(139, 94, 60, 0.2);
    outline: none;
}

.lettre-case:not(:placeholder-shown),
.lettre-case:not([value=""]) {
    background: #fdf6ef;
    border-color: var(--accent);
}

.case-numero {
    font-size: 0.7rem;
    color: var(--text-light);
    margin-top: 0.2rem;
}

/* --- BOUTON --- */
.actions {
    text-align: center;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.btn-rechercher {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.9rem 3rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-rechercher:hover {
    background: #704b30;
}

/* ============================================
   RESULTATS
   ============================================ */

.resultats-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.criteres-rappel {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.tag {
    background: #f0e6db;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--accent);
}

.masque-lettre {
    display: inline-block;
    width: 1.4em;
    height: 1.4em;
    line-height: 1.4em;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    margin: 0 1px;
    font-size: 0.9rem;
}

.masque-lettre.remplie {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.btn-retour {
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}

.btn-retour:hover {
    text-decoration: underline;
}

/* --- TABLEAU --- */
.resultats-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.resultats-table th {
    background: var(--accent);
    color: white;
    padding: 0.7rem 0.8rem;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
}

.resultats-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.resultats-table th.sortable:hover {
    background: #704b30;
}

.sort-icon {
    font-size: 0.75rem;
    opacity: 0.5;
    margin-left: 0.3rem;
}

.resultats-table th.sort-asc .sort-icon,
.resultats-table th.sort-desc .sort-icon {
    opacity: 1;
}

.resultats-table td {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.resultats-table tbody tr:nth-child(even) {
    background: #faf7f4;
}

.resultats-table tbody tr:hover {
    background: #f0e6db;
}

.col-rang {
    width: 40px;
    text-align: center;
    color: var(--text-light);
}

.col-score {
    white-space: nowrap;
}

.etoile.pleine {
    color: var(--star);
}

.etoile.vide {
    color: #ddd;
}

.score-num {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-left: 0.3rem;
}

.col-nom {
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

.col-siecle, .col-dates {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* --- AUCUN RESULTAT --- */
.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.no-results p:first-child {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.no-results ul {
    list-style: none;
    margin-top: 0.5rem;
}

.no-results li::before {
    content: "- ";
}

/* ============================================
   PANNEAU BIO ARTISTE (slide-in)
   ============================================ */

.col-nom a {
    color: var(--accent);
    text-decoration: none;
    cursor: pointer;
}

.col-nom a:hover {
    text-decoration: underline;
}

.bio-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.bio-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.bio-panel {
    position: fixed;
    right: 0;
    top: 0;
    width: 420px;
    height: 100vh;
    background: var(--card);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease, width 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bio-panel.open {
    transform: translateX(0);
}

.bio-panel.expanded {
    width: 880px;
}

.bio-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 2px solid var(--accent-light);
}

.bio-panel-header h3 {
    font-size: 1.15rem;
    color: var(--accent);
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
    flex: 1;
    margin-right: 1rem;
}

.bio-panel-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

.bio-btn-images {
    background: none;
    border: 1.5px solid var(--accent-light);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.3rem 0.7rem;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.bio-btn-images:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.bio-btn-images.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* --- Corps du panel : bio + images cote a cote --- */
.bio-panel-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.bio-panel-bio {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* --- Volet images (iframe Bing) --- */
.bio-image-panel {
    display: none;
    width: 0;
    border-left: 2px solid var(--accent-light);
    transition: width 0.3s ease;
    overflow: hidden;
}

.bio-image-panel.visible {
    display: flex;
    flex-direction: column;
    width: 450px;
    flex-shrink: 0;
}

.bio-image-titre {
    padding: 0.6rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    font-style: italic;
    border-bottom: 1px solid var(--border);
    margin: 0;
    flex-shrink: 0;
}

/* --- Grille d'images (miniatures Bing) --- */
.bio-image-grid {
    flex: 1;
    overflow-y: auto;
    padding: 0.8rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-content: flex-start;
}

.bio-image-card {
    width: calc(50% - 0.25rem);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    background: #f5f0eb;
    display: block;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.bio-image-card:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.bio-image-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.bio-image-source {
    display: block;
    font-size: 0.65rem;
    color: var(--text-light);
    padding: 0.2rem 0.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: rgba(255,255,255,0.9);
}

.bio-image-more {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.8rem;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    border-top: 1px solid var(--border);
    margin-top: 0.3rem;
}

.bio-image-more:hover {
    background: var(--accent);
    color: white;
}

.bio-images-vide {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-light);
    font-style: italic;
    width: 100%;
}

/* --- Lightbox image plein ecran avec fond blur --- */
.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    cursor: pointer;
    padding: 2rem;
}

.image-lightbox.open {
    opacity: 1;
    pointer-events: auto;
}

.image-lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.image-lightbox-source {
    margin-top: 0.8rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.image-lightbox-source a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
}

.image-lightbox-source a:hover {
    color: white;
    text-decoration: underline;
}

.bio-panel-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

.bio-panel-close:hover {
    color: var(--accent);
}

.bio-panel-meta {
    padding: 0.8rem 1.5rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.bio-tag {
    background: #f0e6db;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 600;
}

.bio-tag.cache {
    background: #e8f5e9;
    color: var(--success);
}

.bio-tag.api {
    background: #e3f2fd;
    color: #1565c0;
}

.bio-panel-content {
    flex: 1;
    padding: 1rem 1.5rem 2rem;
    overflow-y: auto;
    line-height: 1.7;
    font-size: 0.95rem;
}

.bio-panel-content p {
    margin-bottom: 0.8rem;
}

.bio-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
    color: var(--text-light);
}

.bio-loading p {
    margin-top: 1rem;
    font-style: italic;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.bio-liens {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.bio-lien-externe {
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--accent-light);
    border-radius: 15px;
    transition: all 0.2s;
}

.bio-lien-externe:hover {
    background: var(--accent);
    color: white;
}

/* --- Section Drouot --- */
.drouot-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.drouot-section h4 {
    font-size: 0.95rem;
    color: var(--accent);
    margin-bottom: 0.6rem;
    font-weight: 600;
}

.drouot-count {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.drouot-lots {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.drouot-lots li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0ebe6;
}

.drouot-lots li:last-child {
    border-bottom: none;
}

.drouot-lots a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    display: block;
}

.drouot-lots a:hover {
    text-decoration: underline;
}

.drouot-desc {
    display: block;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.2rem;
    line-height: 1.4;
}

.drouot-vide {
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
}

/* --- Liens externes (Drouot, Invaluable...) --- */
.bio-liens-externes {
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.bio-liens-externes h4 {
    width: 100%;
    font-size: 0.9rem;
    color: var(--accent);
    margin-bottom: 0.3rem;
    font-weight: 600;
}

.bio-erreur {
    color: #c62828;
    font-style: italic;
}

/* Responsive : mobile general */
@media (max-width: 600px) {
    /* --- Formulaires / filtres mobile --- */
    .filtre-row {
        flex-wrap: wrap;
    }
    .filtre-row label {
        min-width: auto;
        width: 100%;
    }
    .input-nom {
        max-width: 100%;
    }
    .filtre-row select {
        max-width: 100%;
    }
    section {
        padding: 1rem;
    }

    /* --- Tableau resultats mobile --- */
    .resultats-table th,
    .resultats-table td {
        padding: 0.4rem 0.3rem;
        font-size: 0.8rem;
    }
    .col-rang {
        width: 25px;
    }
    .col-score {
        white-space: normal;
    }
    .col-score .etoile {
        font-size: 0.7rem;
    }
    .score-num {
        display: block;
        margin-left: 0;
        font-size: 0.65rem;
    }
    .col-nom {
        font-size: 0.8rem;
        letter-spacing: 0;
        word-break: break-word;
    }
    .col-nomcomplet {
        display: none;
    }
    .col-siecle, .col-dates {
        font-size: 0.75rem;
    }

    /* --- Bio panel mobile --- */
    .bio-panel {
        width: 100%;
    }
    .bio-panel.expanded {
        width: 100%;
    }
    .bio-panel-header {
        padding: 1rem;
        gap: 0.5rem;
    }
    .bio-panel-header h3 {
        font-size: 0.95rem;
        margin-right: 0.5rem;
    }
    .bio-panel-actions {
        flex-shrink: 0;
    }
    .bio-panel-body {
        flex-direction: column;
    }
    .bio-image-panel.visible {
        width: 100%;
        height: 45vh;
        border-left: none;
        border-top: 2px solid var(--accent-light);
        flex-shrink: 0;
    }
    .bio-image-card img {
        height: 100px;
    }
}

/* ============================================
   RECHERCHE EMPIRIQUE
   ============================================ */

/* --- Section compacte (intro + form fusionnes) --- */
.empirique-compact {
    padding: 1rem 2rem 1.2rem;
}

.empirique-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-light);
}

.empirique-header-row h2 {
    font-size: 1.1rem;
    color: var(--accent);
    margin: 0;
    padding: 0;
    border: none;
}

.empirique-btn-aide {
    background: none;
    border: 1.5px solid var(--accent-light);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.8rem;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.empirique-btn-aide:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* --- Popup aide avec blur --- */
.aide-overlay {
    position: fixed;
    inset: 0;
    z-index: 1500;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    cursor: pointer;
    padding: 1rem;
}

.aide-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.aide-popup {
    background: white;
    border-radius: 10px;
    padding: 1.5rem 2rem;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
    cursor: default;
}

.aide-popup h3 {
    font-size: 1.05rem;
    color: var(--accent);
    margin-bottom: 0.8rem;
}

.aide-popup ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.aide-popup li {
    padding: 0.4rem 0;
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.5;
    border-bottom: 1px solid #f0f0f0;
}

.aide-popup li:last-child {
    border-bottom: none;
}

.aide-popup kbd {
    display: inline-block;
    padding: 1px 6px;
    font-size: 0.82rem;
    font-family: 'Courier New', monospace;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-shadow: 0 1px 0 #bbb;
}

.aide-popup code {
    background: rgba(203, 25, 28, 0.1);
    color: var(--accent);
    padding: 1px 4px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-weight: 700;
}

.aide-fermer {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.8rem;
    font-style: italic;
}

/* --- Ligne 1 : Prenom + Nom --- */
.empirique-ligne-saisie {
    display: flex;
    gap: 1.5rem;
}

.empirique-champ {
    flex: 1;
    min-width: 200px;
}

.empirique-champ label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
    color: var(--accent);
}

.empirique-input-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.empirique-input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--border);
    border-radius: 6px;
    font-size: 1.4rem;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent);
    background: white;
    transition: all 0.2s;
}

.empirique-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(203, 25, 28, 0.12);
}

.empirique-input::placeholder {
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: none;
    color: #bbb;
}

.empirique-lettres {
    display: flex;
    gap: 3px;
    min-height: 28px;
    flex-wrap: wrap;
}

.empirique-lettre-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: var(--accent);
    color: white;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: 4px;
    line-height: 1;
}

.empirique-lettre-box.trou {
    background: #f0f0f0;
    color: #bbb;
    border: 2px dashed #ccc;
    font-size: 0.75rem;
}

/* --- Ligne 2 : Siecle + Compteur + Reset --- */
.empirique-ligne-filtres {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.8rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border);
}

.empirique-filtre-siecle {
    flex: 0 0 auto;
}

.empirique-filtre-siecle label {
    display: block;
    font-weight: 600;
    font-size: 0.82rem;
    margin-bottom: 0.3rem;
    color: var(--text-light);
}

.empirique-select {
    padding: 0.5rem 0.8rem;
    border: 2px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.empirique-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(203, 25, 28, 0.12);
}

.empirique-compteur {
    flex: 1;
    font-size: 1.1rem;
    text-align: center;
}

.empirique-compteur strong {
    color: var(--accent);
    font-size: 1.3rem;
}

.empirique-btn-reset {
    flex: 0 0 auto;
    padding: 0.5rem 1.2rem;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: white;
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.empirique-btn-reset:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: #fff5f5;
}

/* --- Resultats empiriques --- */
.empirique-resultats {
    min-height: 200px;
    padding: 0.5rem 1rem;
    margin-top: 0.5rem;
}

.empirique-trunc {
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
}

.empirique-searching {
    color: var(--text-light);
    font-style: italic;
}

.empirique-erreur {
    color: #c62828;
}

.empirique-vide {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-style: italic;
}

.empirique-table {
    margin-top: 0;
}

.empirique-table mark {
    background: rgba(203, 25, 28, 0.15);
    color: var(--accent);
    font-weight: 700;
    padding: 0 1px;
    border-radius: 2px;
}

.empirique-liste {
    max-height: 65vh;
    overflow-y: auto;
}

.empirique-liste::-webkit-scrollbar {
    width: 6px;
}

.empirique-liste::-webkit-scrollbar-thumb {
    background: var(--accent-light);
    border-radius: 3px;
}

@media (max-width: 600px) {
    .empirique-ligne-saisie {
        flex-direction: column;
        gap: 0.8rem;
    }
    .empirique-ligne-filtres {
        flex-wrap: wrap;
        gap: 0.8rem;
    }
    .empirique-compteur {
        order: -1;
        flex-basis: 100%;
        text-align: left;
    }
}

/* --- PAGES LÉGALES --- */
.legal-content h2 { font-size:1.2rem; margin:1.5rem 0 0.5rem; color:var(--text); }
.legal-content h3 { font-size:1rem; margin:1.2rem 0 0.4rem; color:var(--text); }
.legal-content p  { margin-bottom:0.8rem; line-height:1.7; color:var(--text); }
.legal-content ul, .legal-content ol { margin:0.5rem 0 0.8rem 1.5rem; line-height:1.7; }

/* --- FOOTER --- */
footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-light);
    font-size: 0.8rem;
}

/* ============================================
   MODALE INSCRIPTION
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-box {
    background: var(--card);
    border-radius: 12px;
    padding: 2rem;
    max-width: 420px;
    width: 100%;
    position: relative;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

.modal-box h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.modal-subtitle {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
}

.modal-close:hover { color: var(--text); }

.modal-box input[type="email"],
.modal-box input[type="text"],
.modal-box input[type="tel"] {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    background: var(--bg);
    color: var(--text);
}

.modal-error {
    color: #c0392b;
    font-size: 0.85rem;
    margin-bottom: 0.6rem;
}

.btn-primary {
    display: block;
    width: 100%;
    padding: 0.75rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    margin-bottom: 0.5rem;
}

.btn-primary:hover { background: #a81316; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
    display: block;
    width: 100%;
    padding: 0.6rem;
    background: transparent;
    color: var(--text-light);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    text-align: center;
}

.btn-secondary:hover { background: var(--bg); }

.profil-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.profil-niveau {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.profil-niveau label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    font-size: 0.9rem;
}

/* Billboard : pas de padding-bottom fixe nécessaire */

/* --- CGU / RGPD dans la modale --- */
.profil-cgu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.cgu-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1.4;
}

.cgu-label input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--accent);
}

.cgu-label a {
    color: var(--accent);
    text-decoration: underline;
}

/* Select région dans profil-grid */
.profil-grid select {
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    background: var(--bg);
    color: var(--text);
}

/* ============================================
   WIDGET MEMBRE FLOTTANT
   ============================================ */

#widget-membre {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 950;
}

#widget-toggle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

#widget-toggle:hover { background: #a81316; }

#widget-panel {
    position: absolute;
    bottom: 54px;
    right: 0;
    width: 300px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    overflow: hidden;
}

.widget-header {
    background: var(--accent);
    color: #fff;
    padding: 0.6rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.widget-header button {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
}

.widget-header button:hover { opacity: 1; }

.widget-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.widget-tab {
    flex: 1;
    padding: 0.5rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-light);
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
}

.widget-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

.widget-tab-content {
    padding: 0.75rem;
}

.widget-field {
    margin-bottom: 0.5rem;
}

.widget-field label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 0.2rem;
}

.widget-field input,
.widget-field select {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.85rem;
    background: var(--bg);
    color: var(--text);
}

/* Badge messages non lus admin */
.badge-count {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    border-radius: 10px;
    padding: 0 0.45rem;
    font-size: 0.7rem;
    font-weight: 700;
    vertical-align: middle;
    margin-left: 0.2rem;
}
