/*
 * Thème institutionnel e-Mercuriale, par-dessus Bootstrap 5.3.
 * Palette : vert institutionnel, couleurs du drapeau en accent, neutres sobres.
 */

:root {
    --gn-red: #ce1126;
    --gn-yellow: #fcd116;
    --gn-green: #009460;

    --em-green-950: #002618;
    --em-green-900: #00331f;
    --em-green-800: #00472f;
    --em-green-700: #005c3d;
    --em-green: #00704a;
    --em-green-100: #d7ebe2;
    --em-green-50: #eef6f2;
    --em-ink: #17211c;
    --em-muted: #56655e;
    --em-border: #dbe2de;
    --em-surface: #f4f6f5;
    --em-radius: .5rem;

    --bs-body-font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --bs-body-color: var(--em-ink);

    --bs-secondary-color: var(--em-muted);
    --bs-border-color: var(--em-border);
    --bs-primary: #00704a;
    --bs-primary-rgb: 0, 112, 74;
    --bs-link-color: #00704a;
    --bs-link-color-rgb: 0, 112, 74;
    --bs-link-hover-color: #00472f;
    --bs-link-hover-color-rgb: 0, 71, 47;
    --bs-focus-ring-color: rgba(0, 112, 74, .25);
}

body { -webkit-font-smoothing: antialiased; background-color: var(--em-surface); }

h1, h2, h3, .h1, .h2, .h3 { font-weight: 700; letter-spacing: -.01em; color: var(--em-ink); }

/* ---------- Boutons et contrôles ---------- */

.btn { font-weight: 600; border-radius: .375rem; }

.btn-primary {
    --bs-btn-bg: #00704a;
    --bs-btn-border-color: #00704a;
    --bs-btn-hover-bg: #00593b;
    --bs-btn-hover-border-color: #00593b;
    --bs-btn-active-bg: #00472f;
    --bs-btn-active-border-color: #00472f;
    --bs-btn-disabled-bg: #00704a;
    --bs-btn-disabled-border-color: #00704a;
    --bs-btn-focus-shadow-rgb: 0, 112, 74;
}

.btn-outline-primary {
    --bs-btn-color: #00704a;
    --bs-btn-border-color: #00704a;
    --bs-btn-hover-bg: #00704a;
    --bs-btn-hover-border-color: #00704a;
    --bs-btn-active-bg: #00593b;
    --bs-btn-active-border-color: #00593b;
    --bs-btn-focus-shadow-rgb: 0, 112, 74;
}

.btn-outline-secondary {
    --bs-btn-color: #3d4a44;
    --bs-btn-border-color: #c5cec9;
    --bs-btn-hover-bg: #eef1ef;
    --bs-btn-hover-color: #17211c;
    --bs-btn-hover-border-color: #b3beb8;
    --bs-btn-active-bg: #e2e7e4;
    --bs-btn-active-color: #17211c;
    --bs-btn-active-border-color: #b3beb8;
}

.btn-light-on-dark {
    --bs-btn-color: #fff;
    --bs-btn-border-color: rgba(255, 255, 255, .45);
    --bs-btn-hover-bg: rgba(255, 255, 255, .12);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-border-color: #fff;
}

.form-control, .form-select { border-color: #c9d2cd; background-color: #fff; }
.form-control:disabled { background-color: #eef1ef; }
.form-control:focus, .form-select:focus { border-color: #4f9c7f; box-shadow: 0 0 0 .2rem var(--bs-focus-ring-color); }
.form-select:disabled { background-color: #eef1ef; color: #8a968f; }
.form-label { font-weight: 600; font-size: .875rem; color: #2c3833; }
.input-group-text { background: #f1f4f2; border-color: #c9d2cd; color: var(--em-muted); }
.form-check-input:checked { background-color: #00704a; border-color: #00704a; }

.pagination {
    --bs-pagination-color: #00704a;
    --bs-pagination-hover-color: #00472f;
    --bs-pagination-active-bg: #00704a;
    --bs-pagination-active-border-color: #00704a;
    --bs-pagination-focus-box-shadow: 0 0 0 .2rem var(--bs-focus-ring-color);
}

/* ---------- Éléments communs ---------- */

.skip-link {
    position: absolute;
    left: -9999px;
    z-index: 2000;
    padding: .5rem 1rem;
    background: #fff;
    color: var(--em-green);
    font-weight: 600;
}
.skip-link:focus { left: 1rem; top: .5rem; }

.flag-bar { display: flex; height: 4px; }
.flag-bar span { flex: 1; }
.flag-bar span:nth-child(1) { background: var(--gn-red); }
.flag-bar span:nth-child(2) { background: var(--gn-yellow); }
.flag-bar span:nth-child(3) { background: var(--gn-green); }

.flag-mini { display: inline-flex; width: 21px; height: 14px; border-radius: 2px; overflow: hidden; flex: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
.flag-mini span { flex: 1; }
.flag-mini span:nth-child(1) { background: var(--gn-red); }
.flag-mini span:nth-child(2) { background: var(--gn-yellow); }
.flag-mini span:nth-child(3) { background: var(--gn-green); }

.logo-mark { display: inline-block; flex: none; line-height: 0; }
.logo-mark svg { display: block; }

.card {
    --bs-card-border-color: var(--em-border);
    --bs-card-border-radius: var(--em-radius);
    --bs-card-cap-bg: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 20, .04);
}
.card-header { padding: .85rem 1.25rem; }
.card-header h2, .card-title { font-size: 1rem; font-weight: 700; margin: 0; }

.code { font-family: var(--bs-font-monospace); font-size: .82em; white-space: nowrap; }
.amount { white-space: nowrap; font-variant-numeric: tabular-nums; }
.table td.amount, .table th.amount { text-align: right; }

.table { --bs-table-hover-bg: #f3f8f5; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .7rem .9rem; border-bottom-color: #e7ece9; }
.table thead th {
    background: #f6f8f7;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--em-muted);
    border-bottom: 1px solid var(--em-border);
    white-space: nowrap;
}
.table-light { --bs-table-bg: #f6f8f7; }

.badge { font-weight: 600; letter-spacing: .01em; }

.quality-eleve, .quality-high { color: #0b7a4b; border-color: #0b7a4b !important; }
.quality-moyen, .quality-medium { color: #8a6100; border-color: #b98a1c !important; }
.quality-faible, .quality-low { color: #b42318; border-color: #b42318 !important; }

.alert { border-radius: var(--em-radius); }

.empty-state { padding: 3rem 1rem; text-align: center; color: var(--em-muted); }
.empty-state .bi { font-size: 2rem; display: block; margin-bottom: .5rem; color: #9fb0a7; }

/* ---------- Site public : en-tête ---------- */

.gov-bar { background: var(--em-green-950); color: rgba(255, 255, 255, .82); font-size: .78rem; }
.gov-bar .container { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 34px; }
.gov-bar .motto { letter-spacing: .08em; text-transform: uppercase; font-size: .7rem; opacity: .8; }

.site-header { background: #fff; border-bottom: 1px solid var(--em-border); }
.site-header .container { display: flex; align-items: center; gap: 1.25rem; padding-top: 1rem; padding-bottom: 1rem; }

.institution-block { display: flex; flex-direction: column; line-height: 1.2; text-decoration: none; color: var(--em-ink); }
.institution-block .country { font-weight: 800; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; }
.institution-block .ministry { font-size: .78rem; color: var(--em-muted); max-width: 220px; }

.header-divider { width: 1px; align-self: stretch; background: var(--em-border); }

.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--em-ink); }
.brand-name { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.brand-name .prefix { color: var(--em-green); }
.brand-tagline { font-size: .78rem; color: var(--em-muted); margin-top: .2rem; }
.brand:hover .brand-name { color: var(--em-ink); }

.site-nav { background: var(--em-green-800); }
.site-nav .nav-link {
    color: rgba(255, 255, 255, .85);
    font-weight: 600;
    font-size: .9rem;
    padding: .8rem 1rem;
    border-bottom: 3px solid transparent;
}
.site-nav .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.site-nav .nav-link.active { color: #fff; border-bottom-color: var(--gn-yellow); }

.demo-banner { background: #fff8e1; border-bottom: 1px solid #f1d58a; color: #6b4e00; font-size: .85rem; }

/* ---------- Site public : bandeau de page ---------- */

.page-hero {
    background:
        radial-gradient(circle at 85% -20%, rgba(252, 209, 22, .14), transparent 45%),
        linear-gradient(135deg, var(--em-green-900) 0%, var(--em-green) 100%);
    color: #fff;
    padding: 2.75rem 0 4.5rem;
}
.page-hero .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--gn-yellow);
    margin-bottom: .75rem;
}
.page-hero h1 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.25rem); margin-bottom: .5rem; }
.page-hero .lead { color: rgba(255, 255, 255, .85); font-size: 1.05rem; max-width: 720px; }

.hero-search { max-width: 760px; margin-top: 1.5rem; }
.hero-search .form-control, .hero-search .input-group-text, .hero-search .btn { height: 3.25rem; border: 0; }
.hero-search .input-group-text { background: #fff; padding-left: 1.1rem; }
.hero-search .form-control { font-size: 1.05rem; }
.hero-search .form-control:focus { box-shadow: none; }
.hero-search .input-group { border-radius: .5rem; overflow: hidden; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.hero-search .btn { padding: 0 1.5rem; background: var(--gn-yellow); color: #1b1b1b; border-radius: 0; }
.hero-search .btn:hover { background: #f0c400; }

.page-hero-compact { padding: 1.75rem 0 3.75rem; }

.overlap { margin-top: -2.75rem; position: relative; }

.edition-strip { display: flex; flex-wrap: wrap; background: #fff; border: 1px solid var(--em-border); border-radius: var(--em-radius); box-shadow: 0 4px 16px rgba(16, 24, 20, .06); }
.edition-strip > div { flex: 1 1 150px; padding: .9rem 1.25rem; border-right: 1px solid #edf1ee; }
.edition-strip > div:last-child { border-right: 0; }
.edition-strip .label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--em-muted); font-weight: 600; }
.edition-strip .value { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.filter-panel { background: #fff; border: 1px solid var(--em-border); border-radius: var(--em-radius); padding: 1.1rem 1.25rem; }
.filter-panel .form-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--em-muted); margin-bottom: .3rem; }
.filter-bar { background: #fff; border: 1px solid var(--em-border); border-radius: var(--em-radius); padding: .75rem; }

.results-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; margin: 1.5rem 0 .75rem; }
.results-header h2 { font-size: 1.1rem; margin: 0; }

.item-link { font-weight: 600; color: var(--em-ink); text-decoration: none; }
.item-link:hover { color: var(--em-green); text-decoration: underline; }

.median-cell { font-size: 1.02rem; font-weight: 700; color: var(--em-green-800); }

.notice {
    display: flex;
    gap: .75rem;
    background: var(--em-green-50);
    border: 1px solid var(--em-green-100);
    border-radius: var(--em-radius);
    padding: .9rem 1.1rem;
    font-size: .86rem;
    color: #2b3d34;
}
.notice .bi { color: var(--em-green); font-size: 1.1rem; }
.notice-warning { background: #fff8e6; border-color: #f3dc9b; }
.notice-warning > .bi { color: #b7791f; }

/* Historique d'une demande d'homologation */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; display: flex; gap: .75rem; padding-bottom: 1rem; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: .95rem; top: 2rem; bottom: 0; border-left: 2px solid var(--em-border); }
.timeline .timeline-icon { flex: none; width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center; background: var(--em-green-50); color: var(--em-green); }
.timeline li.is-internal .timeline-icon { background: #fff8e6; color: #b7791f; }
.timeline .timeline-body { flex: 1; min-width: 0; font-size: .9rem; }
.timeline .timeline-meta { font-size: .78rem; color: var(--em-muted); }

.breadcrumb { --bs-breadcrumb-divider-color: rgba(255, 255, 255, .5); --bs-breadcrumb-item-active-color: rgba(255, 255, 255, .85); font-size: .85rem; margin-bottom: 1rem; }
.page-hero .breadcrumb a { color: rgba(255, 255, 255, .85); text-decoration: none; }
.page-hero .breadcrumb a:hover { color: #fff; text-decoration: underline; }

.code-chip { display: inline-block; font-family: var(--bs-font-monospace); font-size: .8rem; padding: .2rem .55rem; border-radius: .3rem; background: rgba(255, 255, 255, .14); color: #fff; }

.price-panel { background: #fff; border: 1px solid var(--em-border); border-top: 4px solid var(--em-green); border-radius: var(--em-radius); padding: 1.4rem; box-shadow: 0 4px 16px rgba(16, 24, 20, .06); }
.price-panel .label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--em-muted); }
.price-panel .value { font-size: 2.1rem; font-weight: 800; color: var(--em-green-800); line-height: 1.15; font-variant-numeric: tabular-nums; }

.spec-list dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--em-muted); font-weight: 700; }
.spec-list dd { margin-bottom: .9rem; }

.prose { max-width: 820px; }
.prose h2 { font-size: 1.25rem; margin-top: 2rem; padding-top: .25rem; }
.prose p, .prose li { line-height: 1.65; }

/* ---------- Site public : pied de page ---------- */

.site-footer { background: var(--em-green-950); color: rgba(255, 255, 255, .78); font-size: .88rem; margin-top: 3rem; }
.site-footer h2 { color: #fff; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .9rem; }
.site-footer a { color: rgba(255, 255, 255, .85); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
/* padding vertical seulement : le padding horizontal du .container compense les marges des .row */
.site-footer .footer-main { padding-top: 2.5rem; padding-bottom: 2rem; }
.site-footer .footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 1rem; padding-bottom: 1rem; font-size: .78rem; color: rgba(255, 255, 255, .6); }
.site-footer .brand-name { color: #fff; font-size: 1.25rem; }
.site-footer .brand-name .prefix { color: var(--gn-yellow); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .45rem; }

/* ---------- Page de connexion ---------- */

.auth-page { min-height: 100vh; display: flex; }
.auth-aside {
    flex: 0 0 44%;
    background:
        radial-gradient(circle at 10% 110%, rgba(252, 209, 22, .16), transparent 45%),
        linear-gradient(160deg, var(--em-green-950) 0%, var(--em-green) 100%);
    color: #fff;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.auth-aside .brand-name { color: #fff; font-size: 1.6rem; }
.auth-aside .brand-name .prefix { color: var(--gn-yellow); }
.auth-aside h1 { color: #fff; font-size: 1.9rem; max-width: 420px; }
.auth-aside p { color: rgba(255, 255, 255, .8); max-width: 420px; }
.auth-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; background: #fff; }
.auth-card { width: 100%; max-width: 400px; }
@media (max-width: 991.98px) {
    .auth-page { flex-direction: column; }
    .auth-aside { flex: none; padding: 1.5rem; }
    .auth-aside .auth-pitch, .auth-aside .auth-legal { display: none; }
}

/* ---------- Back-office ---------- */

.admin-shell { display: flex; min-height: 100vh; }

.admin-sidebar {
    --bs-offcanvas-width: 264px;
    --bs-offcanvas-bg: var(--em-green-950);
    width: 264px;
    flex: none;
    /* En image : Bootstrap force un fond transparent sur .offcanvas-lg en grand écran. */
    background-image: linear-gradient(var(--em-green-950), var(--em-green-950));
    color: rgba(255, 255, 255, .8);
}
@media (min-width: 992px) {
    .admin-sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; }
}
.admin-sidebar .sidebar-brand { display: flex; align-items: center; gap: .65rem; padding: 1.1rem 1.25rem; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.admin-sidebar .sidebar-brand .brand-name { color: #fff; font-size: 1.15rem; }
.admin-sidebar .sidebar-brand .brand-name .prefix { color: var(--gn-yellow); }
.admin-sidebar .sidebar-brand small { display: block; color: rgba(255, 255, 255, .55); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; margin-top: .15rem; }
.admin-sidebar .nav-section { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: rgba(255, 255, 255, .45); padding: 1.1rem 1.25rem .4rem; }
.admin-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    color: rgba(255, 255, 255, .8);
    padding: .55rem 1.25rem;
    font-size: .9rem;
    border-left: 3px solid transparent;
}
.admin-sidebar .nav-link .bi { font-size: 1rem; opacity: .85; }
.admin-sidebar .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.admin-sidebar .nav-link.active { color: #fff; background: rgba(255, 255, 255, .09); border-left-color: var(--gn-yellow); font-weight: 600; }
.admin-sidebar .sidebar-footer { padding: 1rem 1.25rem; font-size: .75rem; color: rgba(255, 255, 255, .45); border-top: 1px solid rgba(255, 255, 255, .08); }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar { background: #fff; border-bottom: 1px solid var(--em-border); position: sticky; top: 0; z-index: 1020; }
.admin-topbar .inner { display: flex; align-items: center; gap: .75rem; padding: .6rem 1.5rem; min-height: 60px; }
.admin-topbar .context { font-size: .8rem; color: var(--em-muted); }
.admin-topbar .context strong { color: var(--em-ink); }
.admin-content { padding: 1.75rem 1.5rem 3rem; max-width: 1400px; width: 100%; }
.user-chip { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--em-ink); }
.user-chip .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--em-green-100); color: var(--em-green-800); display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.user-chip .who { line-height: 1.15; font-size: .85rem; }
.user-chip .who small { color: var(--em-muted); font-size: .72rem; }

.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.6rem; margin: 0; }
.page-header .subtitle { font-size: .85rem; color: var(--em-muted); margin-top: .2rem; }

.stat-card { position: relative; }
.stat-card .card-body { padding: 1.1rem 1.25rem; }
.stat-card .label { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--em-muted); font-weight: 600; }
.stat-card .value { font-size: 1.75rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: .2rem; }
.stat-card .icon-tile { width: 42px; height: 42px; border-radius: .5rem; display: grid; place-items: center; background: var(--em-green-50); color: var(--em-green); font-size: 1.2rem; }
.stat-card:hover { border-color: #b7c9bf; }

.form-card { max-width: 900px; }
.form-card .card-body { padding: 1.5rem 1.75rem; }
.form-section { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--em-green); margin: 1.25rem 0 1rem; padding-bottom: .5rem; border-bottom: 1px solid #e7ece9; }
.form-section:first-child { margin-top: 0; }
.form-actions { display: flex; justify-content: flex-end; gap: .5rem; padding-top: 1.25rem; margin-top: .5rem; border-top: 1px solid #e7ece9; }

.price-highlight { border-left: 4px solid #00704a; background: var(--em-green-50); }

.audit-values { font-size: .8rem; max-width: 420px; }
.audit-values dt { font-weight: 600; }
.audit-values dd { margin-bottom: .25rem; word-break: break-word; }

/* ---------- Impression ---------- */

@media print {
    .gov-bar, .site-nav, .site-footer, .admin-sidebar, .admin-topbar, .btn, .filter-panel, .hero-search { display: none !important; }
    .page-hero { background: none; color: #000; padding: 0 0 1rem; }
    .page-hero h1, .page-hero .lead { color: #000; }
    .overlap { margin-top: 0; }
}

/* ---------- En-tête : logo du ministère ---------- */

.institution-logo { display: block; max-width: 240px; object-fit: contain; }
.institution-text { display: flex; flex-direction: column; line-height: 1.2; }
.site-nav .nav { overflow-x: auto; scrollbar-width: none; }
.site-nav .nav::-webkit-scrollbar { display: none; }
.site-nav .nav-link { white-space: nowrap; }

/* ---------- Accueil ---------- */

.home-hero { padding: 3.5rem 0 5rem; }
.home-hero h1 { font-size: clamp(1.9rem, 4vw, 2.9rem); line-height: 1.15; }

.home-section { padding: 4.5rem 0; }
/* Les animations d'entrée (cartes décalées de 60 px) ne doivent pas élargir la page sur mobile */
.home-section, .auth-page { overflow-x: clip; }
.home-section-tinted { background: #fff; border-top: 1px solid var(--em-border); border-bottom: 1px solid var(--em-border); }
.section-eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--em-green); margin-bottom: .5rem; }
.section-title { font-size: clamp(1.5rem, 2.6vw, 2rem); margin-bottom: 1rem; }
.home-section p { line-height: 1.7; }

.president-figure { margin: 0 auto; position: relative; max-width: 340px; }
.president-figure img, .president-placeholder {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: var(--em-radius);
    box-shadow: 0 12px 32px rgba(16, 24, 20, .15);
}
.president-placeholder {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .75rem;
    background: repeating-linear-gradient(45deg, #eef2f0, #eef2f0 12px, #e6ebe8 12px, #e6ebe8 24px);
    border: 2px dashed #b9c6bf; color: var(--em-muted); text-align: center; font-size: .85rem; padding: 1rem;
}
.president-placeholder .bi { font-size: 3rem; color: #9fb0a7; }
.president-figure figcaption {
    color: var(--em-ink);
    margin-top: -2.25rem; margin-left: 1rem; margin-right: 1rem; position: relative;
    background: #fff; border-left: 4px solid var(--em-green); border-radius: .375rem;
    padding: .7rem 1rem; box-shadow: 0 6px 18px rgba(16, 24, 20, .12);
}
.president-figure figcaption strong { display: block; font-size: 1rem; }
.president-figure figcaption span { font-size: .82rem; color: var(--em-muted); }

.official-quote { border-left: 4px solid var(--gn-yellow); padding: .5rem 0 .5rem 1.25rem; margin: 0 0 1.5rem; }
.official-quote p { font-size: 1.15rem; font-style: italic; color: var(--em-green-800); margin-bottom: .4rem; }
.official-quote footer { font-size: .85rem; color: var(--em-muted); }

.pillar { height: 100%; background: var(--em-surface); border: 1px solid var(--em-border); border-radius: var(--em-radius); padding: 1.5rem; }
.pillar h3 { font-size: 1.05rem; margin: 1rem 0 .5rem; }
.pillar p { font-size: .92rem; color: #3d4a44; margin: 0; line-height: 1.6; }
.pillar-icon { width: 46px; height: 46px; flex: none; border-radius: .6rem; display: inline-grid; place-items: center; background: var(--em-green); color: #fff; font-size: 1.3rem; }

.report-band {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem;
    background: linear-gradient(135deg, var(--em-green-900), var(--em-green));
    color: #fff; border-radius: var(--em-radius); padding: 1.75rem 2rem;
}
.report-band h3 { color: #fff; font-size: 1.25rem; margin-bottom: .3rem; }
.report-band p { color: rgba(255, 255, 255, .85); }
.btn-warning { --bs-btn-bg: var(--gn-yellow); --bs-btn-border-color: var(--gn-yellow); --bs-btn-hover-bg: #f0c400; --bs-btn-hover-border-color: #f0c400; --bs-btn-color: #1b1b1b; --bs-btn-hover-color: #1b1b1b; }

.service-card {
    display: flex; align-items: center; gap: 1rem; height: 100%;
    background: #fff; border: 1px solid var(--em-border); border-radius: var(--em-radius);
    padding: 1.25rem; text-decoration: none; color: var(--em-ink); transition: border-color .15s, box-shadow .15s, transform .15s;
}
.service-card strong { display: block; margin-bottom: .2rem; }
.service-card span span { display: block; font-size: .87rem; color: var(--em-muted); }
.service-card .pillar-icon { background: var(--em-green-50); color: var(--em-green); }
.service-card-featured { border-color: #9cc5b3; background: linear-gradient(90deg, var(--em-green-50), #fff 60%); }
.service-card-featured .pillar-icon { background: var(--em-green); color: #fff; }
.service-card-featured strong { font-size: 1.1rem; }
.service-card:hover { border-color: #9cc5b3; box-shadow: 0 8px 20px rgba(16, 24, 20, .08); transform: translateY(-2px); color: var(--em-ink); }

/* ---------- Pages de service (formulaires) ---------- */

.side-panel { background: #fff; border: 1px solid var(--em-border); border-top: 4px solid var(--em-green); border-radius: var(--em-radius); padding: 1.4rem; }
.side-panel h2 { font-size: 1rem; margin-bottom: 1rem; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0 0 1rem; }
.steps li { counter-increment: step; position: relative; padding: 0 0 .9rem 2.4rem; font-size: .9rem; }
.steps li::before {
    content: counter(step); position: absolute; left: 0; top: -.1rem;
    width: 1.7rem; height: 1.7rem; border-radius: 50%; display: grid; place-items: center;
    background: var(--em-green-50); color: var(--em-green); font-weight: 700; font-size: .8rem;
}
.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li { display: flex; gap: .6rem; margin-bottom: .7rem; font-size: .92rem; }
.contact-list .bi { color: var(--em-green); }

.choice-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .75rem; }
.choice-card { display: flex; gap: .75rem; align-items: flex-start; border: 1px solid #c9d2cd; border-radius: var(--em-radius); padding: .9rem 1rem; cursor: pointer; background: #fff; }
.choice-card small { display: block; color: var(--em-muted); margin-top: .15rem; }
.choice-card.selected { border-color: var(--em-green); background: var(--em-green-50); box-shadow: 0 0 0 1px var(--em-green); }
.choice-card .form-check-input { margin-top: .2rem; flex: none; }

.published-price { background: var(--em-green-50); border: 1px solid var(--em-green-100); border-radius: .375rem; padding: .6rem .9rem; font-size: .92rem; }

.success-icon { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: var(--em-green); color: #fff; font-size: 2rem; }
.tracking-number { font-family: var(--bs-font-monospace); font-size: 1.6rem; font-weight: 700; color: var(--em-green-800); letter-spacing: .04em; }

.status-steps { display: flex; list-style: none; padding: 0; gap: .5rem; }
.status-steps li { flex: 1; text-align: center; font-size: .8rem; color: var(--em-muted); padding-top: .9rem; border-top: 4px solid #e2e7e4; }
.status-steps li.done { border-top-color: var(--em-green); color: var(--em-ink); font-weight: 600; }

.audience { display: flex; gap: .75rem; align-items: flex-start; border: 1px solid var(--em-border); border-radius: var(--em-radius); padding: .9rem 1rem; height: 100%; }
.audience .bi { font-size: 1.4rem; color: var(--em-green); }

.faq .accordion-button { font-weight: 600; }
.faq .accordion-button:not(.collapsed) { background: var(--em-green-50); color: var(--em-green-800); box-shadow: none; }
.faq .accordion-button:focus { box-shadow: 0 0 0 .2rem var(--bs-focus-ring-color); }
.faq .accordion-body { line-height: 1.65; }

button.stat-card { cursor: pointer; padding: 0; }

/* ---------- Marques : Guinée, Simandou 2040 ---------- */

.brand-logo { display: block; object-fit: contain; }
.header-brands { padding-right: .75rem; border-right: 1px solid var(--em-border); }

.footer-brands { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; padding-bottom: 1.5rem; }
.brand-chip { display: inline-flex; align-items: center; gap: 1.25rem; background: #fff; border-radius: var(--em-radius); padding: .6rem 1rem; }

.simandou-card {
    background: #fff;
    border: 1px solid var(--em-border);
    border-top: 4px solid #1fb5ad;
    border-radius: var(--em-radius);
    padding: 1.75rem;
    box-shadow: 0 8px 24px rgba(16, 24, 20, .07);
}
.simandou-card h3 { font-size: 1.2rem; color: #2b1a2e; }
.simandou-card p { color: #3d4a44; font-size: .95rem; }
.simandou-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid #edf1ee; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--em-muted); }

/* ---------- Bandeau d'accueil animé ---------- */

.home-hero { position: relative; overflow: hidden; padding-bottom: 0; }
.home-hero > .container { padding-bottom: 5.5rem; }

.hero-decor { position: absolute; inset: 0; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .35; }
.orb-yellow { width: 420px; height: 420px; background: var(--gn-yellow); top: -160px; right: 8%; opacity: .22; animation: drift 18s ease-in-out infinite alternate; }
.orb-red { width: 300px; height: 300px; background: var(--gn-red); bottom: -140px; left: -80px; opacity: .2; animation: drift 22s ease-in-out infinite alternate-reverse; }
.orb-green { width: 360px; height: 360px; background: #19c37d; top: 30%; left: 35%; opacity: .14; animation: drift 26s ease-in-out infinite alternate; }
.hero-grid {
    position: absolute; inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at 70% 40%, #000 0%, transparent 70%);
    animation: grid-pan 30s linear infinite;
}
@keyframes drift {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(60px, 40px) scale(1.15); }
}
@keyframes grid-pan {
    from { background-position: 0 0, 0 0; }
    to { background-position: 48px 48px, 48px 48px; }
}

/* Apparition échelonnée des éléments (--d : rang) */
.reveal { opacity: 0; animation: reveal-up .8s cubic-bezier(.2, .7, .2, 1) forwards; animation-delay: calc(var(--d, 0) * 120ms + 100ms); }
@keyframes reveal-up {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: none; }
}

.hero-highlight {
    background: linear-gradient(90deg, var(--gn-yellow), #fff3a6, var(--gn-yellow));
    background-size: 200% auto;
    -webkit-background-clip: text; background-clip: text; color: transparent;
    animation: shine 6s linear infinite;
}
@keyframes shine { to { background-position: 200% center; } }

.hero-search .btn { position: relative; overflow: hidden; }
.hero-search .btn::after {
    content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .6), transparent);
    transform: skewX(-20deg);
    animation: sweep 4s ease-in-out 2s infinite;
}
@keyframes sweep { 0%, 70% { left: -60%; } 100% { left: 130%; } }

/* Prix qui défilent en bas du bandeau */
.price-ticker { position: relative; display: flex; align-items: stretch; background: rgba(0, 0, 0, .28); border-top: 1px solid rgba(255, 255, 255, .1); backdrop-filter: blur(4px); }
.ticker-label { flex: none; display: flex; align-items: center; gap: .4rem; padding: .7rem 1.1rem; background: var(--gn-yellow); color: #1b1b1b; font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.ticker-label .bi { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.ticker-viewport { overflow: hidden; flex: 1; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.ticker-track { display: flex; width: max-content; animation: ticker 60s linear infinite; }
.price-ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item { display: inline-flex; align-items: baseline; gap: .4rem; padding: .7rem 1.6rem; color: rgba(255, 255, 255, .85); text-decoration: none; font-size: .88rem; white-space: nowrap; border-right: 1px solid rgba(255, 255, 255, .1); }
.ticker-item strong { color: #fff; }
.ticker-item span { font-size: .75rem; color: rgba(255, 255, 255, .6); }
.ticker-item:hover { color: #fff; background: rgba(255, 255, 255, .06); }
@keyframes ticker { to { transform: translateX(-50%); } }

.home-hero + .overlap { margin-top: 1.75rem; }

/* Respect du réglage « réduire les animations » du système */
@media (prefers-reduced-motion: reduce) {
    .reveal { animation: none; opacity: 1; transform: none; }
    .orb, .hero-grid, .hero-highlight, .hero-search .btn::after, .ticker-label .bi { animation: none; }
    .ticker-track { animation: none; }
    .ticker-viewport { overflow-x: auto; }
}

/* ---------- En-tête fixe, réduit au défilement ---------- */

.site-top { position: sticky; top: 0; z-index: 1030; box-shadow: 0 0 0 rgba(0, 0, 0, 0); transition: box-shadow .25s; }
.site-top.is-scrolled { box-shadow: 0 6px 20px rgba(0, 20, 12, .18); }
.site-header .container { transition: padding .25s; }
.site-top.is-scrolled .site-header .container { padding-top: .4rem; padding-bottom: .4rem; }
.institution-logo, .site-header .brand-logo, .site-header .logo-mark, .site-header .logo-mark svg { transition: height .25s, width .25s; }
.site-top.is-scrolled .institution-logo { height: 52px !important; }
.site-top.is-scrolled .site-header .brand-logo { height: 34px !important; }
.site-top.is-scrolled .brand-tagline { display: none !important; }
.header-brands .brand-logo-simandou { height: 50px !important; }
.site-top.is-scrolled .header-brands .brand-logo-simandou { height: 38px !important; }

/* ---------- Menu principal : horizontal sur grand écran, déroulant sur mobile ---------- */

.site-nav.navbar { --bs-navbar-padding-y: 0; }
.site-nav .navbar-nav .nav-link { color: rgba(255, 255, 255, .85); font-weight: 600; font-size: .9rem; padding: .8rem 1rem; border-bottom: 3px solid transparent; }
.site-nav .navbar-nav .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.site-nav .navbar-nav .nav-link.active { color: #fff; border-bottom-color: var(--gn-yellow); }
.site-nav .dropdown-toggle { background: none; border-top: 0; border-left: 0; border-right: 0; }
@media (min-width: 992px) and (max-width: 1199.98px) {
    .site-nav .navbar-nav .nav-link { padding-left: .5rem; padding-right: .5rem; font-size: .84rem; }
}
.site-nav .dropdown-toggle::after { vertical-align: .15em; margin-left: .4em; }

/* Sous-menu : entrée avec icône, titre et courte description */
.nav-submenu { min-width: 300px; padding: .4rem; margin-top: 0 !important; border: 0; border-radius: 0 0 .6rem .6rem; box-shadow: 0 12px 28px rgba(0, 0, 0, .16); }
.nav-submenu .dropdown-item { display: flex; align-items: flex-start; gap: .75rem; padding: .65rem .75rem; border-radius: .45rem; white-space: normal; color: var(--em-ink); }
.nav-submenu .dropdown-item > i { font-size: 1.15rem; color: var(--em-green); line-height: 1.3; }
.nav-submenu .dropdown-item strong { display: block; font-size: .92rem; }
.nav-submenu .dropdown-item small { display: block; color: var(--bs-secondary-color); font-size: .8rem; }
.nav-submenu .dropdown-item:hover, .nav-submenu .dropdown-item:focus { background: var(--em-green-50, #eef6f1); }
.nav-submenu .dropdown-item.active { background: var(--em-green-50, #eef6f1); box-shadow: inset 3px 0 0 var(--gn-yellow); }

.menu-toggle {
    display: inline-flex; align-items: center; gap: .5rem;
    border: 1px solid var(--em-border); background: #fff; border-radius: .5rem;
    padding: .5rem .75rem; color: var(--em-ink); font-weight: 600; font-size: .85rem;
}
.menu-toggle:focus-visible { outline: 3px solid var(--bs-focus-ring-color); }
.menu-toggle-bars { position: relative; width: 20px; height: 14px; display: inline-block; }
.menu-toggle-bars span { position: absolute; left: 0; width: 100%; height: 2px; border-radius: 2px; background: var(--em-green); transition: transform .25s, opacity .2s, top .25s; }
.menu-toggle-bars span:nth-child(1) { top: 0; }
.menu-toggle-bars span:nth-child(2) { top: 6px; }
.menu-toggle-bars span:nth-child(3) { top: 12px; }
.menu-toggle.is-open .menu-toggle-bars span:nth-child(1) { top: 6px; transform: rotate(45deg); }
.menu-toggle.is-open .menu-toggle-bars span:nth-child(2) { opacity: 0; }
.menu-toggle.is-open .menu-toggle-bars span:nth-child(3) { top: 6px; transform: rotate(-45deg); }

@media (max-width: 991.98px) {
    .site-header .container { gap: .75rem; }
    .site-nav .navbar-collapse { max-height: calc(100vh - 90px); overflow-y: auto; }
    .site-nav .navbar-nav { padding: .5rem 0; }
    .site-nav .navbar-nav .nav-link { border-bottom: 0; border-left: 3px solid transparent; padding: .85rem 1rem; font-size: 1rem; }
    .site-nav .navbar-nav .nav-link.active { border-left-color: var(--gn-yellow); background: rgba(255, 255, 255, .07); }
    .site-nav .navbar-nav .nav-item + .nav-item { border-top: 1px solid rgba(255, 255, 255, .08); }
    .site-nav .dropdown-toggle { width: 100%; text-align: left; }
    .nav-submenu { background: transparent; box-shadow: none; padding: 0 0 .5rem 1rem; min-width: 0; }
    .nav-submenu .dropdown-item { color: rgba(255, 255, 255, .85); }
    .nav-submenu .dropdown-item > i { color: var(--gn-yellow); }
    .nav-submenu .dropdown-item small { color: rgba(255, 255, 255, .6); }
    .nav-submenu .dropdown-item:hover, .nav-submenu .dropdown-item:focus, .nav-submenu .dropdown-item.active { background: rgba(255, 255, 255, .07); color: #fff; }
    .mobile-menu-extra { padding: 1rem 0 1.25rem; border-top: 1px solid rgba(255, 255, 255, .12); }
    .institution-logo { height: 58px !important; }
    .site-top.is-scrolled .institution-logo { height: 44px !important; }
}
@media (max-width: 575.98px) {
    .brand-name { font-size: 1.2rem; }
    .site-header .logo-mark, .site-header .logo-mark svg { width: 38px !important; height: 38px !important; }
    .menu-toggle-label { display: none; }
}

/* ---------- Bouton « revenir en haut » ---------- */

.back-to-top {
    position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 1040;
    width: 48px; height: 48px; border-radius: 50%; border: 0;
    background: var(--em-green); color: #fff; font-size: 1.3rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .25);
    opacity: 0; visibility: hidden; transform: translateY(16px);
    transition: opacity .25s, transform .25s, visibility .25s, background .2s;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { background: var(--em-green-800); }
.back-to-top:focus-visible { outline: 3px solid var(--gn-yellow); outline-offset: 2px; }

/* ---------- Apparition des blocs au défilement (classes ajoutées par public.js) ---------- */

.js .anim { opacity: 0; transform: translateY(28px); transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--anim-delay, 0ms); }
.js .anim.in-view { opacity: 1; transform: none; }
.js .pillar.anim.in-view:hover, .js .service-card.anim.in-view:hover { transition-delay: 0ms; }
.pillar { transition: transform .2s, box-shadow .2s; }
.pillar:hover { transform: translateY(-4px); box-shadow: 0 12px 26px rgba(16, 24, 20, .08); }

/* ---------- Carrousel des photos officielles ---------- */

.portrait-carousel { max-width: 345px; margin: 0 auto; }
.portrait-carousel .president-figure { margin: 0; max-width: none; }
/* Toutes les diapositives ont la même hauteur : photo au format 4:5, légende de hauteur fixe */
.portrait-carousel .carousel-inner { overflow: visible; }
.portrait-carousel img, .portrait-carousel .president-placeholder {
    display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 15%;
    border: 4px solid rgba(255, 255, 255, .92);
    box-shadow: 0 22px 48px rgba(0, 0, 0, .4);
}
.portrait-carousel figcaption {
    margin-top: -1.75rem; color: var(--em-ink);
    min-height: 4.4rem; display: flex; flex-direction: column; justify-content: center;
}
.portrait-carousel figcaption span { line-height: 1.3; }
/* Fondu enchaîné sans glissement : l'image sortante reste en place pendant que l'entrante apparaît */
.portrait-carousel.carousel-fade .carousel-item { transition: opacity .8s ease-in-out; }
.portrait-carousel.carousel-fade .active.carousel-item-start,
.portrait-carousel.carousel-fade .active.carousel-item-end { transition: opacity 0s .8s; }
.portrait-controls { display: flex; align-items: center; justify-content: center; gap: .75rem; margin-top: 1rem; }
.portrait-arrow { width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .08); color: #fff; display: grid; place-items: center; }
.portrait-arrow:hover { background: rgba(255, 255, 255, .2); }
.portrait-indicators { position: static; margin: 0; gap: .4rem; }
.portrait-indicators [data-bs-target] { width: 28px; height: 5px; border-radius: 3px; border: 0; margin: 0; background: #fff; opacity: .4; transition: width .3s, opacity .3s; }
.portrait-indicators .active { width: 44px; opacity: 1; background: var(--gn-yellow); }
@media (max-width: 991.98px) {
    .portrait-carousel { max-width: 280px; }
}
@media (prefers-reduced-motion: reduce) {
    .portrait-carousel.carousel-fade .carousel-item { transition: none; }
    .js .anim { opacity: 1; transform: none; transition: none; }
}

/* ---------- Champ mot de passe : bouton afficher / masquer ---------- */

.password-toggle {
    border: 1px solid #c9d2cd; border-left: 0; background: #fff; color: var(--em-muted);
    border-top-right-radius: var(--bs-border-radius) !important; border-bottom-right-radius: var(--bs-border-radius) !important;
}
.password-toggle:hover, .password-toggle:focus-visible { color: var(--em-green); background: var(--em-green-50); }
.password-field .form-control { border-right: 0 !important; }
.password-field .password-toggle { margin-left: 0 !important; z-index: 5; }
.password-field .form-control:focus + .password-toggle { border-color: #4f9c7f; }
.password-field .form-control.is-invalid + .password-toggle { border-color: var(--bs-form-invalid-border-color); }

/* ---------- Page de connexion animée ---------- */

.auth-aside { position: relative; overflow: hidden; }
.auth-aside > :not(.hero-decor) { position: relative; z-index: 1; }
.auth-logo { animation: logo-pop .9s cubic-bezier(.2, .9, .3, 1.3) .1s both; }
@keyframes logo-pop { from { opacity: 0; transform: scale(.4) rotate(-90deg); } to { opacity: 1; transform: none; } }

.flag-grow { transform-origin: left; animation: flag-grow .9s cubic-bezier(.2, .7, .2, 1) .3s both; }
@keyframes flag-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.auth-badges { list-style: none; padding: 0; margin: 2rem 0 0; display: flex; flex-direction: column; gap: .65rem; align-items: flex-start; }
.auth-badges li {
    display: inline-flex; align-items: center; gap: .55rem;
    background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px; padding: .45rem .95rem; font-size: .88rem; color: #fff;
    backdrop-filter: blur(4px);
}
.auth-badges li .bi { color: var(--gn-yellow); }
.auth-badges li.reveal { animation: reveal-up .8s cubic-bezier(.2, .7, .2, 1) forwards, float 6s ease-in-out infinite; animation-delay: calc(var(--d) * 120ms + 100ms), calc(var(--d) * 400ms + 1.2s); }
.auth-badges li:nth-child(2) { margin-left: 1.5rem; }
.auth-badges li:nth-child(3) { margin-left: .75rem; }
@keyframes float { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(0, -6px); } }

.auth-seal { filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .25)); }

.auth-card-enter { animation: card-enter .9s cubic-bezier(.2, .7, .2, 1) .25s both; }
@keyframes card-enter { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
.auth-card-enter form > * { animation: reveal-up .6s cubic-bezier(.2, .7, .2, 1) both; }
.auth-card-enter form > *:nth-child(1) { animation-delay: .45s; }
.auth-card-enter form > *:nth-child(2) { animation-delay: .55s; }
.auth-card-enter form > *:nth-child(3) { animation-delay: .65s; }
.auth-card-enter form > *:nth-child(4) { animation-delay: .75s; }
.auth-card-enter form > *:nth-child(n+5) { animation-delay: .85s; }

.auth-main .btn-primary { position: relative; overflow: hidden; }
.auth-main .btn-primary::after {
    content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
    transform: skewX(-20deg); animation: sweep 4.5s ease-in-out 1.5s infinite;
}

/* Erreur de connexion : léger tremblement du formulaire */
.auth-main .is-invalid { animation: shake .4s ease-in-out; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

@media (max-width: 991.98px) {
    .auth-badges { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .auth-logo, .flag-grow, .auth-card-enter, .auth-card-enter form > *, .auth-badges li.reveal,
    .auth-main .btn-primary::after, .auth-main .is-invalid { animation: none; opacity: 1; transform: none; }
}

/* ---------- Avatars et page « Mon profil » ---------- */

.avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; background: var(--em-green-100); color: var(--em-green-800); font-weight: 700; line-height: 1; }
.avatar-photo { object-fit: cover; background: #fff; }

.profile-card { overflow: hidden; }
.profile-cover { height: 92px; background: linear-gradient(135deg, var(--em-green-900), var(--em-green)); position: relative; }
.profile-cover::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, var(--gn-red) 33%, var(--gn-yellow) 33% 66%, var(--gn-green) 66%); }
.profile-photo { margin-top: -56px; display: inline-block; position: relative; }
.profile-photo .avatar { border: 4px solid #fff; box-shadow: 0 6px 18px rgba(16, 24, 20, .18); font-size: 2.2rem !important; }
.profile-facts dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--em-muted); font-weight: 700; }
.profile-facts dd { margin-bottom: .75rem; word-break: break-word; }

/* ---------- En-tête fixe (public.js) : hors du flux, la réduction ne décale plus la page ---------- */

.site-top-spacer { display: none; }
.has-fixed-header .site-top { position: fixed; top: 0; left: 0; right: 0; }
.has-fixed-header .site-top-spacer { display: block; }
html.has-fixed-header { scroll-padding-top: calc(var(--site-top-height, 0px) - 30px); }
.site-top .gov-bar { max-height: 40px; overflow: hidden; transition: max-height .25s ease; }
.site-top.is-scrolled .gov-bar { max-height: 0; }
.site-top.no-transition, .site-top.no-transition * { transition: none !important; }
@media (max-width: 991.98px) {
    .has-fixed-header .site-nav .navbar-collapse { max-height: calc(100vh - 80px); }
}

/* ---------- Images des articles ---------- */

.item-image { display: inline-grid; place-items: center; flex: none; border-radius: .5rem; object-fit: cover; background: #fff; border: 1px solid var(--em-border); }
.item-image-empty { background: var(--em-green-50); color: #7fae98; border-color: var(--em-green-100); }
.item-image-large { box-shadow: 0 6px 18px rgba(16, 24, 20, .1); transition: transform .2s; }
a:hover > .item-image-large { transform: scale(1.02); }
.flex-none { flex: none; }

/* ===== Écran de chargement de l'accueil ===== */
.page-loader { display: none; }
.js .page-loader {
    position: fixed; inset: 0; z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(circle at 80% 10%, rgba(252, 209, 22, .16), transparent 45%),
        radial-gradient(circle at 15% 90%, rgba(206, 17, 38, .14), transparent 40%),
        linear-gradient(135deg, var(--em-green-950) 0%, var(--em-green-800) 100%);
    color: #fff;
    transition: opacity .6s ease, visibility .6s ease;
}
.page-loader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.page-loader-inner { text-align: center; padding: 1rem; animation: loader-in .7s cubic-bezier(.2, .7, .2, 1) both; }
.page-loader.is-hidden .page-loader-inner { transform: scale(1.06); transition: transform .6s ease; }
.page-loader-mark { position: relative; width: 128px; height: 128px; margin: 0 auto 1.25rem; display: grid; place-items: center; }
.page-loader-mark .logo-mark { position: relative; z-index: 1; border-radius: 22%; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); animation: loader-pulse 1.6s ease-in-out infinite; }
.page-loader-ring {
    position: absolute; inset: 0; border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, .12);
    border-top-color: var(--gn-yellow); border-right-color: var(--gn-green);
    animation: loader-spin 1.1s linear infinite;
}
.page-loader-name { font-size: 1.9rem; font-weight: 800; letter-spacing: -.01em; }
.page-loader-name .prefix { color: var(--gn-yellow); }
.page-loader-tagline { color: rgba(255, 255, 255, .75); font-size: .95rem; margin-top: .15rem; }
.page-loader-bar { width: 200px; height: 4px; margin: 1.5rem auto 0; border-radius: 4px; background: rgba(255, 255, 255, .15); overflow: hidden; }
.page-loader-bar span {
    display: block; height: 100%; width: 40%; border-radius: 4px;
    background: linear-gradient(90deg, var(--gn-red), var(--gn-yellow), var(--gn-green));
    animation: loader-bar 1.2s ease-in-out infinite;
}
/* Pas de défilement et animations du bandeau en attente tant que le loader est affiché */
html.is-loading { overflow: hidden; }
html.is-loading .reveal { animation-play-state: paused; }

@keyframes loader-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes loader-spin { to { transform: rotate(360deg); } }
@keyframes loader-pulse { 50% { transform: scale(1.06); } }
@keyframes loader-bar { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }

@media (prefers-reduced-motion: reduce) {
    .page-loader-inner, .page-loader-mark .logo-mark, .page-loader-ring, .page-loader-bar span { animation: none; }
    .page-loader-bar span { width: 100%; }
}

/* ===== Apparition du carrousel des photos officielles ===== */
/* 1. la photo arrive de la droite en se redressant ; 2. un cadre jaune se dessine ; 3. légende puis commandes */
.portrait-enter .carousel-inner { isolation: isolate; animation: portrait-in 1s cubic-bezier(.2, .8, .2, 1) .35s both; }
.portrait-enter .carousel-inner::before {
    content: ""; position: absolute; z-index: -1; inset: -14px 14px 3rem -14px; border-radius: 6px;
    border: 2px solid var(--gn-yellow); opacity: .55;
    animation: portrait-frame .9s ease-out 1s both;
}
.portrait-enter .carousel-item.active figcaption { animation: portrait-caption .6s cubic-bezier(.2, .8, .2, 1) both; }
.portrait-enter .carousel-item:first-child.active figcaption { animation-delay: 1.15s; }
.portrait-enter .portrait-controls { animation: reveal-up .6s ease-out 1.4s both; }
/* Le carrousel attend la fin de l'écran de chargement */
html.is-loading .portrait-enter .carousel-inner,
html.is-loading .portrait-enter .carousel-inner::before,
html.is-loading .portrait-enter figcaption,
html.is-loading .portrait-enter .portrait-controls { animation-play-state: paused; }

@keyframes portrait-in {
    from { opacity: 0; transform: translateX(60px) rotate(3deg) scale(.92); filter: blur(6px); }
    to { opacity: 1; transform: none; filter: none; }
}
@keyframes portrait-frame {
    from { opacity: 0; transform: translate(14px, -14px); }
    to { opacity: .55; transform: none; }
}
@keyframes portrait-caption {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .portrait-enter .carousel-inner, .portrait-enter .carousel-inner::before,
    .portrait-enter figcaption, .portrait-enter .portrait-controls { animation: none; }
}

/* ===== Section « Une priorité de l'État » : apparition au défilement ===== */
/* Texte : chaque élément glisse depuis la gauche, l'un après l'autre */
.js .priority-text.anim { opacity: 1; transform: none; }
.js .priority-text.anim > * {
    opacity: 0; transform: translateX(-36px);
    transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1);
}
.js .priority-text.anim.in-view > * { opacity: 1; transform: none; }
.js .priority-text.anim > :nth-child(2) { transition-delay: .12s; }
.js .priority-text.anim > :nth-child(3) { transition-delay: .24s; }
.js .priority-text.anim > :nth-child(4) { transition-delay: .36s; }
.js .priority-text.anim > :nth-child(5) { transition-delay: .48s; }
.js .priority-text.anim > :nth-child(n+6) { transition-delay: .6s; }
/* Trait aux couleurs du drapeau qui se dessine sous le titre */
.priority-text .section-title { position: relative; padding-bottom: .9rem; }
.priority-text .section-title::after {
    content: ""; position: absolute; left: 0; bottom: 0; height: 4px; width: 96px; border-radius: 4px;
    background: linear-gradient(90deg, var(--gn-red) 0 33%, var(--gn-yellow) 33% 66%, var(--gn-green) 66%);
}
.js .priority-text.anim .section-title::after { transform: scaleX(0); transform-origin: left; transition: transform .8s cubic-bezier(.2, .7, .2, 1) .55s; }
.js .priority-text.anim.in-view .section-title::after { transform: scaleX(1); }

/* Carte Simandou : arrive de la droite, logo qui se pose, reflet lumineux */
.priority-visual .simandou-card { position: relative; overflow: hidden; }
.js .priority-visual.anim {
    opacity: 0; transform: translateX(60px) rotate(2deg) scale(.95);
    transition: opacity .9s cubic-bezier(.2, .7, .2, 1) .2s, transform .9s cubic-bezier(.2, .7, .2, 1) .2s;
}
.js .priority-visual.anim.in-view { opacity: 1; transform: none; }
.js .priority-visual.anim .brand-logo { transform: scale(.6); opacity: 0; transition: transform .6s cubic-bezier(.3, 1.6, .5, 1) .8s, opacity .4s ease .8s; }
.js .priority-visual.anim.in-view .brand-logo { transform: none; opacity: 1; }
.priority-visual .simandou-card::after {
    content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 45%; pointer-events: none;
    background: linear-gradient(105deg, transparent, rgba(31, 181, 173, .14), rgba(255, 255, 255, .6), transparent);
    transform: skewX(-18deg);
}
.js .priority-visual.anim.in-view .simandou-card::after { animation: priority-shine 1.4s ease-in-out 1.2s both; }

@keyframes priority-shine { from { left: -60%; } to { left: 130%; } }

@media (prefers-reduced-motion: reduce) {
    .js .priority-text.anim > *, .js .priority-visual.anim, .js .priority-visual.anim .brand-logo { opacity: 1; transform: none; transition: none; }
    .js .priority-text.anim .section-title::after { transform: none; transition: none; }
    .js .priority-visual.anim.in-view .simandou-card::after { animation: none; }
}

/* ---------- Mercuriales publiées (téléchargement PDF) ---------- */

.edition-download { border-left: 4px solid var(--em-border); }
.edition-download.is-current { border-left-color: var(--em-green); }
.edition-download-icon { width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: .6rem; background: #fdecec; color: #b42318; font-size: 1.6rem; }
.edition-download-form .form-select { min-width: 200px; }

/* ---------- Page Contact : carte du siège ---------- */

.contact-map { overflow: hidden; border-radius: .5rem; border: 1px solid var(--em-border); }
.contact-map iframe { display: block; width: 100%; height: 240px; border: 0; }
.contact-institution { display: flex; align-items: center; gap: .85rem; margin-bottom: 1rem; }
.contact-institution img { flex: none; width: 56px; height: 56px; object-fit: contain; }
.contact-institution h2 { margin-bottom: 0; }

/* ---------- Tableaux de bord : indicateurs et graphiques ---------- */

.min-w-0 { min-width: 0; }
.stat-card .hint { font-size: .78rem; color: var(--em-muted); margin-top: .15rem; }
.stat-card.is-warning .icon-tile { background: #fff4d6; color: #9a6b00; }
.stat-card.is-danger .icon-tile { background: #fde8e6; color: #b42318; }
.stat-card.is-success .icon-tile { background: var(--em-green-50); color: var(--em-green); }
.stat-card.is-danger .value { color: #b42318; }

.dash-panel .card-header { background: #fff; padding: .9rem 1.1rem; }
.dash-panel .card-header p { margin-top: .15rem; }
.dash-list li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .5rem 0; border-bottom: 1px solid var(--em-border); }
.dash-list li:last-child { border-bottom: 0; }

.chart-bars li { display: grid; grid-template-columns: minmax(0, 38%) 1fr auto; align-items: center; gap: .75rem; padding: .32rem 0; font-size: .85rem; }
.chart-bars-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-bars-label small { display: block; color: var(--em-muted); font-size: .72rem; }
.chart-bars-track { position: relative; height: 10px; border-radius: 5px; background: var(--em-surface); overflow: hidden; }
.chart-bars-fill { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 5px; }
.chart-bars.is-signed .chart-bars-fill { left: 50%; border-radius: 0 5px 5px 0; }
.chart-bars.is-signed .chart-bars-fill.is-negative { left: auto; right: 50%; border-radius: 5px 0 0 5px; }
.chart-bars-axis { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: #9aaaa2; }
.chart-bars-value { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; min-width: 4.2rem; }
.tone-primary { background: var(--em-green); }
.tone-success { background: #2e9d6b; }
.tone-warning { background: #e0a800; }
.tone-danger { background: #c0392b; }

.chart-donut { display: flex; align-items: center; gap: 1.25rem; }
.chart-donut svg { width: 150px; height: 150px; flex: none; }
.chart-donut-center { font-size: 7px; font-weight: 800; fill: var(--em-ink); }
.chart-donut-caption { font-size: 3.2px; fill: var(--em-muted); text-transform: uppercase; letter-spacing: .2px; }
.chart-donut .chart-legend { flex: 1; min-width: 0; }
.chart-legend li { display: flex; align-items: center; gap: .5rem; font-size: .85rem; padding: .3rem 0; }
.chart-legend-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }
.chart-legend-inline { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-top: .25rem !important; }

.chart-line svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-grid { stroke: var(--em-border); stroke-width: 1; }
.chart-axis { font-size: 11px; fill: var(--em-muted); }
.chart-value { font-size: 11.5px; font-weight: 700; fill: var(--em-ink); }

@media (max-width: 575.98px) {
    .chart-donut { flex-direction: column; align-items: stretch; }
    .chart-donut svg { margin: 0 auto; }
    .chart-bars li { grid-template-columns: minmax(0, 42%) 1fr auto; gap: .5rem; }
}

/* ---------- Back-office : barre de progression des actions Livewire ---------- */

.action-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 2000; pointer-events: none; opacity: 0;
    background: linear-gradient(90deg, var(--gn-red), var(--gn-yellow), var(--gn-green)); box-shadow: 0 0 8px rgba(0, 112, 74, .5); }
.action-progress.is-active { opacity: 1; animation: action-progress 8s cubic-bezier(.1, .7, .2, 1) forwards; }
.action-progress.is-done { width: 100% !important; animation: none; transition: width .2s ease, opacity .3s ease .15s; opacity: 0; }
@keyframes action-progress { from { width: 0; } to { width: 90%; } }
@media (prefers-reduced-motion: reduce) { .action-progress.is-active { animation: none; width: 60%; } }

/* ---------- Alertes ---------- */

.topbar-bell { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--em-ink); font-size: 1.2rem; text-decoration: none; }
.topbar-bell:hover { background: var(--em-surface); color: var(--em-green); }
.topbar-bell .bi-bell-fill { color: var(--em-green); }
.topbar-bell .count { position: absolute; top: 1px; right: -2px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #c0392b; color: #fff; font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center; }

.alert-type-card { border: 1px solid var(--em-border); }
.alert-type-card.is-selected { border-color: var(--em-green); box-shadow: inset 0 0 0 1px var(--em-green); }
.alert-list .list-group-item { padding: 1rem 1.1rem; }
.alert-list .list-group-item.is-new { background: #fffdf3; box-shadow: inset 3px 0 0 var(--gn-yellow); }
.alert-list .list-group-item.is-closed { opacity: .75; }
.alert-icon { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: .5rem; background: #fff4d6; color: #9a6b00; font-size: 1.1rem; }
.alert-icon.is-danger { background: #fde8e6; color: #b42318; }
.alert-actions { flex: none; max-width: 270px; }
.alert-resolution { background: var(--em-surface); border-radius: .4rem; padding: .4rem .6rem; }
.dash-alerts { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .75rem 1rem; border-radius: var(--em-radius); background: #fffdf3; border: 1px solid #f1dd9a; }
.dash-alerts .bi-bell-fill { color: #b08a00; font-size: 1.15rem; }
@media (max-width: 767.98px) { .alert-list .d-flex.gap-3 { flex-wrap: wrap; } .alert-actions { max-width: none; } }
