/* Page de téléchargement d'un workflow (/w/<identifiant>).
   Couleurs, polices et boutons : marque.css. Ici, seulement la mise en page. */

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--creme);
  color: var(--nuit);
  font: 400 16px/1.55 var(--font-texte);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--bleu); outline-offset: 3px; border-radius: 4px; }
svg use { pointer-events: none; }

:root { --gouttiere: clamp(16px, 4vw, 40px); --largeur: 1120px; }

/* ------------------------------------------------------------- en-tête */
.haut {
  max-width: var(--largeur); margin: 0 auto;
  padding: 20px var(--gouttiere);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.haut__logo { display: block; line-height: 0; border-radius: 6px; }
.haut__logo img { height: 45px; width: auto; }
.haut__lien {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: var(--arrondi-pilule);
  border: 1px solid var(--trait); background: var(--blanc);
  font-size: 0.9rem; font-weight: 500; text-decoration: none;
  transition: border-color 160ms var(--ease);
}
.haut__lien svg { width: 14px; height: 14px; fill: var(--corail); }
@media (hover: hover) and (pointer: fine) { .haut__lien:hover { border-color: var(--nuit); } }

/* --------------------------------------------------------------- page */
main {
  position: relative;
  max-width: var(--largeur); margin: 0 auto;
  padding: clamp(16px, 4vw, 40px) var(--gouttiere) 0;
}
/* Fond pointillé discret, comme le canevas d'un éditeur de workflows */
main::before {
  content: ""; position: absolute; z-index: -1;
  inset: -80px 0 auto 0; height: 560px;
  background-image: radial-gradient(var(--trait) 1.3px, transparent 1.6px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(70% 80% at 30% 20%, #000 20%, transparent 75%);
          mask-image: radial-gradient(70% 80% at 30% 20%, #000 20%, transparent 75%);
}

/* Chargement */
.attente {
  min-height: 50vh; display: grid; place-content: center; justify-items: center; gap: 16px;
  color: var(--texte-doux);
}
.attente__nodes { display: flex; gap: 10px; }
.attente__nodes i { width: 16px; height: 16px; border-radius: 5px; background: var(--bleu); animation: battement 1.1s var(--ease) infinite; }
.attente__nodes i:nth-child(2) { background: var(--corail); animation-delay: 0.15s; }
.attente__nodes i:nth-child(3) { background: var(--soleil); animation-delay: 0.3s; }
@keyframes battement { 0%, 100% { opacity: 0.35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }

/* ------------------------------------------------------- présentation */
.pres {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  grid-template-areas: "intro carte" "pack carte" "video carte";
  grid-template-rows: auto auto 1fr;
  column-gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.pres__intro { grid-area: intro; padding-top: 8px; }
.carte { grid-area: carte; }
.pack { grid-area: pack; margin-top: 40px; }
.video { grid-area: video; margin-top: 40px; }

.pastille {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 20px; padding: 7px 14px 7px 10px;
  border-radius: var(--arrondi-pilule);
  background: var(--lavande); color: var(--nuit);
}
.pastille__port { width: 10px; height: 10px; border-radius: 50%; background: var(--bleu); box-shadow: 0 0 0 3px var(--blanc); }

#titre, .introuvable h1 {
  margin: 0;
  font: 800 clamp(2.1rem, 1.3rem + 2.6vw, 3.3rem)/1.04 var(--font-display);
  letter-spacing: -0.02em;
  text-wrap: balance;
  max-width: 20ch;
}
.pres__desc {
  margin: 20px 0 0; max-width: 46ch;
  font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem); line-height: 1.55;
  color: var(--texte-doux);
  text-wrap: pretty;
}

/* ------------------------------------------------------ carte d'accès */
.carte {
  background: var(--blanc);
  border: 1px solid var(--trait);
  border-radius: var(--arrondi-node);
  padding: clamp(22px, 3vw, 32px);
  box-shadow: var(--ombre-carte);
}
.carte__titre {
  margin: 0;
  font: 700 clamp(1.4rem, 1.2rem + 0.6vw, 1.65rem)/1.15 var(--font-display);
  letter-spacing: -0.01em;
}
.carte__titre:focus { outline: none; }
.carte__texte { margin: 10px 0 22px; color: var(--texte-doux); font-size: 0.97rem; }

.champ__label { display: block; margin-bottom: 6px; font-weight: 700; font-size: 0.92rem; }
.champ {
  display: block; width: 100%; height: 3.25rem; padding: 0 14px;
  font: 400 1rem var(--font-texte); color: var(--nuit);
  background: var(--blanc);
  border: 1.5px solid #8A82A3; border-radius: var(--arrondi-s);
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
.champ::placeholder { color: #8A82A3; }
.champ:focus { outline: none; border-color: var(--bleu); box-shadow: 0 0 0 3px rgba(47, 91, 255, 0.28); }
.champ[aria-invalid="true"] { border-color: #B42318; }

.piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.consentement { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; font-size: 0.92rem; line-height: 1.45; }
.consentement input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--bleu); cursor: pointer; }
.consentement input:focus-visible { outline: 3px solid var(--bleu); outline-offset: 2px; }
.consentement label { cursor: pointer; }
.consentement__lien { margin: 6px 0 22px 30px; font-size: 0.88rem; }

.carte__bouton { width: 100%; }
.carte__bouton svg { transition: transform 160ms var(--ease); }
@media (hover: hover) and (pointer: fine) { .carte__bouton:hover svg { transform: translateX(3px); } }

.message { margin: 12px 0 0; font-size: 0.9rem; line-height: 1.45; }
.message:empty { display: none; }
.message.erreur { color: #B42318; }
.message.ok { color: #1F7A4D; font-weight: 500; }

.rassure {
  display: flex; align-items: center; gap: 8px;
  margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--trait);
  font-size: 0.85rem; color: var(--texte-doux);
}
.rassure svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Accès débloqué */
.acces__ok {
  display: grid; place-items: center; width: 48px; height: 48px; margin: 0 0 14px;
  border-radius: 50%; background: var(--soleil); color: var(--nuit);
  animation: apparait 420ms var(--ease) both;
}
.acces__ok svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
@keyframes apparait { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }

.acces__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.acces__copier { grid-column: 1 / -1; }
.acces__actions .rf-btn--clair { padding: 0 12px; font-size: 0.95rem; }
.acces__copier.est-copie { background: #1F7A4D; box-shadow: none; }

/* documents en plus : une ligne par fichier */
.docs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.doc {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 12px;
  border: 1.5px solid var(--trait); border-radius: var(--arrondi-node); background: var(--blanc);
  text-decoration: none; transition: border-color 160ms var(--ease), transform 160ms var(--ease);
}
.doc:hover { border-color: var(--bleu); transform: translateY(-1px); }
.doc__icone { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--lavande); color: var(--bleu); }
.doc__icone svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.doc__nom { flex: 1; min-width: 0; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.doc__type { flex: none; font: 600 0.72rem/1 var(--font-texte); letter-spacing: 0.06em; color: var(--texte-doux); }

.pack__plus { margin: 12px 0 0; font-size: 0.9rem; color: var(--texte-doux); }

.etapes__titre { margin: 26px 0 12px; color: var(--texte-doux); }
.etapes { list-style: none; margin: 0; padding: 0; }
.etapes li {
  position: relative;
  padding: 12px 16px 14px; border-radius: var(--arrondi-node);
  background: var(--lavande);
  font-size: 0.93rem; line-height: 1.5;
}
.etapes li + li { margin-top: 18px; }
/* connecteur entre deux étapes, avec ses ports */
.etapes li + li::before {
  content: ""; position: absolute; left: 30px; top: -18px; width: 2.5px; height: 18px; background: var(--nuit);
}
.etapes li + li::after {
  content: ""; position: absolute; left: 25.5px; top: -24px; width: 11.5px; height: 11.5px;
  border-radius: 50%; background: var(--blanc); border: 2.5px solid var(--nuit); box-sizing: border-box;
}
.etapes__n { display: block; margin-bottom: 4px; color: var(--nuit); }

/* -------------------------------------------------- pack : deux nodes */
.pack__titre { margin: 0 0 14px; color: var(--texte-doux); }
.pack__schema { display: flex; align-items: stretch; }
.pack__lien { align-self: center; }
.pnode {
  position: relative; flex: 1 1 0; min-width: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px 14px 14px;
  border-radius: var(--arrondi-node);
  background: var(--blanc); border: 1.5px solid var(--nuit);
}
.pnode--bleu { background: var(--bleu); border-color: var(--bleu); color: var(--blanc); }
.pnode__icone {
  flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px;
  background: var(--lavande); color: var(--bleu);
}
.pnode--bleu .pnode__icone { background: rgba(255, 255, 255, 0.16); color: var(--blanc); }
.pnode__icone svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pnode__texte { display: grid; min-width: 0; line-height: 1.3; }
.pnode__texte b { font: 700 1.05rem/1.2 var(--font-display); }
.pnode__texte small { font-size: 0.86rem; color: var(--texte-doux); }
.pnode--bleu .pnode__texte small { color: var(--blanc); }
.pnode__port {
  position: absolute; top: 50%; width: 13px; height: 13px; margin-top: -6.5px;
  border-radius: 50%; background: var(--creme); border: 2.5px solid var(--nuit); box-sizing: border-box;
}
.pnode__port--sortie { right: -7.5px; }
.pnode__port--entree { left: -7.5px; }
.pack__lien { flex: none; width: 56px; height: 64px; overflow: visible; }
.pack__lien path { fill: none; stroke: var(--nuit); stroke-width: 2.5; stroke-linecap: round; vector-effect: non-scaling-stroke; }

/* ------------------------------------------------------------- vidéo */
.video { display: block; text-decoration: none; color: var(--nuit); border-radius: var(--arrondi-node); }
.video__image {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: 16 / 9; border-radius: var(--arrondi-node);
  border: 1px solid var(--trait); background: var(--lavande);
}
.video__image img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 300ms var(--ease); }
.video__play {
  position: absolute; left: 16px; bottom: 16px;
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  background: var(--bleu); color: var(--blanc); box-shadow: 0 8px 20px -8px rgba(30, 21, 56, 0.6);
}
.video__play svg { width: 20px; height: 20px; margin-left: 3px; fill: currentColor; }
.video__legende { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-weight: 700; color: var(--bleu); }
.video__legende svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 160ms var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .video:hover .video__image img { transform: scale(1.03); }
  .video:hover .video__legende svg { transform: translateX(3px); }
}

/* -------------------------------------------------------- introuvable */
.introuvable { max-width: 620px; margin: 24px auto 96px; text-align: center; }
.introuvable h1 { margin-inline: auto; }
.introuvable p { margin: 16px auto 28px; max-width: 46ch; color: var(--texte-doux); font-size: 1.08rem; }
.introuvable__schema { width: min(300px, 100%); height: auto; margin-bottom: 28px; overflow: visible; }
.introuvable__schema .s-bleu { fill: var(--bleu); }
.introuvable__schema .s-blanc { fill: var(--blanc); stroke: var(--nuit); stroke-width: 2; }
.introuvable__schema .s-lien { fill: none; stroke: var(--nuit); stroke-width: 2.5; stroke-linecap: round; }
.introuvable__schema .s-port { fill: var(--creme); stroke: var(--nuit); stroke-width: 2.5; }
.introuvable__schema .s-bout { fill: var(--corail); }
.introuvable__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* ------------------------------------------------ comment ça marche */
.suite { margin-top: clamp(56px, 8vw, 96px); background: var(--nuit); color: var(--creme); }
.suite__inner { max-width: var(--largeur); margin: 0 auto; padding: clamp(48px, 7vw, 80px) var(--gouttiere); }
.suite h2 { margin: 0 0 32px; font: 700 clamp(1.6rem, 1.3rem + 1vw, 2.2rem)/1.1 var(--font-display); letter-spacing: -0.01em; }
.suite__nodes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px; }
.suite__nodes li {
  position: relative; padding: 20px;
  border-radius: var(--arrondi-node);
  background: var(--nuit-surface); border: 1px solid rgba(250, 247, 242, 0.14);
}
.suite__nodes li + li::before {
  content: ""; position: absolute; left: -48px; top: 50%; width: 48px; height: 2.5px; margin-top: -1.25px; background: var(--creme);
}
.suite__nodes li + li::after {
  content: ""; position: absolute; left: -7px; top: 50%; width: 13px; height: 13px; margin-top: -6.5px;
  border-radius: 50%; background: var(--nuit); border: 2.5px solid var(--creme); box-sizing: border-box;
}
.snode__icone {
  display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 14px;
  border-radius: 11px; background: var(--soleil); color: var(--nuit);
}
.snode__icone svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.suite__nodes b { display: block; font: 700 1.12rem/1.25 var(--font-display); }
.suite__nodes small { display: block; margin-top: 6px; font-size: 0.93rem; line-height: 1.5; color: var(--nuit-doux); }

/* ---------------------------------------------------------------- pied */
.pied {
  max-width: var(--largeur); margin: 0 auto;
  padding: 28px var(--gouttiere) 40px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px;
  font-size: 0.88rem; color: var(--texte-doux);
}
.pied img { height: 29px; width: auto; margin-right: 4px; }
.pied a { color: var(--texte-doux); text-decoration: underline; text-underline-offset: 0.2em; text-decoration-color: var(--trait); }
@media (hover: hover) and (pointer: fine) { .pied a:hover { color: var(--nuit); text-decoration-color: currentColor; } }

/* -------------------------------------------------------------- mobile */
@media (max-width: 900px) {
  .pres { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "carte" "pack" "video"; grid-template-rows: none; }
  .carte { position: static; margin-top: 28px; }
}
@media (max-width: 600px) {
  .haut__logo img { height: 40px; }
  .haut__lien { padding: 7px 12px; font-size: 0.85rem; }
  .pack__schema { flex-direction: column; align-items: stretch; }
  .pack__lien { display: none; }
  .pnode:last-child { margin-top: 34px; }
  .pnode:last-child::before { content: ""; position: absolute; left: 34px; top: -36px; width: 2.5px; height: 36px; background: var(--nuit); }
  .pnode__port--sortie { right: auto; top: auto; bottom: -7.5px; left: 29px; margin-top: 0; }
  .pnode__port--entree { left: 29px; top: -7.5px; margin-top: 0; }
  .suite__nodes { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .suite__nodes li + li::before { left: 38px; top: -30px; width: 2.5px; height: 30px; margin-top: 0; }
  .suite__nodes li + li::after { left: 33px; top: -7px; margin-top: 0; }
}
@media (max-width: 380px) {
  .haut__lien svg { display: none; }
  .acces__actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .attente__nodes i, .acces__ok { animation: none; }
  .video__image img, .carte__bouton svg, .video__legende svg, .doc { transition: none; }
  .doc:hover { transform: none; }
}

/* ------------------------------------------------- double opt-in */
.suggestion {
  margin: 8px 0 0; padding: 8px 12px; border-radius: 8px;
  background: var(--lavande); font-size: 0.9rem; line-height: 1.6;
}
.suggestion strong { overflow-wrap: anywhere; }
.suggestion__bouton {
  margin-left: 4px; padding: 1px 12px; border: 1.5px solid var(--bleu); border-radius: 999px;
  background: var(--blanc); color: var(--bleu); font: 600 0.88rem/1.6 var(--font-texte); cursor: pointer;
}
.suggestion__bouton:hover { background: var(--bleu); color: var(--blanc); }

.verif__adresse { color: var(--nuit); overflow-wrap: anywhere; }
.verif__corriger { margin: 0; padding-top: 16px; border-top: 1px solid var(--trait); font-size: 0.92rem; color: var(--texte-doux); }
.lien-bouton { padding: 0; border: 0; background: none; font: inherit; font-weight: 600; cursor: pointer; }

#message-confirme { margin: 0 0 14px; }
