/* CDS Thématique Magnet — couleurs marque : #39637c bleu, #75afcc bleu clair, #ca7c00 or */

.cdstm {
    --cdstm-bleu: #39637c;
    --cdstm-bleu-clair: #75afcc;
    --cdstm-or: #ca7c00;
    --cdstm-encre: #2b2b2b;
    --cdstm-trait: #d9e2e8;
    max-width: 640px;
    margin: 0 auto;
    padding: 4px;
    color: var(--cdstm-encre);
    font-size: 16px;
    line-height: 1.5;
    box-sizing: border-box;
}
.cdstm *, .cdstm *::before, .cdstm *::after { box-sizing: inherit; }

.cdstm-head { text-align: center; margin-bottom: 22px; }
.cdstm-title {
    color: var(--cdstm-bleu);
    font-size: 1.6em;
    margin: 0 0 8px;
}
.cdstm-intro {
    margin: 0;
    color: #4a5963;
    font-size: 0.98em;
}

.cdstm-field { display: block; margin-bottom: 18px; }
.cdstm-label,
.cdstm-step {
    display: block;
    font-weight: 600;
    color: var(--cdstm-bleu);
    margin-bottom: 6px;
}
.cdstm-step { margin: 22px 0 12px; }

.cdstm-expertise,
.cdstm-idea,
.cdstm-candidate {
    width: 100%;
    border: 1px solid var(--cdstm-trait);
    border-radius: 8px;
    padding: 11px 13px;
    font: inherit;
    color: inherit;
    background: #fff;
}
.cdstm-expertise:focus,
.cdstm-idea:focus,
.cdstm-candidate:focus {
    outline: none;
    border-color: var(--cdstm-bleu-clair);
    box-shadow: 0 0 0 3px rgba(117, 175, 204, 0.25);
}
.cdstm-idea { resize: vertical; }

/* Accordéon des angles */
.cdstm-angle {
    border: 1px solid var(--cdstm-trait);
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
    background: #fff;
}
.cdstm-angle-head {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    border: 0;
    background: #f5f8fa;
    padding: 14px 16px;
    cursor: pointer;
    font: inherit;
    text-align: left;
    color: var(--cdstm-bleu);
}
.cdstm-angle-num {
    flex: 0 0 auto;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--cdstm-bleu);
    color: #fff;
    font-size: 0.85em;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.cdstm-angle-titre { flex: 1 1 auto; font-weight: 600; }
.cdstm-angle-chevron {
    flex: 0 0 auto;
    font-size: 1.3em;
    color: var(--cdstm-or);
    transition: transform 0.2s ease;
}
.cdstm-angle.open .cdstm-angle-chevron { transform: rotate(45deg); }

.cdstm-angle-body {
    display: none;
    padding: 14px 16px 16px;
}
.cdstm-angle.open .cdstm-angle-body { display: block; }
.cdstm-angle-q {
    margin: 0 0 10px;
    color: #4a5963;
    font-style: italic;
}

/* Convergence */
.cdstm-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.cdstm-chip {
    border: 1px solid var(--cdstm-bleu-clair);
    background: #eef5f9;
    color: var(--cdstm-bleu);
    border-radius: 999px;
    padding: 6px 13px;
    font: inherit;
    font-size: 0.88em;
    cursor: pointer;
}
.cdstm-chip:hover { background: var(--cdstm-bleu-clair); color: #fff; }

.cdstm-candidates {
    list-style: none;
    counter-reset: cand;
    margin: 0; padding: 0;
}
.cdstm-candidates li {
    counter-increment: cand;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.cdstm-candidates li::before {
    content: counter(cand);
    flex: 0 0 auto;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--cdstm-or);
    color: #fff;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}

/* Validation */
.cdstm-validate {
    display: block;
    width: 100%;
    margin-top: 20px;
    border: 0;
    border-radius: 10px;
    background: var(--cdstm-or);
    color: #fff;
    font: inherit;
    font-weight: 700;
    font-size: 1.05em;
    padding: 14px;
    cursor: pointer;
}
.cdstm-validate:hover { background: #b06d00; }
.cdstm-validate:disabled { opacity: 0.6; cursor: default; }

.cdstm-msg {
    margin: 14px 0 0;
    text-align: center;
    font-weight: 600;
    min-height: 1.4em;
}
.cdstm-msg-err { color: #c0392b; }
.cdstm-msg-ok  { color: var(--cdstm-bleu); }

/* Étape 2 — évaluation 3 A */
.cdstm-eval { margin-top: 26px; padding-top: 22px; border-top: 2px solid var(--cdstm-trait); }
.cdstm-criteres { list-style: none; margin: 0 0 16px; padding: 0; }
.cdstm-critere {
    border-left: 3px solid var(--cdstm-or);
    padding: 4px 0 4px 12px;
    margin-bottom: 10px;
}
.cdstm-critere-titre { font-weight: 700; color: var(--cdstm-bleu); }
.cdstm-critere-sous { color: #8a97a0; font-size: 0.9em; margin-left: 4px; }
.cdstm-critere-q { display: block; color: #4a5963; font-style: italic; }

.cdstm-grid { width: 100%; border-collapse: collapse; }
.cdstm-grid th, .cdstm-grid td {
    border: 1px solid var(--cdstm-trait);
    padding: 8px;
    text-align: center;
}
.cdstm-grid th { background: #f5f8fa; color: var(--cdstm-bleu); font-size: 0.9em; }
.cdstm-grid-th-name, .cdstm-grid-name { text-align: left; }
.cdstm-grid-name { font-weight: 600; color: var(--cdstm-bleu); }
.cdstm-grid-name:empty::before { content: attr(data-empty); color: #b8c2c9; font-weight: 400; }
.cdstm-score { font: inherit; padding: 6px; border: 1px solid var(--cdstm-trait); border-radius: 6px; }
.cdstm-grid-total { font-weight: 800; }
.cdstm-grid-row.is-out { background: #fdecea; }
.cdstm-grid-row.is-out .cdstm-grid-total { color: #c0392b; }
.cdstm-grid-row.is-win { background: #f1f8f3; }
.cdstm-grid-row.is-win .cdstm-grid-total { color: #2e9e4f; }

.cdstm-eval-result { margin: 14px 0 4px; font-weight: 600; text-align: center; min-height: 1.4em; }
.cdstm-eval-note { margin: 0; color: #8a97a0; font-size: 0.9em; }

@media (max-width: 480px) {
    .cdstm-grid th, .cdstm-grid td { padding: 5px; }
    .cdstm-score { padding: 4px; }
    .cdstm { font-size: 15px; }
    .cdstm-title { font-size: 1.4em; }
}
