/* Outil public « Calculer le classement de mon ERP » (/outil/classement-erp, 09/11/2026), sur base-landingpage.
 * Mêmes jetons que fiche-gratuite.css (landing-modern.css : --ink, --muted, --surface, --border-color, --primary,
 * --radius, --radius-lg), redéfinis par thème sur la section : base/_variables.css pose ses jetons CLAIRS sur body,
 * qui l'emportent sur les valeurs sombres de :root (piège constaté le 07/11/2026 sur les fiches).
 * Mobile d'abord (390 px), aucune couleur d'état écrite ailleurs que dans ces deux blocs de jetons. */

.outil-classement {
    --oc-atteint: #b91c1c;
    --oc-atteint-fond: #fef2f2;
    --oc-ok: #15803d;
    --oc-ok-fond: #f0fdf4;
    --oc-rouge: #dc2626;
}

html:not([data-theme="light"]) .outil-classement {
    --ink: #f1f5f9;
    --muted: #94a3b8;
    --surface: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --stroke: rgba(59, 130, 246, 0.3);
    --primary: #3b82f6;
    --bg: #0a0e27;
    --oc-atteint: #fca5a5;
    --oc-atteint-fond: rgba(239, 68, 68, 0.12);
    --oc-ok: #86efac;
    --oc-ok-fond: rgba(34, 197, 94, 0.12);
    --oc-rouge: #f87171;
}

/* landing-modern.css met toute <section> en flex centré, pleine hauteur, révélée au défilement : ici, un bloc
 * ordinaire, visible tout de suite (un outil ne se cache pas derrière une animation). */
section.outil-classement {
    display: block;
    min-height: 0;
    opacity: 1;
    transform: none;
}

.outil-classement {
    box-sizing: border-box;
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
    color: var(--ink);
    overflow-wrap: anywhere;
}

/* Un bloc caché par le script reste caché, même s'il porte un display (grille, flex). */
.outil-classement [hidden] {
    display: none !important;
}

.outil-classement *,
.outil-classement *::before,
.outil-classement *::after {
    box-sizing: border-box;
}

.outil-classement__surtitre {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--primary);
}

.outil-classement__titre {
    margin: 0 0 1rem;
    font-size: clamp(1.6rem, 6vw, 2.4rem);
    line-height: 1.2;
    color: var(--ink);
}

.outil-classement__intro {
    margin: 0 0 1.5rem;
    color: var(--muted);
    line-height: 1.6;
}

.outil-classement__carte {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1rem;
    margin: 0 0 1.5rem;
    min-width: 0;
}

/* ── Formulaire ─────────────────────────────────────────────────────────── */

.oc-etape {
    margin: 0 0 1.5rem;
    padding: 0;
    border: 0;
    min-width: 0;
}

.oc-etape[disabled] {
    opacity: 0.55;
}

.oc-etape__titre,
.oc-schema__etape h3 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 0.75rem;
    padding: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ink);
}

.oc-pastille {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
}

.oc-champ {
    display: grid;
    gap: 0.35rem;
    margin: 0 0 0.85rem;
    min-width: 0;
}

.oc-champ label {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--muted);
}

.oc-champ input,
.oc-champ select {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 0.6rem 0.75rem;
    font: inherit;
    color: var(--ink);
    background: var(--bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.oc-champ input:focus,
.oc-champ select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--stroke);
}

.oc-aide {
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--muted);
}

.oc-champ .oc-aide {
    margin: 0;
}

.oc-lignes {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}

.oc-ligne {
    padding: 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg);
    min-width: 0;
}

.oc-ligne .oc-champ input,
.oc-ligne .oc-champ select {
    background: var(--surface);
}

.oc-ligne__tete {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 0.5rem;
    min-height: 44px;
}

.oc-ligne__numero {
    font-weight: 600;
    color: var(--ink);
}

.oc-ligne__retirer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
}

.oc-ligne__retirer:hover,
.oc-ligne__retirer:focus-visible {
    color: var(--oc-rouge);
    border-color: var(--oc-rouge);
}

.oc-ajouter,
.oc-calculer {
    width: 100%;
    justify-content: center;
    min-height: 44px;
}

.oc-ajouter {
    margin: 0 0 1.25rem;
}

.oc-erreurs {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--oc-rouge);
    border-radius: var(--radius);
    color: var(--oc-rouge);
}

.oc-erreurs__liste {
    margin: 0;
    padding-left: 1.1rem;
}

.oc-message--erreur {
    margin: 0 0 1rem;
    color: var(--oc-rouge);
}

/* ── Le schéma ──────────────────────────────────────────────────────────── */

.oc-resultat:focus {
    outline: none;
}

.oc-resultat__titre {
    margin: 0 0 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ink);
}

.oc-schema {
    list-style: none;
    margin: 0;
    padding: 0;
}

.oc-schema__etape,
.oc-conclusion {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    opacity: 0.25;
    transition: opacity 0.35s ease, border-color 0.35s ease;
}

.oc-schema__etape.oc-allume,
.oc-conclusion.oc-allume {
    opacity: 1;
    border-color: var(--primary);
}

.oc-schema__etape p {
    margin: 0;
    line-height: 1.5;
}

.oc-schema__fleche {
    display: flex;
    justify-content: center;
    padding: 0.25rem 0;
    color: var(--primary);
}

.oc-calculs,
.oc-seuils {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
}

.oc-calculs li {
    line-height: 1.5;
}

.oc-calculs__mode {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
}

.oc-total {
    margin: 0.75rem 0 0 !important;
    font-weight: 600;
}

.oc-seuil {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.15rem 0.75rem;
    align-items: center;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius);
    background: var(--oc-ok-fond);
}

.oc-seuil__libelle {
    font-weight: 600;
}

.oc-seuil__valeur {
    font-weight: 700;
    white-space: nowrap;
    color: var(--oc-ok);
}

.oc-seuil__etat {
    grid-column: 1 / -1;
    font-size: 0.8rem;
    color: var(--muted);
}

.oc-seuil--atteint {
    background: var(--oc-atteint-fond);
}

.oc-seuil--atteint .oc-seuil__valeur,
.oc-seuil--atteint .oc-seuil__etat {
    color: var(--oc-atteint);
}

.oc-sorties {
    display: grid;
    gap: 0.75rem;
}

.oc-sortie {
    padding: 0.85rem;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius);
}

.oc-sortie p {
    margin: 0 0 0.5rem;
}

.oc-sortie__titre {
    font-weight: 700;
}

.oc-sortie--retenue {
    border: 2px solid var(--primary);
}

.oc-sortie--ecartee {
    opacity: 0.45;
}

.oc-tranches {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.oc-tranches th,
.oc-tranches td {
    padding: 0.4rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.oc-tranches th {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--muted);
}

.oc-tranche--active td {
    font-weight: 700;
    color: var(--primary);
}

.oc-masque {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.oc-conclusion {
    margin: 1rem 0 0;
}

.oc-conclusion__categorie {
    margin: 0 0 0.75rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}

.oc-conclusion__sous-titre {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.oc-phrase {
    margin: 0 0 0.75rem;
    padding: 0.75rem 1rem;
    border-left: 3px solid var(--primary);
    background: var(--bg);
    border-radius: 0 var(--radius) var(--radius) 0;
    line-height: 1.6;
}

.oc-mention {
    margin: 0.75rem 0 0;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--muted);
}

/* ── La suite ───────────────────────────────────────────────────────────── */

.oc-suite,
.oc-non-merci {
    margin: 1.25rem 0 0;
    padding: 1rem;
    border: 1px solid var(--primary);
    border-radius: var(--radius);
}

.oc-suite p,
.oc-non-merci p {
    margin: 0 0 0.75rem;
    line-height: 1.5;
}

.oc-suite__titre {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.oc-projet {
    display: grid;
    gap: 0.5rem;
    margin: 0 0 1rem;
    padding: 0;
    border: 0;
    min-width: 0;
}

.oc-projet legend {
    margin: 0 0 0.35rem;
    padding: 0;
    font-weight: 600;
}

.oc-projet__choix {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
}

.oc-projet__choix:has(:checked) {
    border-color: var(--primary);
}

.oc-projet__choix input {
    accent-color: var(--primary);
}

.oc-suite__boutons {
    display: grid;
    gap: 0.6rem;
}

.oc-suite__boutons .btn,
.oc-non-merci .btn {
    justify-content: center;
    width: 100%;
    min-height: 44px;
    text-align: center;
    white-space: normal;
}

@media (min-width: 640px) {
    .outil-classement {
        padding: 3rem 1.5rem 4rem;
    }
    .outil-classement__carte {
        padding: 1.5rem;
    }
    .oc-ligne {
        display: grid;
        grid-template-columns: 9rem minmax(0, 1fr) 9rem;
        gap: 0 0.75rem;
    }
    .oc-ligne__tete,
    .oc-ligne [data-bloc="surface"] {
        grid-column: 1 / -1;
    }
    .oc-sorties {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
    .oc-projet {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
    .oc-projet legend {
        grid-column: 1 / -1;
    }
    .oc-suite__boutons {
        grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    }
    .oc-ajouter,
    .oc-calculer {
        width: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .oc-schema__etape,
    .oc-conclusion {
        transition: none;
    }
}
