/* ==========================================================================
   Interlude — modales à étapes, banner cookies, pages légales
   ========================================================================== */

/* ---- Modales ------------------------------------------------------------ */
.modal {
  position: fixed; inset: 0; z-index: 2000;
  display: none; align-items: center; justify-content: center;
  padding: 1rem; background: rgba(0, 0, 0, .78);
  overscroll-behavior: contain;
}
.modal.is-open { display: flex; }
.modal__dialog {
  position: relative; width: min(600px, 100%); max-height: min(92vh, 780px); overflow: auto;
  padding: clamp(1.6rem, 4vw, 2.6rem);
  background: #0c0c0c; color: var(--white);
  border: 1px solid rgba(255, 255, 255, .14);
  border-top: 3px solid var(--red);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.modal__close {
  position: absolute; top: .7rem; right: .8rem;
  width: 44px; height: 44px; border: 0; background: none; cursor: pointer;
  font-size: 1.8rem; line-height: 1; color: rgba(255, 255, 255, .8);
}
.modal__close:hover { color: var(--white); }
.modal__eyebrow {
  margin: 0 0 .4rem; font-size: .74rem; letter-spacing: .18em; text-transform: uppercase;
  color: rgba(255, 255, 255, .6); font-weight: 400;
}
.modal__title {
  margin: 0 0 1.4rem; padding-right: 2rem;
  font-family: var(--font-display); font-style: italic; font-weight: 500;
  font-size: clamp(1.35rem, 3vw, 1.75rem); line-height: 1.15;
}
.progress { height: 2px; margin: 0 0 1.6rem; background: rgba(255, 255, 255, .15); }
.progress__bar { height: 100%; width: 0; background: var(--red); transition: width .35s ease; }

.step { display: none; border: 0; margin: 0; padding: 0; min-width: 0; }
.step.is-active { display: block; animation: stepIn .35s ease; }
@keyframes stepIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.step__legend {
  display: block; width: 100%; padding: 0; margin: 0 0 1.1rem;
  font-size: 1.05rem; font-weight: 400; line-height: 1.4;
}
.step__hint { margin: -.5rem 0 1.1rem; font-size: .9rem; color: rgba(255, 255, 255, .65); }

.field { display: block; margin: 0 0 1.15rem; }
.field__label {
  display: block; margin: 0 0 .15rem;
  font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .7);
}
.field__opt { text-transform: none; letter-spacing: 0; color: rgba(255, 255, 255, .5); }
.input, .textarea {
  width: 100%; padding: .7rem 0; border: 0; border-bottom: 1px solid rgba(255, 255, 255, .4);
  background: transparent; color: var(--white); border-radius: 0;
  font: inherit; font-size: 1.05rem; font-weight: 300;
}
.textarea { min-height: 7.5rem; resize: vertical; }
.input:focus, .textarea:focus { outline: none; border-bottom-color: var(--white); box-shadow: 0 1px 0 0 var(--white); }
.input::placeholder, .textarea::placeholder { color: rgba(255, 255, 255, .38); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-bottom-color: #ff6b87; }

.choices { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0 0 .4rem; }
.choice { position: relative; display: inline-flex; }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice span {
  display: inline-block; padding: .65rem 1.05rem; border: 1px solid rgba(255, 255, 255, .4);
  font-size: .95rem; font-weight: 300; line-height: 1.3; transition: background-color .2s, border-color .2s, color .2s;
}
.choice input:hover + span { border-color: var(--white); }
.choice input:focus-visible + span { outline: 2px solid var(--white); outline-offset: 2px; }
.choice input:checked + span { background: var(--red); border-color: var(--red); color: var(--white); }

.check { display: flex; gap: .8rem; align-items: flex-start; margin: 0 0 1rem; font-size: .95rem; line-height: 1.5; }
.check input { flex: 0 0 auto; width: 20px; height: 20px; margin: .15rem 0 0; accent-color: var(--red); }
.check a { text-decoration: underline; text-underline-offset: 3px; }

.notice { margin: 0 0 1rem; font-size: .82rem; line-height: 1.5; color: rgba(255, 255, 255, .6); }
.notice a { text-decoration: underline; text-underline-offset: 2px; }
.field__error { min-height: 1.2em; margin: .3rem 0 0; font-size: .85rem; color: #ff8aa0; }
.form-error { margin: 1rem 0 0; padding: .8rem 1rem; border-left: 3px solid #ff6b87; background: rgba(255, 107, 135, .08); font-size: .92rem; }

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

.gate { margin: 0 0 1rem; padding: 1rem 1.1rem; border: 1px solid rgba(255, 255, 255, .25); font-size: .92rem; line-height: 1.6; }
.gate p { margin: 0 0 .7rem; }
.gate p:last-child { margin-bottom: 0; }
.gate a { text-decoration: underline; text-underline-offset: 3px; }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* Boutons collés en bas de la modale : toujours visibles, même sur les étapes longues */
.actions {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  position: sticky; bottom: calc(-1 * clamp(1.6rem, 4vw, 2.6rem));
  margin: 1.6rem calc(-1 * clamp(1.6rem, 4vw, 2.6rem)) calc(-1 * clamp(1.6rem, 4vw, 2.6rem));
  padding: 1rem clamp(1.6rem, 4vw, 2.6rem);
  background: linear-gradient(to bottom, rgba(12, 12, 12, 0), #0c0c0c 28%);
}
.actions__back { background: none; border: 0; padding: .6rem 0; cursor: pointer; font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .75); }
.actions__back:hover { color: var(--white); }
.actions__back[hidden] { display: none; }
.btn--solid { background: var(--red); border-color: var(--red); color: var(--white); }
.btn--solid:hover { background: var(--white); border-color: var(--white); color: var(--red); }
.btn[disabled] { opacity: .5; cursor: progress; }
.actions .btn { margin-left: auto; }

.done { text-align: left; }
.done__title { margin: 0 0 .8rem; font-family: var(--font-display); font-style: italic; font-weight: 500; font-size: 1.6rem; }
.done p { margin: 0 0 1.4rem; }

/* ---- Banner cookies ----------------------------------------------------- */
.cookie {
  position: fixed; z-index: 2500; left: 50%; bottom: 1rem; transform: translate(-50%, 140%);
  width: min(960px, calc(100% - 2rem));
  padding: 1.3rem 1.5rem; background: #fff; color: #111;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .45);
  transition: transform .5s cubic-bezier(.2, .7, .2, 1);
  visibility: hidden;
}
.cookie.is-open { transform: translate(-50%, 0); visibility: visible; }
.cookie__title { margin: 0 0 .35rem; font-size: 1rem; font-weight: 400; letter-spacing: .02em; }
.cookie__text { margin: 0; font-size: .9rem; line-height: 1.55; color: #333; }
.cookie__text a { text-decoration: underline; text-underline-offset: 3px; }
.cookie__prefs { margin: 1rem 0 0; padding: 1rem 0 0; border-top: 1px solid #ddd; }
.cookie__prefs[hidden] { display: none; }
.pref { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.2rem; }
.pref__label { font-size: .92rem; line-height: 1.5; color: #222; }
.pref__label small { display: block; color: #555; font-size: .82rem; }
.switch { position: relative; flex: 0 0 auto; width: 48px; height: 28px; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 28px; background: #bbb; transition: background-color .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + i { background: #111; }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 2px solid #111; outline-offset: 3px; }
.cookie__actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.cookie .btn { flex: 1 1 10rem; padding: .85rem 1rem; border-color: #111; color: #fff; background: #111; text-align: center; }
.cookie .btn:hover { background: #fff; color: #111; }
.cookie .btn--ghost { background: #fff; color: #111; }
.cookie .btn--ghost:hover { background: #111; color: #fff; }
.cookie :focus-visible { outline-color: #111; }

/* ---- Pages légales ------------------------------------------------------ */
.legal-body { background: #0b0b0b; }
.legal { max-width: 46rem; margin: 0 auto; padding: 6rem var(--pad) 4rem; font-weight: 300; font-size: 1.02rem; line-height: 1.75; }
.legal__back { display: inline-block; margin: 0 0 2.2rem; font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, .4); }
.legal__logo { position: absolute; top: 25px; left: 25px; width: 50px; }
.legal h1 { margin: 0 0 .4rem; font-family: var(--font-display); font-style: italic; font-weight: 500; font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.1; }
.legal .updated { margin: 0 0 2.4rem; font-size: .88rem; color: rgba(255, 255, 255, .6); }
.legal h2 { margin: 2.4rem 0 .6rem; font-family: var(--font-display); font-style: italic; font-weight: 500; font-size: 1.35rem; line-height: 1.2; }
.legal p, .legal ul { margin: 0 0 1rem; }
.legal ul { padding-left: 1.2rem; }
.legal li { margin: 0 0 .4rem; }
.legal a { text-decoration: underline; text-underline-offset: 3px; }
.legal table { width: 100%; border-collapse: collapse; margin: 0 0 1.2rem; font-size: .92rem; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: .65rem .8rem .65rem 0; border-bottom: 1px solid rgba(255, 255, 255, .15); }
.legal th { font-weight: 400; color: rgba(255, 255, 255, .8); }
.todo { background: rgba(229, 39, 82, .22); padding: 0 .3em; }

@media (max-width: 560px) {
  .modal { padding: 0; align-items: flex-end; }
  .modal__dialog { width: 100%; max-height: 94vh; }
  .actions { flex-wrap: nowrap; }
  .cookie { bottom: .5rem; width: calc(100% - 1rem); padding: 1.1rem 1.1rem; }
  .legal table, .legal tbody, .legal tr, .legal th, .legal td { display: block; }
  .legal tr { margin-bottom: .8rem; }
}
@media (prefers-reduced-motion: reduce) {
  .step.is-active { animation: none; }
  .cookie { transition: none; }
}

/* Le badge reCAPTCHA est masqué : la mention obligatoire figure dans le formulaire. */
.grecaptcha-badge { visibility: hidden !important; }

/* Pages légales : pied de page et détails */
.footer--legal { padding-top: 2rem; text-align: center; }
.footer__links--row { display: flex; flex-wrap: wrap; justify-content: center; gap: .2rem 1.6rem; }
.legal code { font-size: .85em; background: rgba(255, 255, 255, .1); padding: .08em .35em; border-radius: 2px; }
.legal small { color: rgba(255, 255, 255, .6); font-size: .85em; }
.legal h1, .legal h2 { text-wrap: balance; }
