/* ========================================
   FICHES RÉFLEXES PM — Design System
   ======================================== */

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-card-hover: rgba(30, 41, 59, 0.85);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-glow: rgba(99, 102, 241, 0.3);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-blue: #6366f1;
    --accent-purple: #a78bfa;
    --accent-green: #34d399;
    --accent-red: #f87171;
    --accent-amber: #fbbf24;
    --accent-cyan: #22d3ee;
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-modal: 0 25px 60px rgba(0, 0, 0, 0.6);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== Reset & Base ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 0%, rgba(99, 102, 241, 0.08), transparent),
        radial-gradient(ellipse 60% 50% at 80% 100%, rgba(167, 139, 250, 0.06), transparent);
    pointer-events: none;
    z-index: 0;
}

/* ========== Header ========== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.badge-icon {
    font-size: 1.8rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(167, 139, 250, 0.15));
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.header-brand h1 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.header-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.nav-search-btn {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.nav-search-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--border-glow);
    color: var(--accent-blue);
}

.search-bar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
}

.search-bar.open {
    max-height: 80px;
    padding: 0 24px 16px;
}

.search-bar input {
    width: 100%;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.search-bar input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* ========== Hero ========== */
.hero {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 64px 24px 40px;
}

.hero-content {
    max-width: 640px;
}

.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(167, 139, 250, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 100px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent-purple);
    margin-bottom: 20px;
    letter-spacing: 0.02em;
}

.hero h2 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
}

.hero p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 520px;
}

/* ========== Cards Grid ========== */
.cards-section {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

/* ========== Card ========== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: var(--transition);
    cursor: default;
    overflow: hidden;
}

.card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(99, 102, 241, 0.2);
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
}

.card-image-content {
    position: relative;
    height: 160px;
    overflow: hidden;
}

.card-image-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
    opacity: 0.8;
}

.card:hover .card-image-content img {
    transform: scale(1.05);
    opacity: 1;
}

.card-icon-overlay {
    position: absolute;
    bottom: -24px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 2;
}

.card-content {
    padding: 32px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.card-icon--blue    { background: linear-gradient(135deg, var(--accent-blue), #4f46e5); }
.card-icon--purple  { background: linear-gradient(135deg, var(--accent-purple), #7c3aed); }
.card-icon--green   { background: linear-gradient(135deg, var(--accent-green), #059669); }
.card-icon--red     { background: linear-gradient(135deg, var(--accent-red), #dc2626); }
.card-icon--amber   { background: linear-gradient(135deg, var(--accent-amber), #d97706); }
.card-icon--cyan    { background: linear-gradient(135deg, var(--accent-cyan), #0891b2); }

.card h3 {
    font-size: 1.2rem;
    font-weight: 700;
}

.card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

.card-btn {
    margin-top: 6px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--accent-blue), #818cf8);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.card-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.card.hidden {
    display: none;
}

/* ========== Modal ========== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
    overflow-y: auto;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 840px;
    box-shadow: var(--shadow-modal);
    transform: translateY(30px) scale(0.97);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.modal-overlay.open .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(99, 102, 241, 0.04);
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.modal-close:hover {
    background: rgba(248, 113, 113, 0.1);
    border-color: rgba(248, 113, 113, 0.3);
    color: var(--accent-red);
}

.modal-body {
    padding: 32px;
    max-height: 72vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.modal-body::-webkit-scrollbar { width: 6px; }
.modal-body::-webkit-scrollbar-track { background: transparent; }
.modal-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

/* Modal Content Styling */
.modal-body h1,
.modal-body h2,
.modal-body h3,
.modal-body h4 {
    color: var(--text-primary);
    margin-top: 28px;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.modal-body h1 { font-size: 1.4rem; font-weight: 800; margin-top: 0; }
.modal-body h2 { font-size: 1.15rem; font-weight: 700; padding-bottom: 8px; border-bottom: 1px solid var(--border-subtle); }
.modal-body h3 { font-size: 1.02rem; font-weight: 600; color: var(--accent-purple); }
.modal-body h4 { font-size: 0.92rem; font-weight: 600; }

.modal-body p {
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.75;
    font-size: 0.92rem;
}

.modal-body ul, .modal-body ol {
    margin: 8px 0 16px 20px;
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.8;
}

.modal-body li {
    margin-bottom: 6px;
}

.modal-body strong {
    color: var(--text-primary);
    font-weight: 600;
}

.modal-body em {
    color: var(--accent-purple);
    font-style: italic;
}

.modal-body hr {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: 24px 0;
}

.modal-body code {
    background: rgba(99, 102, 241, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    color: var(--accent-blue);
}

/* Infographic Components */
.infographic-section {
    margin: 32px 0;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-purple);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 20px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, rgba(167, 139, 250, 0.3), transparent);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-blue);
    transform: scale(1.02);
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fff 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Action Flow (Timeline) */
.action-flow {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
}

.flow-step {
    display: flex;
    gap: 24px;
    position: relative;
    padding-bottom: 32px;
}

.flow-step::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 24px;
    bottom: 0;
    width: 2px;
    background: rgba(99, 102, 241, 0.2);
}

.flow-step:last-child::before {
    display: none;
}

.flow-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    color: var(--accent-blue);
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    margin-top: 4px;
}

.flow-content {
    flex: 1;
}

.flow-content h4 {
    margin: 0 0 4px 0;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.flow-content p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

/* Header Image in Modal */
.modal-hero {
    width: 100%;
    height: 240px;
    overflow: hidden;
    position: relative;
}

.modal-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-hero::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 80px;
    background: linear-gradient(to top, var(--bg-secondary), transparent);
}

/* ========== Footer ========== */
.site-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 32px 24px;
    border-top: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.8;
}

.footer-small {
    font-size: 0.72rem;
    opacity: 0.6;
    margin-top: 4px;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 40px 20px 24px;
    }

    .modal-body {
        padding: 24px 20px;
    }

    .modal-header {
        padding: 18px 20px;
    }

    .modal {
        border-radius: var(--radius-lg);
    }
}

/* ========== Animations ========== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    animation: fadeInUp 0.5s ease both;
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6) { animation-delay: 0.3s; }

/* ========== Fiches longues : tableaux, codes couleur, impression (21/10/2026) ========== */
.note-edition { font-size: 0.82rem; color: var(--text-secondary); background: var(--bg-glass); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 18px; }
.modal-body ol { padding-left: 1.3rem; }
.modal-body ol li { margin-bottom: 8px; }
.petit { font-size: 0.82rem !important; color: var(--text-secondary); }
.legende { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: 0.82rem; color: var(--text-secondary); margin: 14px 0 6px; }
.role { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 0.72rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap; margin: 1px 0; }
.role--vert { background: rgba(52, 211, 153, .15); color: #34d399; border: 1px solid rgba(52, 211, 153, .35); }
.role--orange { background: rgba(251, 191, 36, .14); color: #fbbf24; border: 1px solid rgba(251, 191, 36, .35); }
.role--rouge { background: rgba(248, 113, 113, .14); color: #f87171; border: 1px solid rgba(248, 113, 113, .35); }
.annuaire { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin: 10px 0 6px; }
.annuaire > div { background: var(--bg-glass); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 0.83rem; color: var(--text-secondary); line-height: 1.45; }
.annuaire strong { display: block; color: var(--text-primary); margin-bottom: 4px; font-size: 0.88rem; }
.deux-colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.colonne { border-radius: var(--radius-sm); padding: 12px 14px; border: 1px solid var(--border-subtle); }
.colonne--ok { background: rgba(52, 211, 153, .06); border-color: rgba(52, 211, 153, .25); }
.colonne--non { background: rgba(248, 113, 113, .06); border-color: rgba(248, 113, 113, .25); }
.colonne h3 { margin-top: 0 !important; }
.tableau { overflow-x: auto; margin: 8px 0 18px; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); }
.tableau table { width: 100%; border-collapse: collapse; font-size: 0.8rem; min-width: 720px; }
.tableau th { text-align: left; background: rgba(99, 102, 241, .12); color: var(--text-primary); padding: 8px 10px; font-weight: 600; position: sticky; top: 0; }
.tableau td { padding: 8px 10px; border-top: 1px solid var(--border-subtle); vertical-align: top; color: var(--text-secondary); line-height: 1.45; }
.tableau td:first-child { color: var(--text-primary); font-weight: 500; }
.actions-fiche { margin-top: 18px; display: flex; justify-content: flex-end; }
@media (max-width: 768px) { .deux-colonnes { grid-template-columns: 1fr; } }
@media print {
  body { background: #fff !important; color: #000 !important; }
  .site-header, .hero, .cards-section, .site-footer, .modal-hero, .modal-close, .actions-fiche { display: none !important; }
  .modal-overlay { position: static !important; background: none !important; opacity: 1 !important; visibility: visible !important; display: block !important; }
  .modal { position: static !important; max-height: none !important; width: 100% !important; box-shadow: none !important; background: #fff !important; transform: none !important; border: 0 !important; }
  .modal-body { max-height: none !important; overflow: visible !important; color: #000 !important; }
  .modal-body *, .tableau td, .tableau th, .annuaire > div { color: #000 !important; background: none !important; }
  .tableau table { min-width: 0; font-size: 9pt; }
  .tableau { border-color: #999; }
  .tableau td, .tableau th { border-top: 1px solid #bbb !important; }
  .role { border: 1px solid #555 !important; }
}
