/* =====================================================
           Base
           ===================================================== */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;

    background: linear-gradient(180deg, #e1e5fe 0%, #c8cffe 100%);

    color: #1e293b;

    font-family: Arial, Helvetica, sans-serif;
}

#licence {
    text-decoration: none;
    color: #c00000;
    display: inline-block; /* nécessaire pour que le transform fonctionne correctement */
    transition: transform 0.3s ease;
}

#licence:hover {
    transform: scale(1.05);
}

#licence svg {
    flex-shrink: 0;
    position: relative;
    top: 3px;
}

#centrage-licence {
    text-align: center;
    margin-top: 20px;
    line-height: 1.3;
}

/* =====================================================
           Conteneur
           ===================================================== */

.page {
    width: min(1200px, calc(100% - 40px));
    margin: 0 auto;
    padding: 20px 0 60px;
}

/* =====================================================
           En-tête
           ===================================================== */

.hero {
    text-align: center;
    padding: 15px 20px 30px;
}

.hero h1 {
    margin: 0;

    color: #173b73;

    font-size: clamp(22px, 2.8vw, 30px);
    line-height: 1.3;
}

.hero-subtitle {
    max-width: 700px;
    margin: 15px auto 0;

    color: #64748b;

    font-size: 17px;
    line-height: 1.6;
}

/* =====================================================
           Recherche
           ===================================================== */

.search-panel {
    position: relative;

    background: #ffffff;

    /*border: 1px solid #d8e0ec;*/
    border-radius: 14px;
    padding: 48px 25px 48px 25px;

    /*box-shadow: 0 8px 25px rgba(30, 55, 90, 0.07); */
}

#main-panel-reference .search-panel {
    padding: 61px 25px 60px 25px;
}

.general-titulus-image {
    position: absolute;
    top: 30px;
    right: 40px;

    display: block;
    width: 220px;
    height: auto;

    object-fit: contain;
    pointer-events: none;
}

.search-title {
    margin-bottom: 14px;

    color: #173b73;

    font-size: 19px;
    font-weight: 700;
}

.search-form {
    display: flex;
    gap: 10px;
}

.search-input {
    flex: 1;

    min-width: 0;

    height: 42px;
    max-width: 750px;
    padding: 0 16px;

    border: 1px solid #eb837f;
    border-radius: 9px;

    background: #ffffff;

    color: #1e293b;

    font-size: 16px;

    outline: none;
}

.search-input:focus {
    border-color: #e55c57;

    box-shadow: 0 0 0 3px rgba(255, 178, 178, 0.22);
}

.search-button {
    height: 50px;

    padding: 0 24px;

    border: 0;
    border-radius: 9px;

    background: #245db7;

    color: #ffffff;

    font-size: 16px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.15s ease,
        transform 0.15s ease;
}

.search-button:hover {
    background: #d50000;
}

.search-button:active {
    transform: translateY(1px);
}

.search-help {
    margin-bottom: 14px;
    margin-top: 10px;
    color: #7b8798;

    font-size: 13px;
}

/* =====================================================
           Statistiques
           ===================================================== */

.stats {
    display: grid;

    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: 15px;

    margin-top: 20px;
}

.stat {
    background: #ffffff;

    border: 1px solid #d8e0ec;
    border-radius: 12px;

    padding: 20px;

    text-align: center;
}

.stat-number {
    display: block;

    color: #173b73;

    font-size: 28px;
    font-weight: 700;
}

.stat-label {
    display: block;

    margin-top: 4px;

    color: #64748b;

    font-size: 13px;
}

/* =====================================================
           Résultats
           ===================================================== */

.results {
    margin-top: 35px;
}

.results-header {
    display: flex;

    align-items: baseline;
    justify-content: space-between;

    gap: 15px;

    margin-bottom: 15px;
}

.results-title {
    margin: 0;

    color: #173b73;

    font-size: 23px;
}

.results-count {
    color: #64748b;

    font-size: 14px;
}

.result-search-icon {
    color: #6d85f3;
    display: inline-flex;
    transition: transform 0.2s ease;
}

.result-card:hover .result-search-icon {
    transform: scale(1.1);
    color: #f2422e;
}

.result-search-icon svg {
    stroke: currentColor;
}

/* =====================================================
           Carte résultat
           ===================================================== */

.result-card {
    display: block;

    margin-bottom: 14px;

    padding: 20px;

    background: #ffffff;

    border: 1px solid #d8e0ec;
    border-radius: 12px;

    text-decoration: none;

    color: inherit;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

.result-card:hover {
    border-color: #ff1f1f;

    box-shadow: 0 7px 20px rgba(30, 55, 90, 0.08);

    transform: translateY(-1px);
}

.result-top {
    display: flex;

    justify-content: space-between;
    align-items: flex-start;

    gap: 20px;
}

.result-hd {
    color: #173b73;

    font-size: 18px;
    font-weight: 700;
}

.result-location {
    margin-top: 4px;

    color: #475569;

    font-size: 15px;
}

.result-date {
    flex-shrink: 0;

    padding: 5px 9px;

    background: #eef3fa;

    border-radius: 6px;

    color: #365b8c;

    font-size: 13px;
}

.result-text {
    margin-top: 15px;

    color: #475569;

    font-family: Georgia, 'Times New Roman', serif;

    font-size: 15px;

    line-height: 1.6;
}

.result-meta {
    display: flex;

    flex-wrap: wrap;

    gap: 7px;

    margin-top: 15px;
}

.result-tag {
    padding: 4px 8px;

    background: #f1f4f8;

    border-radius: 5px;

    color: #64748b;

    font-size: 12px;
}

/* =====================================================
           État initial
           ===================================================== */

.welcome {
    margin-top: 35px;

    padding: 30px;

    background: #ffffff;

    border: 1px solid #d8e0ec;
    border-radius: 14px;

    text-align: center;
}

.welcome-icon {
    font-size: 34px;

    margin-bottom: 10px;
}

.welcome h2 {
    margin: 0 0 8px;

    color: #173b73;

    font-size: 21px;
}

.welcome p {
    max-width: 650px;

    margin: 0 auto;

    color: #64748b;

    line-height: 1.6;
}

/* =====================================================
           Aucun résultat
           ===================================================== */

.no-results {
    padding: 35px 20px;

    background: #ffffff;

    border: 1px solid #d8e0ec;
    border-radius: 12px;

    text-align: center;

    color: #64748b;
}

.no-results strong {
    display: block;

    margin-bottom: 6px;

    color: #334155;

    font-size: 17px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 30px 0;
    flex-wrap: wrap;
}

/* ============================================================
   RECHERCHE — champ + filtre images
   ============================================================ */

.search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto;
    column-gap: 14px;
    row-gap: 10px;
    align-items: center;
}

/* Champ de recherche */

.search-form .search-input {
    grid-column: 1;
    grid-row: 1;

    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* Filtre images */

.search-form .search-images-option {
    grid-column: 1;
    grid-row: auto;

    display: flex;
    align-items: center;

    width: fit-content;
    margin: 0;

    gap: 8px;

    font-size: 0.95rem;
    line-height: 1.4;
    color: #4b5563;

    cursor: pointer;
}

/* Case à cocher */

.search-form .search-images-option input[type='checkbox'] {
    width: 17px;
    height: 17px;

    margin: 0;

    flex: 0 0 auto;

    cursor: pointer;
}

/* Texte du filtre */

.search-form .search-images-option span {
    display: inline-block;
}

/* Bouton */

.search-form .search-button {
    grid-column: 2;
    grid-row: 1 / span 2;

    align-self: center;
    white-space: nowrap;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 800px;
}

.search-input-wrapper .search-input {
    flex: 1 1 auto;
    width: 100%;
    max-width: 750px;
    box-sizing: border-box;
    padding-right: 16px;
}

.search-icon-button {
    position: static;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    transform: none;
    background: #bdd1ff;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;
    border: 0;
    border-radius: 8px;

    color: #1b427d;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.15s ease;
}

.search-icon-button svg {
    width: 25px;
    height: 25px;

    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.search-icon-button:hover {
    background: #ff3f43;
    color: #fff;
}

.search-icon-button:active {
    transform: scale(0.94);
}

.search-icon-button:focus-visible {
    outline: 2px solid #3776d6;
    outline-offset: 2px;
}

/* Qualification des correspondances de recherche générale */
.search-match-label {
    display: inline-block;
    flex-shrink: 0;
    padding: 4px 9px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}

.search-match-exact {
    color: #176534;
    background-color: #d9f2df;
    border: 1px solid #a8ddb5;
}

.search-match-partial {
    color: #8a4b08;
    background-color: #ffedcc;
    border: 1px solid #f2d29a;
}

/* =========================================================
           Recherche par pays
           ========================================================= */

.country-search-panel {
    position: relative;

    margin-top: 16px;
    padding: 44px 25px 45px 25px;
    background: #ffffff;
    border-radius: 14px;
    /*box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04); */
}

/* Padding vertical spécifique à l'onglet Lieu antique */
.country-search-panel.ancient-place-active {
    padding-top: 32px;
    padding-bottom: 32px;
}

.country-search-form {
    margin-top: 16px;
}

.country-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
}

.country-tab {
    padding: 10px 22px;
    border: 1px solid #636bd9;
    border-bottom: 3px solid transparent;
    border-radius: 8px 8px 0 0;
    background: transparent;
    color: #58749a;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.country-tab:hover {
    background: #f1f5fb;
    color: #214a84;
}

.country-tab.active {
    border-bottom-color: #e00000;
    background: #f1f5fb;
    color: #173f76;
}

.country-tab-panel {
    display: none;
}

.country-tab-panel.active {
    display: block;
}

.country-tab-panel label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #214a84;
}

.country-select {
    border: 1px solid #eb837f;
    border-radius: 10px;
    background: #ffffff;
    color: #183f73;
    font-size: 15px;
    cursor: pointer;
}

.country-select:focus {
    outline: none;
    border-color: #e55c57;
    box-shadow: 0 0 0 3px rgba(255, 178, 178, 0.22);
}

.country-images-option {
    display: flex;
    align-items: center;
    gap: 8px;

    margin: 15px 0 0 0;
    color: #4b5563;
    font-size: 0.95rem;
    width: fit-content;

    cursor: pointer;
}

/* Case à cocher */

.country-images-option input[type='checkbox'] {
    width: 17px;
    height: 17px;
    margin: 0;
    flex: 0 0 auto;
    cursor: pointer;
}

/*
 * Select + bouton de recherche.
 *
 * L'image du monde est positionnée en absolu afin qu'elle
 * n'augmente pas la hauteur du panneau blanc.
 */

.country-select-wrapper {
    display: flex;
    align-items: center;
}

.country-select-area {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.country-select-wrapper .country-select {
    width: 700px;
    max-width: 700px;
    flex: 0 0 700px;
}

/*
 * Illustration à droite du select.
 * Elle est volontairement indépendante du flux du formulaire.
 */

.country-world-image {
    position: absolute;
    top: 30px;
    right: 40px;

    display: block;
    width: 220px;
    height: auto;

    object-fit: contain;
    pointer-events: none;
}

.country-search-icon-button {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: #b8cdf7;
    color: #173f76;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition:
        background 0.15s ease,
        transform 0.15s ease;
}

.country-search-icon-button:hover {
    background: #ff3f43;
    color: white;
}

.country-search-icon-button:active {
    transform: scale(0.97);
}

.country-search-icon-button:focus-visible {
    outline: 3px solid rgba(61, 115, 201, 0.25);
    outline-offset: 2px;
}

.country-search-icon-button svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Réduction de la hauteur de tous les menus déroulants */
select {
    width: 380px;
    height: 40px;
    min-height: 40px;
    padding-top: 4px;
    padding-bottom: 4px;
    /*box-sizing: border-box; */
}

/* Menus déroulants */
select.material-category-select {
    background-color: #ffffe0;
    color: #183f73;
}

#reference-type {
    background-color: #ffffe0;
    color: #183f73;
}

/* Correction du placement du filtre de matériaux dans la recherche générale. */
.search-panel .material-category-option {
    grid-column: 1 !important;
    justify-self: stretch;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.search-panel .material-category-select {
    max-width: 100%;
    box-sizing: border-box;
    margin-bottom: 15px;
}

label[for='country-europe'] {
    display: block;
}

.select-hors-europe {
    margin-bottom: 0px;
}

#country-panel-europe > label {
    margin-top: 0;
}

/* Aligne les filtres de matériau et de type d’inscription dans Recherche par pays. */
.country-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px 18px;
    width: 100%;
    margin-bottom: 12px;
}

.country-filter-row > label {
    display: block;
    flex: 0 1 340px;
    min-width: 0;
    margin: 10px;
}

.country-filter-row .material-category-select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* espace entre les deux select ONGLET RECHERCHE GENERALE */

#material-category-search {
    margin-right: 7px;
}

.material-category-option {
    margin-right: 7px;
}

.general-tab {
    margin-right: 24px;
}

#red {
    color: #d50000;
    font-weight: 600;
}

#filters-only:checked + #red {
    color: #3a5ad6;
    font-weight: 600;
}

#reference-search-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
}

#text-reference-button {
    margin-bottom: 1px;
}

#reference-search-button svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

#main-tab-reference {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#main-tab-reference svg {
    flex-shrink: 0;
    display: block;
}

.reference-results-summary {
    margin: 0 0 12px;
    padding: 12px 16px;
    background: #f2f5ff;
    border-left: 4px solid #f00000;
    border-radius: 4px;
    color: #09254b;
    font-size: 0.95rem;
}

.reference-results-explanation {
    margin: 6px 0 0;
    font-size: 0.9rem;
    line-height: 1.5;
    font-weight: normal;
}

/* Réduire la largeur des champs de recherche par référence */
#reference-cil-fields input,
#reference-ae-fields input {
    width: 80%;
    max-width: 130px;
}

.reference-info {
    position: relative;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-left: 4px;
    cursor: help;
    outline-offset: 3px;
}

.reference-info svg {
    display: block;
    flex-shrink: 0;
}

.reference-info-tooltip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    width: 280px;
    max-width: calc(100vw - 40px);
    padding: 10px 12px;
    background: #173b73;
    color: #ffffff;
    font-size: 13px;
    font-weight: normal;
    line-height: 1.5;
    text-align: left;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
    transition: opacity 0.2s ease;
}

.reference-info:hover .reference-info-tooltip,
.reference-info:focus .reference-info-tooltip {
    visibility: visible;
    opacity: 1;
}

.emoji-reference {
    font-size: 14px;
    margin-bottom: 2px;
}

.search-title svg {
    margin-bottom: 1px;
}

/*
  Export des 1000 premiers résultats en CSV et JSON
*/

.results-export {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
    margin-bottom: 14px;
    padding: 14px 18px;
    background: #f4f8fd;
    border: 1px solid #dbe7f5;
    border-radius: 12px;
    color: #17365f;
    font-size: 0.9rem;
}

.results-export-note {
    flex: 1 1 260px;
    margin: 0;
    color: #53677f;
    font-size: 0.85rem;
    line-height: 1.5;
}

@media (max-width: 600px) {
    .results-export {
        gap: 8px;
        padding: 12px;
    }

    .results-export a {
        flex: 1 1 calc(50% - 8px);
        text-align: center;
    }

    .results-export-note {
        flex-basis: 100%;
        text-align: center;
    }

    .results-export {
        gap: 8px;
        padding: 13px;
    }

    .results-export a {
        flex: 1 1 calc(50% - 8px);
        padding: 10px 8px;
    }

    #main-tab-reference {
    gap: 4px;
}

    .ancient-place-help {
        display:none;
    }

    /* Padding vertical spécifique à l'onglet Lieu antique */
    .country-search-panel.ancient-place-active {
        padding-top: 35px;
        padding-bottom: 35px;
    }

}

.results-export a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 14px;
    border: 1px solid #cbdcf0;
    border-radius: 8px;
    background: #fff;
    color: #174ea6;
    font-weight: 600;
    text-decoration: none;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.results-export a:hover {
    background: #e8f1ff;
    border-color: #8db7ef;
    transform: translateY(-1px);
}

.results-export a:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 3px;
}

/* ============================================================
   MOBILE
   ============================================================ */
@media (max-width: 700px) {
    .search-panel .material-category-option {
        grid-column: 1 / -1 !important;
    }

    .country-filter-row > label {
        flex-basis: 100%;
    }

    .country-tabs {
        width: 100%;
    }

    .country-tab {
        flex: 1;
        padding: 10px 8px;
    }

    .country-search-panel {
        padding: 35px 18px;
    }

    /*
     * Sur petit écran, on masque l'illustration afin qu'elle
     * ne réduise pas la largeur disponible pour le formulaire.
     */

    .country-world-image {
        display: none;
    }

    .country-select-wrapper .country-select {
        width: 100%;
        max-width: 700px;
        flex: 1 1 auto;
    }

    .country-select-area {
        width: 100%;
    }

    .search-form {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 10px;
    }

    .search-form .search-input {
        grid-column: 1;
        grid-row: 1;
    }

    .search-form .search-images-option {
        grid-column: 1;
        grid-row: auto;
    }

    .search-form .search-button {
        grid-column: 1;
        grid-row: 3;

        justify-self: start;
    }
}

@media (max-width: 500px) {
    .hero h1 {
        color: #173b73;
        font-size: clamp(18px, 2.1vw, 26px);
    }

    .search-title {
        font-size: 16px;
    }

    select {
        width: 300px;
    }

    #centrage-licence {
        margin-top: -10px;
    }

    /* Libellés raccourcis des onglets principaux sur smartphone */
    .country-tab.main-search-tab {
        font-size: 0;
    }

    .country-tab.main-search-tab::after {
        content: attr(data-mobile-label);
        font-size: 13px;
    }

    #main-panel-reference .search-panel {
        padding: 39px 25px 39px 25px;
    }

    #reference-hidden-smartphone {
        display: none;
    }
}
@media (max-width: 750px) {
    .page {
        width: min(100% - 24px, 1200px);

        padding-top: 20px;
    }

    .hero {
        padding-top: 20px;
    }

    .search-form {
        flex-direction: column;
    }

    .search-button {
        width: 100%;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .result-top {
        flex-direction: column;
        gap: 8px;
    }

    .result-date {
        align-self: flex-start;
    }

    .search-panel {
        background: #ffffff;

        padding: 27px 20px 27px 20px;
    }

    .country-filter-row {
        gap: 3px 12px;
        margin-bottom: 3px;
    }
}

@media (max-width: 800px) {
    .stat {
        display: none;
    }
}

@media (max-width: 1100px) {
    .country-world-image {
        display: none;
    }

    .general-titulus-image {
        display: none;
    }
}

/* Recherche sans texte : case à cocher et champ désactivé */
.search-filters-only-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    margin: 0 0 2px;
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.4;
    cursor: pointer;
}

.search-filters-only-option input[type='checkbox'] {
    width: 17px;
    height: 17px;
    margin: 0;
    flex: 0 0 auto;
    cursor: pointer;
}

.search-form .search-input:disabled {
    background-color: #e5e7eb;
    border-color: #cbd5e1;
    color: #64748b;
    cursor: not-allowed;
    opacity: 1;
    box-shadow: none;
}

/* Champ visuellement grisé et non modifiable en mode filtres seuls.
   La valeur technique « * » reste présente pour satisfaire les anciens validateurs. */
.search-form .search-input.filters-only-active {
    background-color: #e5e7eb;
    border-color: #cbd5e1;
    color: transparent;
    caret-color: transparent;
    cursor: not-allowed;
    opacity: 1;
    box-shadow: none;
}

/* -----------------------------------------------------------------
/* Recherche générale : input au-dessus des deux menus déroulants */

.search-panel .search-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 380px));
    column-gap: 12px;
    row-gap: 10px;
    align-items: start;
}

/* Input sur toute la largeur */
.search-panel .search-input-wrapper {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 750px;
    margin-bottom: 8px;
}

/* Deux menus côte à côte, avec une largeur de 380px */
.search-panel .material-category-option {
    grid-column: auto !important;
    justify-self: start;
    display: block;
    width: 350px;
    max-width: 100%;
    margin: 0;
}

/* Les menus remplissent leur conteneur */
.search-panel .material-category-select {
    display: block;
    width: 100%;
    max-width: 100%;
    margin-bottom: 0;
    box-sizing: border-box;
}

/* Cases à cocher sous les menus */
.search-panel .search-filters-only-option,
.search-panel .search-images-option {
    grid-column: 1 / -1;
}

/* Smartphone : menus empilés */
@media (max-width: 800px) {
    .search-panel .search-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .search-panel .material-category-option {
        grid-column: 1 !important;
        width: 100%;
    }

    .search-panel .search-input-wrapper {
        grid-column: 1;
    }
}

/* =========================================================
   Recherche par référence : espacement compact sur smartphone
   ========================================================= */

@media (max-width: 600px) {
    #reference-cil-fields,
    #reference-ae-fields {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        row-gap: 3px;
    }

    #reference-cil-fields label,
    #reference-ae-fields label {
        display: block;
        margin: 6px 0 0;
        line-height: 1.3;
    }

    #reference-cil-fields input,
    #reference-ae-fields input {
        display: block;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin: 0 0 5px;
    }

    #reference-search-button {
        width: 100%;
        margin-top: 8px;
    }
}

/* =========================================================
   CORRECTION : masquer le formulaire de référence inactif
   ========================================================= */

#reference-cil-fields[hidden],
#reference-ae-fields[hidden] {
    display: none !important;
}

/* Icône d'information et infobulle pour la première case à cocher */
.filters-info {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 2px;
    cursor: help;
    font-size: 14px;
    line-height: 1;
}

.filters-tooltip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%);

    width: 280px;
    padding: 10px 12px;

    background: #173b73;
    color: #ffffff;

    font-size: 13px;
    font-weight: normal;
    line-height: 1.5;
    text-align: left;

    border-radius: 7px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);

    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;

    z-index: 1000;
}

/* Petite flèche sous l'infobulle */
.filters-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #173b73;
}

/* Affichage au survol et au clavier */
.filters-info:hover .filters-tooltip,
.filters-info:focus .filters-tooltip,
.filters-info:focus-within .filters-tooltip {
    visibility: visible;
    opacity: 1;
}
/* LIEUX ANTIQUES */
.ancient-place-autocomplete { position: relative; }
.ancient-place-suggestions { position: absolute; z-index: 1000; top: calc(100% - 1px); left: 0; right: 44px; max-height: 260px; overflow-y: auto; margin: 0; padding: 4px 0; list-style: none; background: #fff; border: 1px solid #b9c4d5; border-radius: 0 0 6px 6px; box-shadow: 0 6px 16px rgba(0,0,0,.14); }
.ancient-place-suggestion { display: block; width: 100%; padding: 8px 12px; border: 0; background: transparent; color: #17233c; text-align: left; cursor: pointer; }
.ancient-place-suggestion:hover, .ancient-place-suggestion[aria-selected="true"] { background: #e8edff; }
.ancient-place-help { margin: 8px 0 0; font-size: .9em; color: #596579; }
#ancient-place-input { padding: 10px 10px 10px 5px; }
#ancient-place-input::placeholder { padding: 10px; opacity: 0.95; color: #183f73;}
