/* ============================================================
   citizen-design-system.css
   Fondations Vague 0 — REFONTE_NFRS_FRS_ENTERPRISE_COMPTE_USER.md
   Nouvelle bibliothèque de composants pour l'espace citoyen.
   Construit sur les tokens Mizzle existants (style.css), jamais
   en remplacement de Bootstrap — en complément, ciblé, versionné.
   ============================================================ */

:root {
    --cds-primary: #09B850;
    --cds-primary-dark: #078a3d;
    --cds-verdict-true: #0cbc87;
    --cds-verdict-doubtful: #f7c32e;
    --cds-verdict-false: #d6293e;
    --cds-ink: #1a2233;
    --cds-muted: #6b7686;
    --cds-muted-2: #8a94a6;
    --cds-surface: #ffffff;
    --cds-surface-alt: #f5f7fa;
    --cds-border: #edf0f4;
    --cds-row-border: #f1f3f6;
    --cds-sidebar-bg: #161c24;
    --cds-group-label: #7c8494;
    --cds-radius-sm: .5rem;
    --cds-radius-md: .75rem;
    --cds-radius-lg: 1.25rem;
    --cds-shadow-sm: 0 .125rem .5rem rgba(16, 24, 43, .06);
    --cds-shadow-md: 0 .5rem 1.5rem rgba(15,23,42,.06);
    --cds-topbar-h: 72px;
    --cds-content-max: 1140px;
}

/* ---------- Tokens showcase ---------- */
.cds-swatch { width: 100%; height: 72px; border-radius: var(--cds-radius-md); box-shadow: var(--cds-shadow-sm); }
.cds-spacing-bar { background: var(--cds-primary); border-radius: 4px; }

/* ---------- <x-kpi-accordion> ---------- */
.kpi-accordion { border: 1px solid var(--cds-border); border-radius: var(--cds-radius-lg); background: var(--cds-surface); overflow: hidden; }
.kpi-accordion-toggle {
    display: none; width: 100%; border: 0; background: var(--cds-surface-alt);
    padding: .85rem 1.25rem; font-weight: 700; font-size: .9rem; color: var(--cds-ink);
    align-items: center; justify-content: space-between; cursor: pointer;
}
.kpi-accordion-toggle .bi { transition: transform .2s ease; }
.kpi-accordion-toggle[aria-expanded="true"] .bi { transform: rotate(180deg); }
.kpi-accordion-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--cds-border); }
.kpi-accordion-grid > * { background: var(--cds-surface); }
@media (max-width: 767.98px) {
    .kpi-accordion-toggle { display: flex; }
    .kpi-accordion-grid { grid-template-columns: repeat(2, 1fr); display: none; }
    .kpi-accordion-grid.is-open { display: grid; }
}

/* ---------- <x-stat-widget> ---------- */
.stat-widget { padding: 1.25rem; }
.stat-widget .stat-label { font-size: .75rem; color: var(--cds-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .35rem; display: block; }
.stat-widget .stat-value { font-size: 1.6rem; font-weight: 800; color: var(--cds-ink); line-height: 1; }
.stat-widget .stat-trend { font-size: .75rem; font-weight: 700; border-radius: 999px; padding: .15rem .5rem; display: inline-flex; align-items: center; gap: .2rem; margin-top: .5rem; }
.stat-widget .stat-trend.is-up { background: rgba(9,184,81,.12); color: var(--cds-primary-dark); }
.stat-widget .stat-trend.is-down { background: rgba(214,41,62,.1); color: var(--cds-verdict-false); }
.stat-widget .stat-icon { width: 40px; height: 40px; border-radius: var(--cds-radius-sm); background: rgba(9,184,81,.1); color: var(--cds-primary); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; margin-bottom: .75rem; }

/* ---------- <x-verdict-badge> ---------- */
.verdict-badge { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; font-size: .78rem; padding: .3rem .7rem; border-radius: 999px; }
.verdict-badge .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.verdict-badge.is-vrai { background: rgba(12,188,135,.12); color: #0a8a63; }
.verdict-badge.is-vrai .dot { background: var(--cds-verdict-true); }
.verdict-badge.is-douteux { background: rgba(247,195,46,.16); color: #8a6d00; }
.verdict-badge.is-douteux .dot { background: var(--cds-verdict-doubtful); }
.verdict-badge.is-faux { background: rgba(214,41,62,.1); color: var(--cds-verdict-false); }
.verdict-badge.is-faux .dot { background: var(--cds-verdict-false); }

/* ---------- <x-score-gauge> ---------- */
.score-gauge { position: relative; width: 96px; height: 96px; }
.score-gauge svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.score-gauge circle { fill: none; stroke-width: 8; }
.score-gauge .track { stroke: var(--cds-border); }
.score-gauge .value-arc { stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.score-gauge .score-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.1rem; color: var(--cds-ink); }

/* ---------- <x-progress-bar-course> ---------- */
.progress-course { height: 8px; border-radius: 999px; background: var(--cds-border); overflow: hidden; }
.progress-course > span { display: block; height: 100%; background: var(--cds-primary); border-radius: 999px; transition: width .5s ease; }

/* ---------- <x-course-card> ---------- */
.course-card-v2 { border: 1px solid var(--cds-border); border-radius: var(--cds-radius-lg); overflow: hidden; background: var(--cds-surface); transition: box-shadow .2s ease, transform .2s ease; height: 100%; }
.course-card-v2:hover { box-shadow: var(--cds-shadow-md); transform: translateY(-3px); }
.course-card-v2 .thumb { height: 140px; background: linear-gradient(135deg, #0f1b33, #1E3A8A); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 2rem; position: relative; }
.course-card-v2 .badge-dynamic { position: absolute; top: .75rem; left: .75rem; }

/* ---------- <x-badge-tile> ---------- */
.badge-tile { text-align: center; padding: 1rem .5rem; border-radius: var(--cds-radius-md); border: 1px solid var(--cds-border); }
.badge-tile .badge-icon { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto .5rem; font-size: 1.4rem; }
.badge-tile.is-unlocked .badge-icon { background: rgba(9,184,81,.12); color: var(--cds-primary); }
.badge-tile.is-locked .badge-icon { background: var(--cds-surface-alt); color: #c3c5c9; }
.badge-tile.is-locked .badge-title { color: var(--cds-muted); }

/* ---------- <x-streak-widget> ---------- */
.streak-compact { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; color: #b8560c; background: rgba(247,195,46,.16); padding: .3rem .65rem; border-radius: 999px; font-size: .82rem; }
.streak-full .streak-days { display: flex; gap: 4px; margin-top: .75rem; flex-wrap: wrap; }
.streak-full .streak-day { width: 20px; height: 20px; border-radius: 5px; background: var(--cds-border); }
.streak-full .streak-day.is-active { background: var(--cds-primary); }

/* ---------- <x-empty-state> ---------- */
.empty-state { text-align: center; padding: 3rem 1.5rem; }
.empty-state .empty-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--cds-surface-alt); color: var(--cds-muted); display: flex; align-items: center; justify-content: center; font-size: 1.6rem; margin: 0 auto 1rem; }

/* ---------- <x-notification-item> ---------- */
.notification-item { display: flex; gap: .75rem; padding: .85rem 1rem; border-radius: var(--cds-radius-sm); transition: background .15s ease; }
.notification-item:hover { background: var(--cds-surface-alt); }
.notification-item.is-unread { background: rgba(9,184,81,.04); }
.notification-item .n-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ---------- <x-reaction-bar> ---------- */
.reaction-bar { display: inline-flex; gap: .4rem; }
.reaction-bar button { border: 1px solid var(--cds-border); background: var(--cds-surface); border-radius: 999px; padding: .25rem .65rem; font-size: .8rem; font-weight: 600; color: var(--cds-muted); display: inline-flex; align-items: center; gap: .3rem; cursor: pointer; transition: all .15s ease; }
.reaction-bar button.is-active { background: rgba(9,184,81,.1); border-color: var(--cds-primary); color: var(--cds-primary-dark); }

/* ---------- <x-unit-balance> ---------- */
.unit-balance-compact { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; font-size: .85rem; background: var(--cds-ink); color: #fff; padding: .35rem .7rem; border-radius: 999px; }
.unit-balance-full { border: 1px solid var(--cds-border); border-radius: var(--cds-radius-lg); padding: 1.25rem; }

/* ---------- Skeleton / loading ---------- */
@keyframes cds-shimmer { 0% { background-position: -200px 0; } 100% { background-position: 200px 0; } }
.cds-skeleton { background: linear-gradient(90deg, #eceef1 0px, #f6f7f9 40px, #eceef1 80px); background-size: 400px; animation: cds-shimmer 1.4s infinite linear; border-radius: var(--cds-radius-sm); }

/* ---------- Soft background utilities (used across widgets) ---------- */
.bg-success-soft { background-color: rgba(12,188,135,.12) !important; }
.bg-primary-soft { background-color: rgba(9,184,81,.1) !important; }
.bg-danger-soft { background-color: rgba(214,41,62,.1) !important; }
.bg-warning-soft { background-color: rgba(247,195,46,.16) !important; }

/* ---------- New citizen shell: topbar / sidebar / bottom nav ---------- */
.cshell-preview { border: 1px solid var(--cds-border); border-radius: var(--cds-radius-lg); overflow: hidden; box-shadow: var(--cds-shadow-md); }
.cshell-topbar { height: var(--cds-topbar-h); background: #fff; border-bottom: 1px solid var(--cds-border); display: flex; align-items: center; justify-content: space-between; padding: 0 1.25rem; }
.cshell-body { display: flex; min-height: 420px; }
.cshell-sidebar { width: 260px; background: var(--cds-ink); color: #fff; padding: 1.25rem 0; flex-shrink: 0; }
.cshell-sidebar .group-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #8a8d93; padding: 1rem 1.25rem .4rem; }
.cshell-sidebar .nav-item-mini { display: flex; align-items: center; gap: .6rem; padding: .55rem 1.25rem; color: #c6c8cc; font-size: .85rem; font-weight: 600; text-decoration: none; }
.cshell-sidebar .nav-item-mini.is-active { color: #fff; background: rgba(9,184,81,.16); border-right: 3px solid var(--cds-primary); }
.cshell-sidebar .nav-item-mini .badge { margin-left: auto; }
.cshell-content { flex: 1; background: var(--cds-surface-alt); padding: 1.5rem; }
.cshell-bottomnav { display: none; }
@media (max-width: 991.98px) {
    .cshell-sidebar { display: none; }
    .cshell-bottomnav {
        display: flex; align-items: center; justify-content: space-around;
        background: #fff; border-top: 1px solid var(--cds-border); padding: .5rem 0;
    }
    .cshell-bottomnav a { color: var(--cds-muted); font-size: 1.2rem; text-decoration: none; padding: .4rem; min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
    .cshell-bottomnav a.is-fab { background: var(--cds-primary); color: #fff; border-radius: 50%; width: 52px; height: 52px; margin-top: -24px; box-shadow: 0 .5rem 1rem rgba(9,184,81,.35); }
}

/* ============================================================
   App shell (production) — Topbar (16_TOPBAR_DESIGN.md) / Sidebar
   (17_SIDEBAR_DESIGN.md) / Bottom Nav (18_BOTTOM_NAVIGATION.md) /
   Content wrapper (06_USER_DASHBOARD.md §3). Shared verbatim across
   every citizen page — never restyled locally (19_WIDGET_LIBRARY.md §12).
   ============================================================ */
.app-topbar {
    height: var(--cds-topbar-h); background: #fff; border-bottom: 1px solid var(--cds-border);
    position: sticky; top: 0; z-index: 1050;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 1.5rem; transition: box-shadow .15s ease;
}
.app-topbar.is-scrolled { box-shadow: 0 2px 8px rgba(15,23,42,.06); }
@media (min-width: 992px) { .app-topbar { padding: 0 2rem; } }
.topbar-search { width: 220px; }
@media (min-width: 1200px) { .topbar-search { width: 280px; } }
.topbar-search input { font-size: 14px; color: var(--cds-ink); }
.topbar-search input::placeholder { color: var(--cds-muted-2); font-size: 14px; }
.topbar-icon-btn { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.topbar-icon-btn:hover { background: #f4f5fa; }
.topbar-badge-text { font-size: 13px; font-weight: 600; color: var(--cds-ink); }
@media (max-width: 575.98px) { .app-topbar .d-xs-none-topbar { display: none !important; } }

.app-sidebar {
    width: 260px; flex-shrink: 0; background: var(--cds-sidebar-bg); color: #fff;
    min-height: calc(100vh - var(--cds-topbar-h)); position: sticky; top: var(--cds-topbar-h);
    padding: 1rem 0 6rem; overflow-y: auto;
}
.app-sidebar .sidebar-group-label {
    font-size: 11px; font-weight: 700; color: var(--cds-group-label);
    text-transform: uppercase; letter-spacing: .06em; margin: 1.5rem 1rem .5rem;
}
.app-sidebar .sidebar-group:first-child .sidebar-group-label { margin-top: 0; }
.app-sidebar .sidebar-link {
    display: flex; align-items: center; gap: 10px; padding: .65rem 1rem;
    color: #cbd5e1; font-size: 14px; font-weight: 500; text-decoration: none;
    border-left: 3px solid transparent; margin-bottom: 4px;
    transition: background .15s ease, color .15s ease;
}
.app-sidebar .sidebar-link i { font-size: 18px; }
.app-sidebar .sidebar-link:hover { background: rgba(9,184,80,.10); color: #fff; }
.app-sidebar .sidebar-link.is-active { color: #fff; font-weight: 700; background: rgba(9,184,80,.16); border-left-color: var(--cds-primary); }
.app-sidebar .sidebar-link .badge { margin-left: auto; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 7px; background: #dc3545; }
.sidebar-wallet-widget { margin: 1.5rem 1rem 0; background: rgba(9,184,80,.14); border-radius: 16px; padding: 1rem; }
.sidebar-wallet-widget .w-label { font-size: 12px; color: rgba(255,255,255,.6); }
.sidebar-wallet-widget .w-value { font-size: 24px; font-weight: 800; color: #fff; }

.app-shell { display: flex; align-items: flex-start; }
.app-content { flex: 1; min-width: 0; }
@media (min-width: 992px) { .app-content-inner { max-width: var(--cds-content-max); margin-inline: auto; padding: 2rem; } }
.app-content-inner { padding: 1.5rem 1.5rem 6rem; display: flex; flex-direction: column; gap: 2.5rem; }
.app-content-inner.is-narrow { max-width: 760px !important; }
.app-content-inner.is-form { max-width: 680px !important; }

.app-bottomnav { display: none; }
@media (max-width: 991.98px) {
    .app-sidebar { display: none; }
    .app-bottomnav {
        display: flex; align-items: center;
        position: fixed; bottom: 0; left: 0; right: 0; z-index: 1040;
        height: calc(64px + env(safe-area-inset-bottom));
        background: #fff; box-shadow: 0 -2px 14px rgba(15,23,42,.08);
        border-top: 1px solid var(--cds-row-border);
    }
    .app-bottomnav a {
        flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
        gap: 2px; color: #8a94a6; text-decoration: none; font-size: 10px; font-weight: 600; position: relative;
    }
    .app-bottomnav a i { font-size: 22px; }
    .app-bottomnav a.is-active { color: var(--cds-primary); font-weight: 700; }
    .app-bottomnav a.is-fab {
        width: 56px; height: 56px; border-radius: 50%; background: var(--cds-primary); color: #fff;
        margin-top: -28px; border: 4px solid #fff; box-shadow: 0 6px 16px rgba(9,184,80,.4);
        flex: 0 0 56px; transition: transform .1s ease;
    }
    .app-bottomnav a.is-fab i { font-size: 24px; }
    .app-bottomnav a.is-fab:active { transform: scale(.94); }
    .app-bottomnav a .nb-dot { position: absolute; top: 2px; right: 22%; width: 8px; height: 8px; background: #dc3545; border-radius: 50%; }
}

.widget-title { font-size: 16px; font-weight: 700; color: var(--cds-ink); margin-bottom: 1rem; }
@media (min-width: 992px) { .widget-title { font-size: 18px; } }
.widget-card { background: #fff; border-radius: 16px; box-shadow: var(--cds-shadow-md); padding: 1.5rem; }
.page-title h1 { font-size: 24px; font-weight: 800; margin-bottom: .25rem; }
.page-title p { font-size: 15px; color: var(--cds-muted); margin: 0; }
@media (min-width: 992px) { .page-title h1 { font-size: 28px; } }

/* ============================================================
   07_FACTCHECKING_MODULE.md — composants spécifiques aux 5 écrans
   ============================================================ */

/* Écran 1 — Vérifier un contenu */
.fc-form-card { max-width: 680px; margin-inline: auto; background: #fff; border-radius: 20px;
    box-shadow: 0 1rem 2.5rem rgba(15,23,42,.08); padding: 1.25rem; }
@media (min-width: 768px) { .fc-form-card { padding: 2rem; } }
.fc-pills { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: 2px; }
.fc-pill {
    height: 44px; padding: 0 1.25rem; border-radius: 999px; background: #f4f5fa; color: var(--cds-muted);
    font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: .4rem; border: 0;
    white-space: nowrap; transition: transform .15s ease, background .15s ease, color .15s ease; flex-shrink: 0;
}
.fc-pill.is-active { background: var(--cds-primary); color: #fff; transform: scale(1.03); }
.fc-balance-banner {
    background: var(--cds-surface-alt); border-radius: 12px; padding: .85rem 1.1rem;
    font-size: 14px; font-weight: 600; color: var(--cds-ink); display: flex; align-items: center; gap: .5rem;
}

/* Écran 2 — Vérification en cours */
.fc-progress-card { max-width: 480px; margin: 3rem auto; text-align: center; }
.fc-progress-icon { width: 96px; height: 96px; border-radius: 50%; background: rgba(9,184,80,.1); color: var(--cds-primary);
    display: flex; align-items: center; justify-content: center; margin: 0 auto 1.5rem; font-size: 2.5rem;
    animation: fcSpin 2.5s linear infinite; }
@keyframes fcSpin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.fc-timeline { display: flex; align-items: center; justify-content: center; gap: 0; margin: 1.5rem 0; }
.fc-timeline .step { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #d8dde5; background: #fff; flex-shrink: 0; }
.fc-timeline .step.is-done { background: var(--cds-primary); border-color: var(--cds-primary); }
.fc-timeline .step.is-current { background: var(--cds-primary); border-color: var(--cds-primary); box-shadow: 0 0 0 5px rgba(9,184,80,.2); animation: fcPulse 1.6s infinite; }
@keyframes fcPulse { 0%,100% { box-shadow: 0 0 0 5px rgba(9,184,80,.2); } 50% { box-shadow: 0 0 0 9px rgba(9,184,80,.08); } }
.fc-timeline .line { flex: 1; height: 2px; background: #d8dde5; }
.fc-timeline .line.is-done { background: var(--cds-primary); }

/* Écran 3 — Résultats */
.fc-verdict-banner { border-radius: 20px; padding: 2rem; display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.fc-verdict-banner.is-vrai { background: rgba(12,188,135,.08); }
.fc-verdict-banner.is-douteux { background: rgba(247,195,46,.12); }
.fc-verdict-banner.is-faux { background: rgba(214,41,62,.07); }
.fc-source-card { padding: .75rem 1rem; border-radius: 12px; background: #f8f9fb; display: flex; align-items: center; gap: .6rem; }
.fc-source-card .favicon { width: 20px; height: 20px; border-radius: 4px; flex-shrink: 0; }

/* Écran 4 — Mes vérifications */
.fc-filter-row .form-select, .fc-filter-row .form-control { font-size: 14px; }
.fc-table-row { display: flex; align-items: center; justify-content: space-between; padding: 1rem 0; border-bottom: 1px solid var(--cds-row-border); }
.fc-table-row:last-child { border-bottom: 0; }

/* Écran 5 — Outils */
.fc-tool-card { padding: 1.25rem; border-radius: 16px; background: #fff; box-shadow: var(--cds-shadow-sm); height: 100%;
    text-decoration: none; display: block; color: inherit; transition: box-shadow .15s ease, transform .15s ease; }
.fc-tool-card:hover { box-shadow: var(--cds-shadow-md); transform: translateY(-2px); color: inherit; }
.fc-tool-icon { width: 44px; height: 44px; border-radius: 12px; background: rgba(9,184,80,.1); color: var(--cds-primary);
    display: flex; align-items: center; justify-content: center; font-size: 1.3rem; margin-bottom: .75rem; }
