/* Frida grand public : une page, deux espaces, aucun décor. */
:root { --encre: #111111; --fond: #f5f4f0; --carte: #ffffff; --trait: #d9d7cf; --gris: #5f5e5a; --bon: #0b6b3a; --mauvais: #a4161a; --accent: #1d4ed8; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--fond); color: var(--encre); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
[hidden] { display: none !important; }

.tete { padding: 20px 24px 0; }
.marque { font-weight: 800; font-size: 1.3rem; letter-spacing: -0.02em; }
main { flex: 1; width: 100%; max-width: 1060px; margin: 0 auto; padding: 0 24px 40px; }
h1 { margin: 3vh 0 18px; font-size: clamp(3.3rem, 11.5vw, 7.8rem); line-height: 0.93; letter-spacing: -0.05em; font-weight: 800; text-wrap: balance; }
.accroche { max-width: 46rem; margin: 0 0 30px; font-size: clamp(1.05rem, 1.9vw, 1.3rem); line-height: 1.45; }
.alerte { margin: 0 0 20px; padding: 14px 18px; border: 1.5px solid var(--mauvais); border-radius: 12px; background: #fff; color: var(--mauvais); font-weight: 600; }

.espaces { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.espace { background: var(--carte); border: 1.5px solid var(--encre); border-radius: 18px; padding: 24px; min-width: 0; }
.espace.attente { opacity: 0.42; }
h2 { margin: 0 0 14px; font-size: 1.3rem; letter-spacing: -0.015em; }
.num { display: inline-grid; place-items: center; width: 1.75em; height: 1.75em; margin-right: 0.55em; border-radius: 50%; background: var(--encre); color: #fff; font-size: 0.78em; font-weight: 700; vertical-align: 0.08em; }

label { display: block; margin: 14px 0 6px; font-size: 0.93rem; font-weight: 600; }
input[type="email"], input[type="text"], input[type="password"], select { width: 100%; padding: 12px 14px; border: 1.5px solid var(--encre); border-radius: 10px; background: #fff; color: inherit; font: inherit; }
input::placeholder { color: #8a8983; }
#code { font-size: 1.5rem; letter-spacing: 0.35em; text-align: center; font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.case { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0; font-weight: 400; font-size: 0.93rem; cursor: pointer; }
.case input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--encre); }

button { padding: 13px 24px; border: 1.5px solid var(--encre); border-radius: 999px; background: var(--encre); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
button:disabled { opacity: 0.32; cursor: not-allowed; }
button.second { background: #fff; color: var(--encre); }
button.lien { padding: 2px; border: 0; border-radius: 4px; background: none; color: inherit; font-weight: 400; text-decoration: underline; text-underline-offset: 3px; }
.rangee { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.coche { margin: 8px 0; padding-left: 1.6em; position: relative; overflow-wrap: anywhere; }
.coche::before { content: "✓"; position: absolute; left: 0; font-weight: 800; color: var(--bon); }

.zone { padding: 30px 16px; border: 2px dashed var(--encre); border-radius: 14px; text-align: center; cursor: pointer; }
.zone.survol { background: #eceae3; }
.zoneTitre { margin: 0; font-size: 1.12rem; font-weight: 700; }
.zoneSous { margin: 2px 0 0; color: var(--gris); }
.aide { margin: 10px 0 0; color: var(--gris); font-size: 0.88rem; }
.liste { list-style: none; margin: 14px 0 0; padding: 0; }
.liste li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--trait); }
.liste .nom { font-weight: 600; overflow-wrap: anywhere; }
.liste .etat { grid-column: 1 / -1; font-size: 0.88rem; color: var(--gris); }
.liste .etat.bon { color: var(--bon); font-weight: 600; }
.liste .etat.mauvais { color: var(--mauvais); font-weight: 600; }
.liste progress { grid-column: 1 / -1; width: 100%; height: 6px; accent-color: var(--encre); }
.recu { margin: 14px 0 0; font-weight: 700; color: var(--bon); }
#lancer { margin-top: 18px; width: 100%; }

.traitement { max-width: 640px; margin: 8px 0 0; padding: 28px; background: var(--carte); border: 1.5px solid var(--encre); border-radius: 18px; }
.tourne { width: 64px; height: 64px; margin-bottom: 18px; border: 6px solid var(--trait); border-top-color: var(--encre); border-radius: 50%; animation: tour 1s linear infinite; }
.tourne.arret { animation: none; border-color: var(--bon); }
.tourne.panne { animation: none; border-color: var(--mauvais); }
@keyframes tour { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .tourne { animation-duration: 4s; } }
.etapes { list-style: none; margin: 6px 0 18px; padding: 0; }
.etapes li { display: flex; align-items: center; gap: 12px; padding: 7px 0; color: var(--gris); }
.etapes li::before { content: ""; flex: none; width: 18px; height: 18px; border: 2px solid var(--trait); border-radius: 50%; }
.etapes li.encours { color: var(--encre); font-weight: 700; }
.etapes li.encours::before { border-color: var(--trait); border-top-color: var(--encre); animation: tour 0.9s linear infinite; }
.etapes li.fait, .etapes li.partiel { color: var(--encre); }
.etapes li.fait::before, .etapes li.partiel::before { content: "✓"; display: grid; place-items: center; border-color: var(--bon); background: var(--bon); color: #fff; font-size: 12px; font-weight: 800; }
.etapes li.echec::before { content: "!"; display: grid; place-items: center; border-color: var(--mauvais); color: var(--mauvais); font-size: 12px; font-weight: 800; }
.etapes small { font-weight: 400; color: var(--gris); }
.message { margin: 0; font-size: 1.08rem; font-weight: 700; }

.pied { padding: 18px 24px 26px; text-align: center; color: var(--gris); font-size: 0.9rem; }
.pied p { margin: 0 0 6px; }

dialog { width: calc(100% - 32px); max-width: 760px; max-height: 90vh; padding: 0; border: 1.5px solid var(--encre); border-radius: 18px; background: #fff; color: var(--encre); }
dialog::backdrop { background: rgba(17, 17, 17, 0.6); }
.fenetre { display: flex; flex-direction: column; max-height: calc(90vh - 3px); padding: 24px; }
.fenetre h2 { margin-bottom: 10px; }
.texteEngagement { flex: 1; min-height: 120px; overflow-y: auto; padding: 4px 14px 4px 2px; border-top: 1px solid var(--trait); border-bottom: 1px solid var(--trait); font-size: 0.94rem; }
.texteEngagement h3 { margin: 18px 0 4px; font-size: 1rem; }
.texteEngagement p { margin: 6px 0; }
.texteEngagement .chapeau { color: var(--gris); }
.texteEngagement hr { margin: 22px 0 0; border: 0; border-top: 1px solid var(--trait); }
.reference { max-width: 46rem; margin: -16px 0 30px; color: var(--gris); font-size: 0.98rem; line-height: 1.45; }
select { appearance: auto; }
.boutons { display: flex; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }

body.outil main { max-width: 760px; padding-top: 28px; }
body.outil h1 { font-size: 2rem; letter-spacing: -0.02em; line-height: 1.15; margin: 6px 0 18px; }
body.outil pre { padding: 14px; border: 1px solid var(--trait); border-radius: 10px; background: #fff; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.86rem; }
body.outil form { margin: 14px 0; }
body.outil ul.controle { padding-left: 1.1em; }
body.outil li.bon { color: var(--bon); }
body.outil li.mauvais { color: var(--mauvais); font-weight: 600; }
body.outil button { margin-top: 14px; }

@media (max-width: 780px) {
  .espaces { grid-template-columns: 1fr; }
  main { padding: 0 16px 32px; }
  .tete { padding: 16px 16px 0; }
  .espace, .traitement, .fenetre { padding: 20px; }
  .boutons button { flex: 1; }
}
