/* Générateur — la saisie à gauche, la feuille à droite. Mobile d'abord. */
.outil-tete { padding: 34px 0 10px; }
.outil-tete h1 { font-size: clamp(1.9rem, 4.4vw, 3.1rem); max-width: 22ch; }
.outil-tete__sous { color: var(--encre-2); max-width: 62ch; }
.reprise { background: var(--punaise-pale); border-radius: var(--rayon-petit); padding: 10px 14px; font-size: .95rem; }

.outil { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; padding-bottom: 110px; }
@media (min-width: 1040px) {
    .outil { grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); align-items: start; padding-bottom: 40px; }
}
.outil__saisie { min-width: 0; }

.bloc { border: 1px solid var(--filet); background: var(--surface); border-radius: var(--rayon); padding: 18px 18px 8px; margin: 0 0 18px; box-shadow: var(--ombre); min-width: 0; }
@media (min-width: 720px) { .bloc { padding: 24px 26px 12px; } }
.bloc__titre { font-family: var(--titre); font-size: 1.35rem; font-weight: 600; display: flex; align-items: center; gap: 12px; padding: 0; margin: 0 0 14px; }
.bloc__num { width: 30px; height: 30px; border-radius: 50%; background: var(--encre); color: var(--papier); font: 700 .9rem var(--corps); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.bloc--achat { border: 2px solid var(--punaise); }
.grille-2, .grille-3 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; }
@media (min-width: 600px) { .grille-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grille-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .champ--large { grid-column: 1 / -1; } }
.champ--court { max-width: 260px; }
.etiquette { font: 700 .7rem var(--corps); text-transform: uppercase; letter-spacing: .06em; background: var(--alerte-pale); color: var(--alerte); padding: 2px 7px; border-radius: 99px; margin-left: 6px; }
.lien-bouton { background: none; border: 0; padding: 0; font: inherit; color: var(--punaise); text-decoration: underline; cursor: pointer; }
[hidden] { display: none !important; }

.annuaire { position: relative; margin: 0 0 16px; padding: 14px; border-radius: var(--rayon-petit); background: var(--papier-2); }
.annuaire input { width: 100%; font: 400 1rem var(--corps); padding: .7em .85em; border-radius: var(--rayon-petit); border: 1.5px solid var(--filet-fort); background: var(--surface); color: var(--encre); min-height: 46px; margin-top: 6px; }
.annuaire__liste { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.annuaire__liste button { width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--filet); border-radius: var(--rayon-petit); padding: 10px 12px; cursor: pointer; color: var(--encre); font: inherit; display: flex; flex-direction: column; gap: 2px; }
.annuaire__liste button:hover, .annuaire__liste button:focus-visible { border-color: var(--punaise); }
.annuaire__liste span { font-size: .85rem; color: var(--encre-3); }

.puces { display: flex; flex-wrap: wrap; gap: 8px; }
.puce { position: relative; cursor: pointer; }
.puce input { position: absolute; opacity: 0; inset: 0; }
.puce span { display: inline-block; padding: 8px 14px; border: 1.5px solid var(--filet-fort); border-radius: 999px; font-size: .92rem; font-weight: 500; background: var(--papier); transition: all .15s; }
.puce input:checked + span { background: var(--encre); color: var(--papier); border-color: var(--encre); }
.puce input:focus-visible + span { outline: 3px solid var(--punaise); outline-offset: 2px; }

/* Achat */
.valeur { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 7px; }
.valeur li { padding-left: 26px; position: relative; }
.valeur li::before { content: ""; position: absolute; left: 4px; top: .45em; width: 9px; height: 9px; border-radius: 50%; background: var(--punaise-vive); box-shadow: 0 0 0 3px var(--punaise-pale); }
.formules { display: grid; gap: 10px; margin: 0 0 18px; }
.formule { position: relative; display: block; cursor: pointer; }
.formule input { position: absolute; opacity: 0; }
.formule__corps { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; border: 1.5px solid var(--filet-fort); border-radius: var(--rayon); padding: 14px 16px; background: var(--papier); transition: border-color .15s, box-shadow .15s; }
.formule input:checked + .formule__corps { border-color: var(--punaise); box-shadow: 0 0 0 3px color-mix(in srgb, var(--punaise) 22%, transparent); background: var(--surface); }
.formule input:focus-visible + .formule__corps { outline: 3px solid var(--punaise); outline-offset: 2px; }
.formule__nom { font-weight: 700; }
.formule__prix { font-family: var(--titre); font-size: 1.5rem; font-weight: 600; grid-row: span 2; align-self: center; white-space: nowrap; }
.formule__prix small { font: 500 .8rem var(--corps); color: var(--encre-3); }
.formule__note { font-size: .84rem; color: var(--encre-3); }
.formule--vedette .formule__corps::before { content: "Le plus simple"; position: absolute; top: -10px; left: 14px; background: var(--punaise); color: var(--sur-punaise); font: 700 .68rem var(--corps); letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 99px; }
.code-promo { margin: 0 0 12px; font-size: .92rem; }
.code-promo summary { cursor: pointer; color: var(--encre-2); }
.case--consentement { border-top: 0; font-size: .86rem; }
.erreur-achat { color: var(--erreur); font-weight: 600; margin: 10px 0 0; }
.rassure { margin-top: 10px; }
.plus-tard { border-top: 1px dashed var(--filet-fort); margin-top: 18px; padding-top: 16px; }

/* Aperçu */
.apercu { position: sticky; top: 80px; display: none; flex-direction: column; min-width: 0; max-height: calc(100vh - 96px); background: var(--papier-2); border: 1px solid var(--filet); border-radius: var(--rayon); overflow: hidden; }
@media (min-width: 1040px) { .apercu { display: flex; } }
.apercu.est-ouvert { display: flex; position: fixed; inset: 0; top: 0; max-height: none; border-radius: 0; z-index: 60; }
.apercu__barre { padding: 12px 14px 0; display: flex; flex-direction: column; gap: 10px; }
.apercu__fermer { align-self: flex-end; background: var(--surface); border: 1px solid var(--filet-fort); color: var(--encre); border-radius: 99px; width: 40px; height: 40px; cursor: pointer; font-size: 1rem; }
@media (min-width: 1040px) { .apercu:not(.est-ouvert) .apercu__fermer { display: none; } }
.apercu__onglets { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.apercu__onglet { flex: none; border: 1px solid var(--filet-fort); background: transparent; color: var(--encre-2); border-radius: 99px; padding: 7px 12px; font: 600 .84rem var(--corps); cursor: pointer; white-space: nowrap; }
.apercu__onglet.est-actif { background: var(--encre); color: var(--papier); border-color: var(--encre); }
.apercu__etat { font-size: .8rem; color: var(--encre-3); margin: 0; display: flex; align-items: center; gap: 8px; }
.apercu__etat::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.est-en-cours .apercu__etat::before { background: var(--punaise-vive); animation: pouls 1s infinite; }
@keyframes pouls { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .est-en-cours .apercu__etat::before { animation: none; } }

.controle { background: var(--surface); border: 1px solid var(--filet); border-radius: var(--rayon-petit); }
.controle__tete { width: 100%; display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 10px 12px; cursor: pointer; color: var(--encre); font: 600 .9rem var(--corps); text-align: left; }
.controle__jauge { flex: 0 0 90px; height: 8px; border-radius: 99px; background: var(--papier-2); overflow: hidden; }
.controle__jauge span { display: block; height: 100%; width: 0; background: var(--alerte); transition: width .4s ease; }
.controle.est-conforme .controle__jauge span { background: var(--ok); }
.controle__liste { list-style: none; margin: 0; padding: 4px 12px 10px; display: grid; gap: 6px; font-size: .86rem; max-height: 38vh; overflow: auto; }
.controle__liste li { display: flex; gap: 10px; align-items: flex-start; }
.controle__liste li[role=button] { cursor: pointer; }
.controle__liste em { color: var(--encre-3); font-style: normal; font-size: .8rem; }
.controle__liste small { color: var(--alerte); }
.controle__signe { flex: none; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .75rem; background: var(--ok-pale); color: var(--ok); }
.est-manquant .controle__signe { background: var(--alerte-pale); color: var(--alerte); }
.est-conseil .controle__signe { background: var(--papier-2); color: var(--encre-3); }

/* La feuille : toujours blanche, comme le document livré */
.feuille { margin: 12px; background: var(--doc-fond); color: var(--doc-encre); border-radius: 6px; box-shadow: 0 1px 0 rgba(0,0,0,.05), 0 20px 40px -24px rgba(0,0,0,.4); padding: 34px 30px 40px; overflow-y: auto; flex: 1; font-family: var(--feuille); font-size: .97rem; line-height: 1.6; position: relative; }
@media (max-width: 600px) { .feuille { padding: 24px 18px 30px; margin: 10px 8px; } }
.feuille h1 { font-family: var(--titre); font-size: 1.9rem; text-align: center; color: #14213D; margin-bottom: .4em; }
.feuille h2 { font-family: var(--titre); font-size: 1.2rem; color: #14213D; margin: 1.5em 0 .5em; padding-bottom: 4px; border-bottom: 1.5px solid var(--doc-filet); }
.feuille h3 { font-family: var(--feuille); font-size: 1rem; font-weight: 600; margin: 1.1em 0 .3em; color: #14213D; }
.feuille p, .feuille li { margin: 0 0 .6em; }
.feuille table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: .5em 0 1em; }
.feuille th, .feuille td { border: 1px solid var(--doc-filet); padding: 6px 8px; text-align: left; vertical-align: top; }
.feuille .ri-ident { text-align: center; color: var(--doc-doux); }
.feuille .ri-signature { margin-top: 1.6em; }
.feuille .cache { color: #6b7280; }
.feuille .a-change { background: linear-gradient(transparent 55%, #FED7AA 55%); transition: background 1.6s ease; }
.feuille .trouve { background: #FDBA74; border-radius: 3px; box-shadow: 0 0 0 2px #FDBA74; }
.feuille__attente { color: var(--doc-doux); text-align: center; margin-top: 30%; }
.feuille__note { font-size: .88rem; color: var(--doc-doux); text-align: center; }
.verrou { position: sticky; bottom: -40px; margin: 22px -30px -40px; padding: 26px 30px 30px; background: linear-gradient(180deg, rgba(255,255,255,0), #fff 30%); text-align: center; font-family: var(--corps); }
.verrou__titre { font-family: var(--titre); font-size: 1.4rem; font-weight: 600; color: #14213D; margin: 0 0 4px; }
.verrou p { color: #3B4558; font-size: .92rem; }
.verrou .bouton { background: #C2410C; border-color: #C2410C; color: #fff; }
.frise { list-style: none; padding: 0; margin: 20px 0 0; border-left: 2px solid #E5E1D8; }
.frise li { position: relative; padding: 0 0 20px 22px; display: flex; flex-direction: column; gap: 2px; font-family: var(--corps); font-size: .92rem; }
.frise li::before { content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: #EA580C; box-shadow: 0 0 0 3px #FDE7D8; }
.frise__date { font-family: var(--titre); font-size: 1.05rem; color: #14213D; font-weight: 600; }
.frise em { color: #5E6675; font-size: .8rem; font-style: normal; }

/* Barre collante mobile */
.barre-mobile { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--papier) 94%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--filet); }
.barre-mobile .bouton { flex: 1; padding: .8em .6em; font-size: .92rem; }
.pastille { background: var(--encre); color: var(--papier); border-radius: 99px; padding: 1px 7px; font-size: .78rem; }
@media (min-width: 1040px) { .barre-mobile { display: none; } }
body.sans-defilement { overflow: hidden; }
.page-outil .pied { margin-top: 0; }
legend.bloc__titre { float: left; width: 100%; margin-bottom: 14px; }
legend.bloc__titre + * { clear: both; }
