/* === Bilan de mise en œuvre (« ça a marché ? ») — js/plan-bilan.js ===
   Partagé par le widget d'accueil (css/my-plans.css) et implementation.html. */

.pb-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
    color: #1f2937;
    font-family: var(--font-family, 'Inter', 'Segoe UI', 'Roboto', sans-serif);
}

.pb-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
    color: #193461;
}

.pb-intro {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.5;
    color: #4b5563;
}

/* Lecteurs d'écran uniquement (implementation.html ne charge pas css/accessibility.css) */
.pb-sr,
.pb-live {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Oui / En partie / Non : vrais boutons radio, habillés en cartes */
.pb-choices {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.pb-choice {
    position: relative;
    display: block;
    min-width: 0;
    cursor: pointer;
}

.pb-choice input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.pb-choice-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 76px;
    padding: 10px 8px;
    border: 2px solid #94a3b8;
    border-radius: 12px;
    background: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    color: #1f2937;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

/* Pictogramme de réponse : cercle plein (Oui), à moitié plein (En partie), vide (Non).
   Dessiné en CSS (aria-hidden) : le libellé texte porte l'information. */
.pb-mark {
    --pb-mark-color: #64748b;
    --pb-mark-fill: #dbe2ec;
    display: inline-block;
    flex: 0 0 auto;
    box-sizing: border-box;
    width: 22px;
    height: 22px;
    border: 2px solid var(--pb-mark-color);
    border-radius: 50%;
    background: transparent;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

/* Au repos : teinte atténuée (un cercle plein ne doit pas se lire comme « déjà coché »).
   Choisi : couleur pleine de la réponse. */
.pb-mark-worked {
    background: var(--pb-mark-fill);
}

.pb-mark-partial {
    background: linear-gradient(90deg, var(--pb-mark-fill) 50%, transparent 50%);
}

.pb-choice:hover .pb-mark { --pb-mark-color: #193461; }
.pb-choice-worked input:checked + .pb-choice-body .pb-mark { --pb-mark-color: #2e7d32; --pb-mark-fill: #2e7d32; }
.pb-choice-partial input:checked + .pb-choice-body .pb-mark { --pb-mark-color: #b45309; --pb-mark-fill: #b45309; }
.pb-choice-failed input:checked + .pb-choice-body .pb-mark { --pb-mark-color: #b91c1c; --pb-mark-fill: #b91c1c; }

/* Dans la pastille de récapitulatif : plus petit, couleur du texte de la pastille */
.pb-chip .pb-mark {
    --pb-mark-color: currentColor;
    --pb-mark-fill: currentColor;
    width: 12px;
    height: 12px;
    border-width: 1.5px;
}

.pb-choice:hover .pb-choice-body {
    border-color: #193461;
}

.pb-choice input:focus-visible + .pb-choice-body {
    outline: 3px solid #0b6b8a;
    outline-offset: 2px;
}

.pb-choice input:checked + .pb-choice-body {
    border-color: #193461;
    background: #eef2ff;
    box-shadow: 0 0 0 1px #193461;
}

.pb-choice-worked input:checked + .pb-choice-body {
    border-color: #2e7d32;
    background: #e8f5e9;
    box-shadow: 0 0 0 1px #2e7d32;
}

.pb-choice-partial input:checked + .pb-choice-body {
    border-color: #b45309;
    background: #fff7ed;
    box-shadow: 0 0 0 1px #b45309;
}

.pb-choice-failed input:checked + .pb-choice-body {
    border-color: #b91c1c;
    background: #fef2f2;
    box-shadow: 0 0 0 1px #b91c1c;
}

.pb-error {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #b91c1c;
}

.pb-error[hidden] {
    display: none;
}

/* Commentaire facultatif (500 caractères max) */
.pb-comment {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pb-comment label {
    font-size: 0.92rem;
    font-weight: 600;
    color: #1f2937;
}

.pb-optional {
    font-weight: 400;
    color: #4b5563;
}

.pb-comment textarea {
    box-sizing: border-box;
    width: 100%;
    min-height: 84px;
    padding: 10px 12px;
    border: 1px solid #64748b;
    border-radius: 10px;
    background: #ffffff;
    font: inherit;
    font-size: 0.95rem;
    line-height: 1.45;
    color: #1f2937;
    resize: vertical;
}

.pb-comment textarea:focus-visible {
    outline: 3px solid #0b6b8a;
    outline-offset: 1px;
    border-color: #0b6b8a;
}

.pb-count {
    align-self: flex-end;
    font-size: 0.8rem;
    color: #4b5563;
}

.pb-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.pb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 12px;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pb-btn:focus-visible {
    outline: 3px solid #0b6b8a;
    outline-offset: 2px;
}

.pb-btn[disabled] {
    opacity: 0.6;
    cursor: progress;
}

.pb-btn-primary {
    background: #193461;
    border-color: #193461;
    color: #ffffff;
}

.pb-btn-primary:hover:not([disabled]) {
    background: #122647;
    border-color: #122647;
}

.pb-btn-secondary {
    background: #ffffff;
    border-color: #193461;
    color: #193461;
}

.pb-btn-secondary:hover:not([disabled]) {
    background: #eef2ff;
}

/* « Ne plus demander » : action discrète mais réelle cible tactile de 44 px */
.pb-btn-link {
    padding-left: 8px;
    padding-right: 8px;
    background: transparent;
    color: #4b5563;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.pb-btn-link:hover {
    color: #193461;
}

.pb-status {
    margin: 0;
    font-size: 0.9rem;
    color: #4b5563;
}

.pb-status:empty {
    display: none;
}

/* Remerciement / récapitulatif */
.pb-recap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.pb-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    background: #eef2ff;
    color: #193461;
}

.pb-chip-worked {
    background: #e8f5e9;
    color: #1b5e20;
}

.pb-chip-partial {
    background: #fff7ed;
    color: #9a3412;
}

.pb-chip-failed {
    background: #fef2f2;
    color: #991b1b;
}

.pb-date {
    font-size: 0.85rem;
    color: #4b5563;
}

.pb-thanks-text {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #1f2937;
}

.pb-thanks-text:focus {
    outline: none;
}

.pb-quote {
    margin: 0;
    padding: 8px 12px;
    border-left: 3px solid #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.45;
    color: #374151;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* Section d'implementation.html */
.plan-bilan-section {
    padding: 0 0 24px;
}

.plan-bilan-section[hidden] {
    display: none;
}

.plan-bilan-mount > .pb-panel {
    padding: 20px 24px;
    background: #ffffff;
    border: 1px solid #e0e4e8;
    border-left: 5px solid #ac2777;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(4, 4, 4, 0.12);
}

.plan-bilan-mount .pb-title {
    font-size: 1.2rem;
}

.plan-bilan-mount .pb-choices {
    max-width: 520px;
}

.plan-bilan-mount .pb-comment textarea {
    max-width: 720px;
}

@media (max-width: 480px) {
    .pb-choices {
        gap: 8px;
    }

    .pb-choice-body {
        padding: 10px 4px;
        font-size: 0.9rem;
    }

    .pb-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .pb-btn {
        width: 100%;
    }

    .plan-bilan-mount > .pb-panel {
        padding: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pb-choice-body,
    .pb-btn {
        transition: none;
    }
}
