/* ════════════════════════════════════════════════════════════
   Sélection de catalogue — accordéon + recherche + toggle FR/EN
   ════════════════════════════════════════════════════════════ */

:root {
    --cs-blue: #2563eb;       --cs-blue-light: #eff6ff;   --cs-blue-border: #bfdbfe;
    --cs-purple: #7c3aed;     --cs-purple-light: #f5f3ff;
    --cs-teal: #0d9488;       --cs-teal-light: #f0fdfa;
    --cs-amber: #ca8a04;      --cs-amber-light: #fefce8;
    --cs-green: #16a34a;      --cs-green-light: #f0fdf4;
    --cs-slate: #475569;      --cs-slate-light: #f8fafc;
    --cs-gray-100: #f1f5f9;   --cs-gray-200: #e2e8f0;
    --cs-gray-400: #94a3b8;   --cs-gray-500: #64748b;
    --cs-gray-700: #334155;   --cs-gray-800: #1e293b;
}

/* ── Topbar (search + lang toggle) ── */
.cs-topbar {
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--cs-slate-light);
    border: 1px solid var(--cs-gray-200);
    border-radius: 10px;
    margin-bottom: 14px;
}

.cs-search {
    flex: 1;
    min-width: 240px;
    position: relative;
}
.cs-search i[data-lucide] {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--cs-gray-400);
    pointer-events: none;
}
.cs-search input {
    width: 100%;
    padding: 9px 14px 9px 38px;
    border: 1px solid var(--cs-gray-200);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    background: white;
    transition: border-color .15s, box-shadow .15s;
}
.cs-search input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, .12);
}

.cs-lang {
    display: inline-flex;
    background: white;
    border: 1px solid var(--cs-gray-200);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}
.cs-lang button {
    padding: 5px 12px;
    border: none;
    background: transparent;
    font-size: 11px;
    font-weight: 700;
    color: var(--cs-gray-500);
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: .3px;
    transition: background .15s, color .15s;
}
.cs-lang button:hover { background: var(--cs-gray-100); }
.cs-lang button.active {
    background: var(--cs-blue);
    color: white;
}

/* ── Accordion sections ── */
.acc-cat {
    border: 1px solid var(--cs-gray-200);
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
    background: white;
}
.acc-head {
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    background: white;
    transition: background .15s;
    user-select: none;
}
.acc-head:hover { background: var(--cs-slate-light); }
.acc-head:focus-visible {
    outline: 2px solid var(--cs-blue);
    outline-offset: -2px;
}

.acc-head .chevron {
    width: 18px;
    height: 18px;
    color: var(--cs-gray-400);
    transition: transform .2s, color .2s;
    flex-shrink: 0;
}
.acc-cat.open .acc-head .chevron {
    transform: rotate(90deg);
    color: var(--cs-blue);
}

.cat-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cat-icon i[data-lucide] {
    width: 18px;
    height: 18px;
}

.cat-title-wrap { flex: 1; min-width: 0; }
.cat-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--cs-gray-800);
    text-transform: uppercase;
    letter-spacing: .3px;
}
.cat-desc {
    font-size: 12px;
    color: var(--cs-gray-500);
    margin-top: 3px;
    line-height: 1.45;
}

.cat-count {
    font-size: 11px;
    font-weight: 700;
    color: var(--cs-gray-500);
    padding: 4px 10px;
    background: var(--cs-gray-100);
    border-radius: 20px;
    flex-shrink: 0;
}

.acc-body {
    display: none;
    padding: 4px 18px 18px;
    border-top: 1px solid var(--cs-gray-100);
}
.acc-cat.open .acc-body { display: block; }

/* ── Category color variants ── */
.acc-cat.cat-reg   .cat-icon { background: var(--cs-blue-light);   color: var(--cs-blue);   }
.acc-cat.cat-std   .cat-icon { background: var(--cs-purple-light); color: var(--cs-purple); }
.acc-cat.cat-sect  .cat-icon { background: var(--cs-teal-light);   color: var(--cs-teal);   }
.acc-cat.cat-risk  .cat-icon { background: var(--cs-amber-light);  color: var(--cs-amber);  }
.acc-cat.cat-bp    .cat-icon { background: var(--cs-green-light);  color: var(--cs-green);  }
.acc-cat.cat-other .cat-icon { background: var(--cs-gray-100);     color: var(--cs-gray-500); }

/* ── Catalog card grid ── */
.cat-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.cc {
    background: white;
    border: 1.5px solid var(--cs-gray-200);
    border-radius: 10px;
    padding: 14px 16px;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, border-color .15s;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    overflow: hidden;
}
.cc::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--cs-gray-200);
    transition: background .15s;
}
.cat-reg   .cc::before { background: var(--cs-blue);   }
.cat-std   .cc::before { background: var(--cs-purple); }
.cat-sect  .cc::before { background: var(--cs-teal);   }
.cat-risk  .cc::before { background: var(--cs-amber);  }
.cat-bp    .cc::before { background: var(--cs-green);  }

.cc:hover:not(.cc--locked) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .06);
    border-color: #667eea;
}
.cc:focus-visible {
    outline: 2px solid var(--cs-blue);
    outline-offset: 2px;
}

.cc--locked {
    opacity: .6;
    cursor: not-allowed;
    background: var(--cs-slate-light);
}

.cc-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}
.cc-name {
    font-size: 14px;
    font-weight: 800;
    color: var(--cs-gray-800);
    line-height: 1.3;
    flex: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.cc-lock-icon {
    width: 13px;
    height: 13px;
    color: var(--cs-amber);
    flex-shrink: 0;
}
.cc-version {
    font-size: 10px;
    font-weight: 700;
    color: var(--cs-gray-500);
    background: var(--cs-gray-100);
    padding: 2px 8px;
    border-radius: 20px;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: .3px;
    white-space: nowrap;
}

.cc-desc {
    font-size: 12px;
    color: var(--cs-gray-500);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cc-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--cs-gray-100);
}
.cc-stats {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--cs-gray-500);
}
.cc-stats span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}
.cc-stats i[data-lucide] {
    width: 12px;
    height: 12px;
}
.cc-stats strong {
    color: var(--cs-gray-700);
    font-weight: 800;
}

.cc-badges {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.cc-lock-row {
    padding-top: 8px;
    margin-top: 2px;
    border-top: 1px dashed var(--cs-gray-200);
}
.lock-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    color: var(--cs-amber);
    background: var(--cs-amber-light);
    border: 1px solid var(--cs-gray-200);
    padding: 3px 9px;
    border-radius: 20px;
}
.lock-badge i[data-lucide] {
    width: 11px;
    height: 11px;
}

/* ── Empty state ── */
.cs-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--cs-gray-400);
    font-size: 13px;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .cs-topbar { padding: 12px; gap: 8px; }
    .cs-search { min-width: 0; width: 100%; }
    .cs-lang { align-self: flex-end; }
    .acc-head { padding: 12px 14px; }
    .cat-desc { display: none; }
    .cat-grid { grid-template-columns: 1fr; }
}
