/* Écran du dossier prospect : génération, éventail des pages derrière le formulaire, lecteur après l'email (app/dossier-stage.js) */
#dossier-stage { position: fixed; inset: 0; z-index: 9998; background: #2b2b2b; color: #fff; font-family: var(--font-ui); overflow: hidden; outline: none; }
#dossier-stage::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 34% 50%, rgba(255,200,36,.10), rgba(0,0,0,0) 55%); pointer-events: none; }
#dossier-stage * { box-sizing: border-box; }
#dossier-stage .stage-eyebrow { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--accent); }
#dossier-stage .stage-title { font-family: var(--font-tight); font-size: 22px; font-weight: 800; letter-spacing: -.01em; margin: 0; }
#dossier-stage .stage-page { position: absolute; background: #fff; border-radius: 2px; overflow: hidden; box-shadow: 0 18px 40px rgba(0,0,0,.45); }
#dossier-stage .stage-page iframe { position: absolute; left: 0; top: 0; width: 794px; height: 1123px; border: 0; transform-origin: 0 0; pointer-events: none; background: #fff; }
#dossier-stage .stage-page img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; }

/* État 1 · génération */
#dossier-stage .stage-gen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 36px; padding: 40px; text-align: center; }
#dossier-stage .stage-gen-head { display: flex; flex-direction: column; align-items: center; gap: 8px; }
#dossier-stage .stage-gen-head h1 { font-family: var(--font-tight); font-size: 30px; font-weight: 800; margin: 0; }
#dossier-stage .stage-gen-head p { font-size: 13.5px; color: rgba(255,255,255,.65); margin: 0; }
#dossier-stage .stage-slots { display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; max-width: 1320px; }
#dossier-stage .stage-slot { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 118px; }
#dossier-stage .stage-slot-page { position: relative; width: 118px; height: 167px; border-radius: 2px; border: 1.5px dashed rgba(255,255,255,.28); background: rgba(255,255,255,.04); overflow: hidden; }
#dossier-stage .stage-slot-page img { display: block; width: 100%; height: 100%; object-fit: cover; }
#dossier-stage .stage-slot.done .stage-slot-page { border-style: solid; border-color: transparent; background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
#dossier-stage .stage-slot.busy .stage-slot-page { border-style: solid; border-color: transparent; background: #fff; }
#dossier-stage .stage-slot span { font-size: 10.5px; line-height: 1.3; color: rgba(255,255,255,.45); }
#dossier-stage .stage-slot.done span, #dossier-stage .stage-slot.busy span { color: #fff; }
#dossier-stage .stage-tick { position: absolute; right: 6px; top: 6px; width: 18px; height: 18px; border-radius: 999px; background: var(--success); display: flex; align-items: center; justify-content: center; }
#dossier-stage .stage-spin { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 999px; border: 3px solid rgba(255,200,36,.25); border-top-color: var(--accent); animation: stage-spin .9s linear infinite; }
@keyframes stage-spin { to { transform: rotate(360deg); } }
#dossier-stage .stage-steps { width: min(600px, 90vw); display: flex; flex-direction: column; gap: 14px; }
#dossier-stage .stage-bar-track { height: 4px; background: rgba(255,255,255,.12); border-radius: 999px; overflow: hidden; }
#dossier-stage .stage-bar-fill { height: 100%; width: 0; background: var(--accent); transition: width .6s cubic-bezier(.2,.8,.2,1); }
#dossier-stage .stage-step-list { display: flex; justify-content: space-between; gap: 12px; }
#dossier-stage .stage-step { display: flex; align-items: center; gap: 7px; font-size: 12px; color: rgba(255,255,255,.4); text-align: left; }
#dossier-stage .stage-step i { width: 13px; height: 13px; border-radius: 999px; border: 1.5px solid rgba(255,255,255,.3); flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
#dossier-stage .stage-step.busy { color: #fff; }
#dossier-stage .stage-step.busy i { border: 2px solid rgba(255,200,36,.3); border-top-color: var(--accent); animation: stage-spin .9s linear infinite; }
#dossier-stage .stage-step.done { color: #fff; }
#dossier-stage .stage-step.done i { background: var(--success); border-color: var(--success); }
#dossier-stage .stage-hint { font-size: 12px; color: rgba(255,255,255,.45); margin: 0; }

/* État 2 · éventail + formulaire */
#dossier-stage .stage-fan { position: absolute; left: 0; top: 0; bottom: 0; }
#dossier-stage .stage-fan .stage-page { transform-origin: 50% 140%; }
#dossier-stage .stage-fan .stage-page.blur-1 iframe, #dossier-stage .stage-fan .stage-page.blur-1 img { filter: blur(2px); }
#dossier-stage .stage-fan .stage-page.blur-2 iframe, #dossier-stage .stage-fan .stage-page.blur-2 img { filter: blur(3px); }
#dossier-stage .stage-fan-head { position: absolute; left: 60px; top: 60px; display: flex; flex-direction: column; gap: 6px; z-index: 30; }
#dossier-stage .stage-chips { position: absolute; left: 60px; bottom: 56px; display: flex; gap: 8px; flex-wrap: wrap; z-index: 30; }
#dossier-stage .stage-chip { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.18); }
#dossier-stage .stage-form { position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end; padding: 24px 48px; pointer-events: none; z-index: 40; }
#dossier-stage .stage-form > * { pointer-events: auto; }

/* État 3 · lecteur */
#dossier-stage .stage-bar { position: absolute; left: 0; top: 0; right: 0; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 28px; background: rgba(20,20,20,.92); border-bottom: 1px solid rgba(255,255,255,.1); z-index: 50; }
#dossier-stage .stage-status { display: flex; align-items: center; gap: 14px; min-width: 0; }
#dossier-stage .stage-status-icon { width: 22px; height: 22px; border-radius: 999px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--success); }
#dossier-stage .stage-status.sending .stage-status-icon { background: transparent; border: 2px solid rgba(255,200,36,.3); border-top-color: var(--accent); animation: stage-spin .9s linear infinite; }
#dossier-stage .stage-status.failed .stage-status-icon { background: var(--danger); }
#dossier-stage .stage-status-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#dossier-stage .stage-status-text strong { font-family: var(--font-tight); font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#dossier-stage .stage-status-text span { font-size: 11.5px; color: rgba(255,255,255,.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#dossier-stage .stage-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
#dossier-stage .stage-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 6px; font-size: 12px; font-weight: 500; font-family: var(--font-ui); line-height: 1; white-space: nowrap; cursor: pointer; background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.22); transition: background var(--t-fast); }
#dossier-stage .stage-btn:hover { background: rgba(255,255,255,.16); }
#dossier-stage .stage-btn.primary { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 600; }
#dossier-stage .stage-btn.primary:hover { background: var(--accent-hover); }
#dossier-stage .stage-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#dossier-stage .stage-reader { position: absolute; left: 0; right: 0; top: 64px; bottom: 136px; display: flex; align-items: center; justify-content: center; }
#dossier-stage .stage-reader-frame { position: relative; overflow: hidden; box-shadow: 0 30px 70px rgba(0,0,0,.5); background: #fff; }
#dossier-stage .stage-reader-frame iframe { position: absolute; left: 0; top: 0; width: 794px; border: 0; transform-origin: 0 0; background: #fff; }
#dossier-stage .stage-arrow { position: absolute; top: 50%; width: 44px; height: 44px; margin-top: -22px; border-radius: 999px; border: 0; background: rgba(255,255,255,.1); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
#dossier-stage .stage-arrow:hover { background: rgba(255,255,255,.2); }
#dossier-stage .stage-arrow.prev { left: 28px; } #dossier-stage .stage-arrow.next { right: 28px; }
#dossier-stage .stage-counter { position: absolute; right: 28px; top: 84px; font-size: 12px; color: rgba(255,255,255,.6); }
#dossier-stage .stage-strip { position: absolute; left: 0; right: 0; bottom: 0; height: 136px; display: flex; align-items: center; justify-content: center; gap: 10px; background: rgba(0,0,0,.35); border-top: 1px solid rgba(255,255,255,.08); overflow-x: auto; padding: 0 16px; }
#dossier-stage .stage-thumb { display: flex; flex-direction: column; align-items: center; gap: 5px; flex-shrink: 0; cursor: pointer; background: none; border: 0; padding: 0; color: rgba(255,255,255,.6); font-size: 9.5px; font-family: var(--font-ui); }
#dossier-stage .stage-thumb .stage-page { position: relative; width: 66px; height: 93px; box-shadow: 0 4px 12px rgba(0,0,0,.4); opacity: .8; }
#dossier-stage .stage-thumb.active .stage-page { outline: 2px solid var(--accent); outline-offset: 2px; opacity: 1; }
#dossier-stage .stage-thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 1100px) {
  #dossier-stage .stage-fan-head { left: 32px; top: 32px; }
  #dossier-stage .stage-chips { display: none; }
  #dossier-stage .stage-form { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  #dossier-stage .stage-spin, #dossier-stage .stage-step.busy i, #dossier-stage .stage-status.sending .stage-status-icon { animation: none; }
}
