/* DA reprise des slides « Bien débuter sur n8n » (Cube agence × TimeAI) :
   fond jaune, nuage rose flou, grain, étoile et courbes irisées en 3D,
   Bricolage Grotesque, titres noirs à ombre blanche, pastilles numérotées noires,
   rose n8n pour l'action. */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --jaune: #f7d228;
  --jaune-clair: #fbe56f;
  --rose: #ec8fc6;
  --rose-vif: #e15fae;
  --rose-n8n: #ea4b71;
  --rose-n8n-fonce: #c9365a;
  --violet: #8c49f1;
  --encre: #0d0d0d;
  --encre-douce: #2b2b2b;
  --papier: rgba(255, 250, 235, 0.5);
  --papier-plein: #fffcf0;
  --rayon: 18px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.5;
  color: var(--encre);
  background: var(--jaune);
  overflow-x: hidden;
}

/* ---------- Décor sur toute la hauteur de la page ---------- */
body { position: relative; }
.decor {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: var(--jaune);
}
.blob { position: absolute; opacity: 0.9; filter: blur(10px); }
.blob-1 { width: min(90vw, 980px); left: -14vw; top: 2%; transform: rotate(-14deg); }
.blob-2 { width: min(80vw, 860px); right: -16vw; top: 24%; transform: rotate(160deg); opacity: 0.75; }
.blob-3 { width: min(90vw, 940px); left: -10vw; top: 48%; transform: rotate(20deg); opacity: 0.8; }
.blob-4 { width: min(80vw, 860px); right: -12vw; top: 72%; transform: rotate(-150deg); opacity: 0.75; }
.etoile { position: absolute; width: clamp(180px, 26vw, 380px); filter: drop-shadow(0 18px 30px rgba(140, 73, 241, 0.25)); }
.etoile-1 { left: clamp(-130px, -8vw, -60px); top: clamp(260px, 30vw, 420px); transform: rotate(-8deg); }
.etoile-2 { right: clamp(-150px, -9vw, -70px); top: 58%; transform: rotate(24deg); width: clamp(160px, 22vw, 320px); }
.courbe { position: absolute; width: clamp(90px, 11vw, 160px); }
.courbe-1 { right: -18px; top: -22px; transform: rotate(8deg); }
.courbe-2 { left: -30px; top: 40%; transform: rotate(200deg); }
.courbe-3 { right: 12vw; bottom: -40px; transform: rotate(-10deg); }
.grain {
  position: absolute;
  inset: 0;
  opacity: 0.32;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- Mise en page ---------- */
main {
  position: relative;
  z-index: 1;
  width: min(860px, 100% - 32px);
  margin: 0 auto;
  padding: 56px 0 40px;
}

/* Titres façon slides : noir épais, ombre blanche décalée */
h1, h2, legend, .titre-mot {
  font-weight: 800;
  letter-spacing: -0.02em;
  text-shadow: 2px 2px 0 #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff;
}

.hero { text-align: center; padding: 24px 0 36px; animation: monter 0.6s ease-out both; }
.surtitre {
  display: inline-block;
  margin: 0 0 18px;
  padding: 6px 14px;
  border: 2px solid var(--encre);
  border-radius: 999px;
  background: var(--papier);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
h1 { margin: 0; font-size: clamp(40px, 8vw, 76px); line-height: 1.02; }
.sous-titre { margin: 10px 0 0; font-size: clamp(17px, 2.4vw, 22px); font-weight: 600; }
.logos { display: flex; justify-content: center; align-items: center; gap: clamp(28px, 7vw, 80px); margin-top: 30px; }
.logo-cube { height: clamp(62px, 9vw, 92px); filter: brightness(0); } /* logo blanc d'origine passé en noir : lisible sur le jaune */
.logo-timeai { height: clamp(58px, 8.5vw, 86px); }

.mot {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 22px;
  align-items: center;
  margin: 8px 0 30px;
  padding: 22px 26px;
  border: 2px solid var(--encre);
  border-radius: var(--rayon);
  background: var(--papier);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 6px 6px 0 var(--encre);
  animation: monter 0.6s 0.1s ease-out both;
}
.portrait { width: 132px; height: 132px; object-fit: cover; object-position: top; border-radius: 50%; border: 2px solid var(--encre); background: var(--jaune); }
.titre-mot { margin: 0 0 6px; font-size: 26px; }
.mot p { margin: 0 0 10px; }
.mot p:last-child { margin-bottom: 0; }
.duree { font-size: 15px; color: var(--encre-douce); }
.pastille {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--encre);
  color: var(--jaune);
  font-weight: 700;
  font-size: 13px;
}

/* ---------- Blocs du formulaire ---------- */
form { margin: 0; }
.piege { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.bloc {
  margin: 0 0 22px;
  padding: 26px 26px 10px;
  border: 2px solid var(--encre);
  border-radius: var(--rayon);
  background: var(--papier);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  min-width: 0;
  animation: monter 0.5s ease-out both;
}
legend {
  display: flex;
  align-items: center;
  gap: 12px;
  float: left;
  width: 100%;
  margin: 0 0 18px;
  padding: 0;
  font-size: clamp(24px, 3.6vw, 32px);
  line-height: 1.1;
}
legend + * { clear: both; }
.num {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--encre);
  color: #fff;
  font-size: 20px;
  text-shadow: none;
}

.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }

.champ { display: block; margin: 0 0 18px; }
.champ > span, .intitule { display: block; margin: 0 0 7px; font-weight: 700; font-size: 16px; line-height: 1.3; }
.champ em { font-style: normal; font-weight: 600; font-size: 12px; color: var(--rose-n8n-fonce); margin-left: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.aide { margin: -4px 0 8px; font-size: 14px; color: var(--encre-douce); }
.question { margin: 0 0 20px; }

input[type="text"], input[type="email"], textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--encre);
  border-radius: 12px;
  background: var(--papier-plein);
  font: inherit;
  font-size: 16px;
  color: var(--encre);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
textarea { resize: vertical; min-height: 96px; }
input::placeholder, textarea::placeholder { color: #8a8170; }
input[type="text"]:focus, input[type="email"]:focus, textarea:focus {
  outline: none;
  box-shadow: 4px 4px 0 var(--rose-n8n);
  transform: translate(-1px, -1px);
}
.invalide input { border-color: var(--rose-n8n-fonce); box-shadow: 4px 4px 0 var(--rose-n8n); }

/* Choix en pastilles (comme les tags des slides) */
.choix { display: flex; flex-wrap: wrap; gap: 10px; }
.choix label, .liste label { position: relative; cursor: pointer; }
.choix input, .liste input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choix span {
  display: inline-block;
  padding: 9px 16px;
  border: 2px solid var(--encre);
  border-radius: 999px;
  background: var(--papier-plein);
  font-weight: 600;
  font-size: 15px;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.choix label:hover span { box-shadow: 3px 3px 0 var(--encre); transform: translate(-1px, -1px); }
.choix input:checked + span { background: var(--encre); color: var(--jaune); }
.choix input:focus-visible + span, .liste input:focus-visible + span { outline: 3px solid var(--rose-n8n); outline-offset: 2px; }

/* Choix en liste (cases façon check-list des slides) */
.liste { display: grid; gap: 8px; }
.liste span {
  display: block;
  padding: 11px 14px 11px 48px;
  border: 2px solid var(--encre);
  border-radius: 12px;
  background: var(--papier-plein);
  font-size: 15.5px;
  line-height: 1.35;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.liste span::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  border: 2px solid var(--encre);
  border-radius: 6px;
  background: #fff;
  transition: background 0.15s ease;
}
.liste input[type="radio"] + span::before { border-radius: 50%; }
.liste label:hover span { box-shadow: 3px 3px 0 var(--encre); transform: translate(-1px, -1px); }
.liste input:checked + span { background: var(--jaune-clair); }
.liste input:checked + span::before {
  background: var(--encre) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f7d228' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12.5l4.5 4.5L19 7.5'/></svg>") center / 15px no-repeat;
}
.liste input[type="radio"]:checked + span::before { background: var(--encre); box-shadow: inset 0 0 0 4px #fff; }
.liste input:disabled + span { opacity: 0.45; cursor: not-allowed; }

/* ---------- Envoi ---------- */
.envoi { text-align: center; padding: 10px 0 24px; }
button {
  appearance: none;
  border: 2px solid var(--encre);
  border-radius: 999px;
  padding: 16px 34px;
  background: var(--rose-n8n);
  color: #fff;
  font: inherit;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 5px 5px 0 var(--encre);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
button:hover { background: var(--rose-n8n-fonce); transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--encre); }
button:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--encre); }
button:disabled { opacity: 0.7; cursor: progress; }
.mention { margin: 16px 0 0; font-size: 14px; color: var(--encre-douce); }
.erreur {
  margin: 0 auto 16px;
  max-width: 520px;
  padding: 10px 14px;
  border: 2px solid var(--encre);
  border-radius: 12px;
  background: var(--papier-plein);
  font-weight: 600;
  color: var(--rose-n8n-fonce);
}

.merci {
  margin: 10px 0 30px;
  padding: 40px 28px;
  text-align: center;
  border: 2px solid var(--encre);
  border-radius: var(--rayon);
  background: var(--papier);
  box-shadow: 6px 6px 0 var(--encre);
  animation: monter 0.5s ease-out both;
}
.merci:focus { outline: none; }
.merci h2 { margin: 0 0 10px; font-size: clamp(38px, 7vw, 60px); }
.merci p { margin: 0 auto 8px; max-width: 520px; font-size: 18px; }
.signature { font-weight: 800; font-size: 20px; }

footer { text-align: center; font-size: 13px; color: var(--encre-douce); padding: 8px 0 0; }

@keyframes monter { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

/* ---------- Téléphone ---------- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  main { width: calc(100% - 24px); padding-top: 28px; }
  .hero { padding: 12px 0 26px; }
  .mot { grid-template-columns: 1fr; text-align: center; padding: 20px 18px; box-shadow: 4px 4px 0 var(--encre); }
  .portrait { margin: 0 auto; width: 104px; height: 104px; }
  .duree { text-align: left; }
  .bloc { padding: 20px 16px 6px; }
  .grille-2 { grid-template-columns: 1fr; }
  .choix span { padding: 8px 13px; font-size: 14.5px; }
  .courbe-3 { display: none; }
  .etoile-2 { top: 64%; }
  button { width: 100%; padding: 16px 20px; }
}

/* ---------- Impression : version PDF du formulaire, même DA sur chaque page ---------- */
@media print {
  @page { size: A4; margin: 9mm 0; }
  html, body { background: var(--jaune); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { font-size: 10.5pt; }
  .decor { position: fixed; inset: 0; background: transparent; }
  .grain, .blob-3, .blob-4, .etoile-2, .courbe-2, .courbe-3 { display: none; }
  .blob { filter: none; }
  .blob-1 { width: 150mm; left: -30mm; top: 40mm; }
  .blob-2 { width: 130mm; right: -40mm; top: 150mm; }
  .etoile-1 { width: 55mm; left: -20mm; top: auto; bottom: -22mm; }
  .courbe-1 { width: 26mm; right: -4mm; top: -12mm; }
  main { width: auto; margin: 0 14mm; padding: 0; }
  .hero { padding: 2mm 0 5mm; }
  h1 { font-size: 34pt; }
  .logos { margin-top: 4mm; }
  .logo-cube, .logo-timeai { height: 15mm; }
  .mot { margin-bottom: 5mm; box-shadow: 3px 3px 0 var(--encre); backdrop-filter: none; -webkit-backdrop-filter: none; break-inside: avoid; }
  .bloc { margin-bottom: 5mm; padding: 5mm 6mm 2mm; backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(255, 250, 235, 0.62); break-inside: auto; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
  legend { break-after: avoid; margin-bottom: 3mm; }
  .bloc:last-of-type, .bloc[data-titre="Vous"] { break-inside: avoid; }
  .question, .champ { break-inside: avoid; margin-bottom: 3.5mm; }
  .liste { gap: 1.5mm; }
  .liste span { padding: 1.6mm 3mm 1.6mm 11mm; }
  .choix span { padding: 1.2mm 3.4mm; }
  input[type="text"], input[type="email"] { padding: 2mm 3mm; }
  textarea { min-height: 22mm; }
  .envoi button, .merci, .piege, .erreur { display: none !important; }
  .envoi { padding: 0; }
  * { animation: none !important; }
}
