/* =========================================================
   CSAPA — Styles Section "Réglementation & Services Pro"
   Version 1.0 — Étape 8
   ========================================================= */

/* ── 1. CODE AAF — LIVRE TABS ───────────────────────────── */
.livre-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: 1.5rem;
}

.livre-tab-btn {
  font-size: .78rem;
  font-weight: 700;
  padding: .45rem .9rem;
  border-radius: var(--radius);
  border: 1.5px solid #e5e7eb;
  background: #fff;
  color: #374151;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}

.livre-tab-btn:hover { background: var(--csapa-blanc); border-color: var(--csapa-bleu); }
.livre-tab-btn.active { background: var(--csapa-bleu); border-color: var(--csapa-bleu); color: #fff; }

.livre-panel { display: none; }
.livre-panel.active { display: block; }

/* ── 2. ARTICLE ACCORDION ───────────────────────────────── */
.article-accordion {
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.article-accordion-btn {
  width: 100%;
  text-align: left;
  background: var(--csapa-blanc);
  border: none;
  padding: .75rem 1.1rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--csapa-bleu);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .75rem;
  border-bottom: 1px solid #e5e7eb;
  transition: background .15s;
}

.article-accordion-btn:last-of-type { border-bottom: none; }
.article-accordion-btn:hover { background: #eef2ff; }
.article-accordion-btn.open { background: var(--csapa-bleu); color: #fff; }

.article-num {
  font-family: 'Courier New', monospace;
  font-size: .72rem;
  font-weight: 700;
  background: rgba(200,169,81,.2);
  color: var(--csapa-or);
  padding: .1rem .4rem;
  border-radius: 4px;
  flex-shrink: 0;
}

.article-accordion-btn.open .article-num { background: rgba(255,255,255,.2); color: #fff; }

.article-chevron {
  margin-left: auto;
  font-size: .65rem;
  transition: transform .2s;
}

.article-accordion-btn.open .article-chevron { transform: rotate(180deg); }

.article-body {
  padding: 1rem 1.25rem;
  font-size: .83rem;
  color: #374151;
  line-height: 1.7;
  border-bottom: 1px solid #f3f4f6;
  display: none;
}

.article-body.open { display: block; }
.article-body:last-child { border-bottom: none; }

/* ── 3. LICENCE CARD ────────────────────────────────────── */
.licence-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-top: 4px solid var(--lic-color, #0C1B3A);
  border-radius: var(--radius);
  padding: 1.5rem;
  height: 100%;
  transition: box-shadow .18s, transform .18s;
}

.licence-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,.08);
  transform: translateY(-2px);
}

.licence-code {
  font-family: 'Courier New', monospace;
  font-size: .8rem;
  font-weight: 700;
  color: var(--lic-color, #0C1B3A);
  background: rgba(12,27,58,.06);
  padding: .2rem .6rem;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: .6rem;
}

.licence-name {
  font-weight: 700;
  font-size: .95rem;
  color: var(--csapa-bleu);
  margin-bottom: .5rem;
}

.licence-desc {
  font-size: .8rem;
  color: #6b7280;
  line-height: 1.5;
  margin-bottom: .9rem;
}

.licence-meta-row {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  font-size: .75rem;
  border-top: 1px solid #f3f4f6;
  padding-top: .75rem;
}

.licence-meta-item {
  display: flex;
  gap: .5rem;
}

.licence-meta-key {
  color: #9ca3af;
  min-width: 80px;
  flex-shrink: 0;
}

.licence-meta-val {
  color: #374151;
  font-weight: 500;
}

/* ── 4. CERTIFICATION LEVEL CARDS ───────────────────────── */
.cert-level-card {
  background: #fff;
  border-radius: var(--radius);
  border: 2px solid #e5e7eb;
  padding: 1.5rem;
  height: 100%;
  text-align: center;
  position: relative;
  transition: border-color .2s, box-shadow .2s;
}

.cert-level-card:hover {
  border-color: var(--csapa-or);
  box-shadow: 0 6px 20px rgba(200,169,81,.15);
}

.cert-level-num {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--csapa-bleu);
  color: var(--csapa-or);
  font-family: var(--font-titre);
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto .8rem;
}

.cert-level-title {
  font-weight: 700;
  font-size: .95rem;
  color: var(--csapa-bleu);
  margin-bottom: .4rem;
}

.cert-level-req {
  font-size: .78rem;
  color: #6b7280;
  line-height: 1.5;
}

/* ── 5. GUIDE DOWNLOAD ROW ──────────────────────────────── */
.guide-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  margin-bottom: .5rem;
  transition: background .15s;
}

.guide-row:hover { background: var(--csapa-blanc); }

.guide-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: #fee2e2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #dc2626;
  font-size: 1rem;
  flex-shrink: 0;
}

.guide-title { font-weight: 600; font-size: .88rem; color: var(--csapa-bleu); }
.guide-meta  { font-size: .72rem; color: #9ca3af; margin-top: .15rem; }
.guide-dl-btn {
  margin-left: auto;
  font-size: .75rem;
  font-weight: 600;
  padding: .35rem .85rem;
  background: var(--csapa-bleu);
  color: #fff;
  border-radius: var(--radius);
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity .15s;
}
.guide-dl-btn:hover { opacity: .85; color: #fff; }

/* ── 6. MECENAT TABLE ───────────────────────────────────── */
.mecenat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}

.mecenat-table th {
  background: var(--csapa-bleu);
  color: #fff;
  padding: .65rem .9rem;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  white-space: nowrap;
}

.mecenat-table td {
  padding: .65rem .9rem;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}

.mecenat-table tr:hover td { background: var(--csapa-blanc); }

/* ── 7. SEARCH BAR CODE AAF ─────────────────────────────── */
.code-search-bar {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.25rem;
}

.code-search-bar input {
  flex: 1;
  padding: .55rem 1rem .55rem 2.5rem;
  border: 1.5px solid #d1d5db;
  border-radius: var(--radius);
  font-size: .875rem;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat .75rem center;
  background-size: 14px;
}

.code-search-bar input:focus {
  outline: none;
  border-color: var(--csapa-bleu);
  box-shadow: 0 0 0 3px rgba(12,27,58,.08);
}

.code-search-bar .btn-search-code {
  padding: .55rem 1.25rem;
  background: var(--csapa-bleu);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
}

/* highlight matched text */
.code-highlight {
  background: #fef9c3;
  border-radius: 2px;
  padding: 0 1px;
}

/* version history */
.version-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .7rem 1rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  margin-bottom: .4rem;
  font-size: .82rem;
}

.version-tag {
  font-family: 'Courier New', monospace;
  font-size: .72rem;
  font-weight: 700;
  background: var(--csapa-bleu);
  color: var(--csapa-or);
  padding: .15rem .5rem;
  border-radius: 4px;
  flex-shrink: 0;
}
