/* Le parcours du rapport gratuit : une application, pas une page de présentation. */

.df { display: grid; grid-template-columns: minmax(0, 1fr); min-height: calc(100svh - 69px); font-size: 15px; line-height: 1.45; }
.df-main { min-width: 0; padding: 24px 16px 48px; }
.df select, .df textarea { font: inherit; color: inherit; }
.df h1 { font-size: 1.75rem; line-height: 1.15; font-weight: 700; letter-spacing: -.012em; }
.df h1:focus, .dw h1:focus { outline: 0; }
.df-enter { animation: df-in .35s var(--out); }
@keyframes df-in { from { opacity: 0; } to { opacity: 1; } }

/* Barre d'étapes */
.df-head { display: flex; align-items: center; gap: 14px; margin-bottom: 32px; }
.df-steps { display: flex; gap: 4px; }
.df-steps li { width: 20px; height: 5px; border-radius: 2px; background: var(--line); transition: width .4s var(--out), background-color .3s; }
.df-steps li.is-done { background: var(--ink); }
.df-steps li.is-on { width: 52px; background: var(--violet); }
.df-count { font: 400 .8rem/1 var(--mono); color: var(--mute); }

/* Formulaires */
.df-form { max-width: 520px; }
.df-form.is-wide { max-width: 1180px; }
.df-sub { margin-top: 8px; color: var(--mute); max-width: 56ch; }
.df-field { margin-top: 22px; min-width: 0; }
.df-field label, .df-set legend { display: block; font-weight: 600; font-size: .93rem; margin-bottom: 6px; }
.df-form input:not(.trap):not(.df-check), .df-form select, .q-edit {
  display: block; width: 100%; height: 46px; padding: 0 12px; font-size: 16px; background: #fff;
  border: 1px solid #8C8C94; border-radius: 6px; outline: 0; transition: border-color .15s;
}
.df-form input:not(.trap):not(.df-check):hover, .df-form select:hover { border-color: var(--mute); }
.df-form input:not(.trap):not(.df-check):focus, .df-form select:focus, .q-edit:focus { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.df-form input[aria-invalid="true"] { border-color: var(--red); }
.df-form select {
  appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23111114' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center / 12px;
}
.df-two { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 12px; }
.df-err { margin-top: 6px; color: var(--red); font-size: .9rem; }
.df-err a { color: inherit; }
.df-fine { margin-top: 10px; font-size: .86rem; color: var(--mute); }
.df-note { margin-top: 16px; padding: 10px 12px; background: var(--wash); border: 1px solid var(--line); border-radius: 6px; font-size: .92rem; }
.df-work { display: flex; align-items: center; gap: 10px; min-height: 22px; margin-top: 16px; font-size: .93rem; color: var(--ink); }
.df-work:empty { margin-top: 0; min-height: 0; }
.df-work .vmark, .dw-mark .vmark { flex: none; margin: 0; }
.df-msg { margin-top: 8px; font-size: .9rem; color: var(--ink); }
.df-msg:empty { margin-top: 0; }

/* Boutons */
.df-foot { display: flex; gap: 10px; margin-top: 28px; }
.df-go { flex: 1; min-width: 0; height: 48px; padding: 0 18px; background: var(--ink); color: #fff; border-radius: 6px; font-weight: 600; transition: background-color .15s; }
.df-go:hover { background: #2C2C33; }
.df-go[aria-disabled="true"] { background: var(--mute); cursor: progress; }
.df-back { height: 48px; padding: 0 18px; border: 1px solid #B9B9B2; border-radius: 6px; font-weight: 500; background: #fff; }
.df-back:hover { border-color: var(--ink); }
.df-mini { flex: none; height: 46px; padding: 0 14px; border: 1px solid #B9B9B2; border-radius: 6px; font-weight: 500; font-size: .93rem; background: #fff; }
.df-mini:hover { border-color: var(--ink); }

/* Cases natives */
.df-check {
  appearance: none; -webkit-appearance: none; flex: none; width: 20px; height: 20px; margin: 0; cursor: pointer;
  background: #fff no-repeat center / 14px; border: 1.5px solid #8C8C94; border-radius: 4px; transition: background-color .12s, border-color .12s;
}
.df-check:hover { border-color: var(--ink); }
.df-check:checked {
  background-color: var(--ink); border-color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2.5 7.5 5.5 10.5 11.5 3.5' fill='none' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E");
}

/* Lignes à cocher */
.df-set { margin: 22px 0 0; padding: 0; border: 0; min-width: 0; }
.df-set legend { display: flex; justify-content: space-between; align-items: baseline; width: 100%; padding: 0; margin-bottom: 8px; }
.df-tally { font: 400 .8rem/1.3 var(--mono); color: var(--mute); }
.df-tally.is-big { flex: none; font: 500 .95rem/1.3 var(--mono); color: var(--ink); }
.opt { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px; background: #fff; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; transition: border-color .15s, background-color .15s; }
.opt + .opt { margin-top: 6px; }
.opt:hover { border-color: #B9B9B2; }
.opt.is-on { border-color: var(--ink); background: #FBFDEE; background: color-mix(in srgb, var(--lime) 13%, #fff); }
.opt-name { flex: 1; min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
.opt small { flex: none; color: var(--mute); font-size: .82rem; font-weight: 400; }
.opt-name small { display: block; font: 400 .8rem/1.3 var(--mono); }
.df-tile { flex: none; display: grid; place-items: center; width: 32px; height: 32px; background: #fff; border: 1px solid var(--line); border-radius: 6px; font-weight: 600; font-size: .9rem; color: var(--ink); }
.df-add { display: flex; gap: 8px; margin-top: 10px; }
.df-add input { flex: 1; min-width: 0; }
.df-add.is-two { flex-wrap: wrap; }
.df-add.is-two input { flex: 1 1 100%; }
.df-add.is-two .df-mini { flex: 1 1 100%; }
.df-mail { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }

/* Étape 3 : thématiques à gauche, questions à droite */
.df-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px 24px; }
.df-q { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 20px; }
.df-q-nav { display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; }
.df-tab { display: flex; flex-direction: column; justify-content: center; flex: 1 1 42%; min-width: 0; min-height: 52px; padding: 7px 12px; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 6px; font-weight: 500; transition: border-color .15s, background-color .15s; }
.df-tab span { overflow-wrap: anywhere; line-height: 1.25; }
.df-tab small { font: 400 .76rem/1.3 var(--mono); color: var(--mute); }
.df-tab:hover { border-color: #B9B9B2; }
.df-tab[aria-pressed="true"] { border-color: var(--ink); background: var(--wash); }
.df-q-col { min-width: 0; }
.df-q-col h2 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.df-qs { border: 1px solid var(--line); border-radius: 8px; }
.q-row { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: start; padding: 2px 10px 2px 0; }
.q-row + .q-row { border-top: 1px solid var(--line); }
.q-box { display: grid; place-items: center; width: 44px; height: 44px; cursor: pointer; }
.q-text { display: block; width: 100%; min-height: 44px; padding: 10px 6px; text-align: left; border-radius: 4px; color: var(--mute); overflow-wrap: anywhere; cursor: text; transition: background-color .12s; }
.q-row.is-on .q-text { color: var(--ink); }
.q-text:hover { background: var(--wash); }
.q-edit { height: auto; min-height: 66px; margin: 4px 0; padding: 8px 10px; line-height: 1.4; resize: vertical; }
.q-tag { grid-column: 2; justify-self: start; margin: 0 0 8px 6px; padding: 2px 6px; font: 400 .74rem/1.4 var(--mono); white-space: nowrap; color: var(--ink); border: 1px solid var(--line); border-radius: 4px; }
.q-tag.is-with { color: var(--mute); background: var(--wash); }
.q-empty { padding: 14px; color: var(--mute); }

/* Aperçu */
.df-pv { display: none; }
.pv-frame { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 18px; }
.pv-cap { margin-top: 12px; font-size: .82rem; color: var(--mute); }
.pv-head { display: flex; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.pv-who { flex: 1; min-width: 0; display: grid; gap: 4px; }
.pv-who b { font-weight: 700; font-size: 1rem; line-height: 1.2; overflow-wrap: anywhere; }
.pv-who small { font: 400 .76rem/1.2 var(--mono); color: var(--mute); overflow-wrap: anywhere; }
.pv-plan { flex: none; padding: 2px 6px; font: 400 .72rem/1.4 var(--mono); border: 1px solid var(--line); border-radius: 4px; color: var(--mute); }
.pv-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.pv-kpis > div { display: grid; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; }
.pv-kpis small { font-size: .76rem; color: var(--mute); }
.pv-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.df-pv section h2 { display: flex; justify-content: space-between; align-items: center; font-size: .78rem; font-weight: 600; color: var(--mute); margin-bottom: 6px; }
.df-pv section em { font: 400 .76rem var(--mono); color: var(--ink); }
.pv-engines { display: flex; gap: 8px; }
.pv-engines svg { width: 14px; height: 14px; }
.df-pv li { display: grid; align-items: center; gap: 8px; min-height: 30px; padding: 4px 0; font-size: .82rem; line-height: 1.25; }
.df-pv li + li { border-top: 1px solid var(--line); }
.df-pv li > span:not(.df-tile) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-topics li { grid-template-columns: minmax(0, 1fr) 54px; }
.pv-board li { grid-template-columns: 22px minmax(0, 1fr) 44px; }
.pv-board .df-tile { width: 22px; height: 22px; font-size: .7rem; border-radius: 4px; }
.pv-board .is-you span:not(.df-tile) { font-weight: 600; }
.pv-questions { margin-top: 16px; }
.pv-questions li { grid-template-columns: minmax(0, 1fr) 14px 14px; }
.sk { display: block; height: 8px; background: #E7E7E1; border-radius: 2px; }
.sk-big { height: 18px; }
.sk-dot { width: 14px; height: 8px; }
.pv-new { animation: df-in .6s var(--out); }
@keyframes df-pulse { 50% { opacity: .4; } }
.df-pv[data-stage="0"] .pv-head .sk,
.df-pv[data-stage="1"] .pv-topics .sk,
.df-pv[data-stage="2"] .pv-questions .sk,
.df-pv[data-stage="3"] .pv-board .sk { animation: df-pulse 1.8s ease-in-out infinite; }

/* Attente */
.dw { position: relative; overflow: hidden; min-height: calc(100svh - 69px); padding: 40px 16px 56px; font-size: 15px; line-height: 1.45; }
.dw-rings { position: absolute; left: 50%; top: 76px; width: 1600px; height: 1600px; margin: -800px 0 0 -800px; pointer-events: none; }
.dw-rings circle { fill: none; stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; transform-origin: 500px 500px; transform: scale(var(--s)); animation: dw-ring 35s linear infinite; }
@keyframes dw-ring {
  0% { transform: scale(.06); opacity: 0; }
  10% { opacity: 1; }
  85% { opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}
.dw-in { position: relative; display: flex; flex-direction: column; align-items: center; width: min(100%, 620px); margin-inline: auto; text-align: center; }
.dw-mark { display: grid; place-items: center; width: 72px; height: 72px; color: var(--violet); }
.dw h1 { margin-top: 20px; font-size: 1.75rem; line-height: 1.15; font-weight: 700; letter-spacing: -.012em; }
.dw-who { margin-top: 6px; color: var(--mute); overflow-wrap: anywhere; }
.dw-carousel { --gap: 118px; position: relative; width: 100%; height: 124px; margin-top: 26px; overflow: hidden; }
.dw-tile {
  position: absolute; left: 50%; top: 50%; display: grid; justify-items: center; align-content: center; gap: 3px;
  width: 112px; height: 104px; margin: -52px 0 0 -56px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  transform: translateX(calc(var(--p, 0) * var(--gap))) scale(.76); opacity: 0;
  transition: transform 1.1s var(--out), opacity 1.1s var(--out), border-color .8s;
}
.dw-tile svg { width: 28px; height: 28px; }
.dw-tile b { font-size: .86rem; font-weight: 600; line-height: 1.2; }
.dw-tile small { font: 400 .68rem/1.25 var(--mono); color: var(--mute); }
.dw-tile.is-center { transform: translateX(0) scale(1); opacity: 1; border-color: var(--violet); }
.dw-tile.is-near { opacity: .62; }
.dw-tile.is-edge { opacity: .22; }
.dw-tile.is-off svg { color: #A8A8B0; }
.dw-tile.is-off b { color: var(--mute); }
.dw-carousel.is-calm { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; height: auto; overflow: visible; }
.dw-carousel.is-calm .dw-tile { position: static; margin: 0; transform: none; opacity: 1; }
.dw-bar { width: 100%; height: 4px; margin-top: 22px; background: var(--line); border-radius: 2px; overflow: hidden; }
.dw-bar i { display: block; width: 0; height: 100%; background: var(--violet); transition: width .8s var(--out); }
.dw-count { margin-top: 10px; font: 500 .9rem/1.4 var(--mono); }
.dw-notice, .dw-late { margin-top: 6px; font-size: .9rem; color: var(--ink); }
.dw-notice:empty { display: none; }
.dw-link { width: 100%; margin-top: 22px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 8px; text-align: left; }
.dw-url { display: flex; align-items: center; gap: 10px; }
.dw-url a { flex: 1; min-width: 0; font: 400 .8rem/1.35 var(--mono); overflow-wrap: anywhere; }
.dw-link p { margin-top: 8px; font-size: .88rem; color: var(--mute); }

@media (min-width: 560px) {
  .df-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .df-add.is-two { flex-wrap: nowrap; }
  .df-add.is-two input { flex: 1 1 0; }
  .df-add.is-two .df-mini { flex: none; }
  .q-row { grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; }
  .q-tag { grid-column: auto; margin: 0 0 0 10px; }
}

.dw-pause { margin-top: 16px; }
html.paused .dw-rings circle, html.paused .dw .vmark-ring, html.paused .dw .vmark-dot, html.paused.is-busy .brand .logo-ring, html.paused.is-busy .brand .logo-dot { animation-play-state: paused; }

@media (min-width: 760px) {
  .df-q { grid-template-columns: 240px minmax(0, 1fr); gap: 24px; }
  .df-q-nav { flex-direction: column; flex-wrap: nowrap; }
  .df-tab { flex: none; width: 100%; }
  .df-main { padding: 32px 32px 56px; }
  .dw { padding-top: 48px; }
  .dw-rings { top: 84px; }
}

@media (min-width: 1000px) {
  .df { grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); }
  .df-main { padding: 36px 48px 56px max(32px, calc((100vw - 1320px) / 2)); }
  .df-pv { display: block; position: sticky; top: 93px; align-self: start; height: calc(100svh - 117px); margin: 24px 24px 24px 0; padding: 24px; overflow: hidden; background: var(--wash); border: 1px solid var(--line); border-radius: 8px; }
  .df[data-step="3"] { grid-template-columns: minmax(0, 1fr); }
  .df[data-step="3"] .df-pv { display: none; }
  .df[data-step="3"] .df-main { padding-right: max(32px, calc((100vw - 1320px) / 2)); }
}

@media (max-width: 480px) {
  .dw-carousel { --gap: 104px; }
  .df-foot { position: sticky; bottom: 0; padding-block: 8px; margin-bottom: -8px; background: #fff; }
  /* Un champ qui prend le focus ne finit pas derrière les boutons collés en bas. */
  .df input { scroll-margin-bottom: 84px; }
}

@media (prefers-reduced-motion: reduce) {
  .df *, .dw *, .df-enter { animation: none !important; transition: none !important; }
}
