/* Jeunes — finition ciblée de la carte « Prochaine étape ». */
.agd-youth-page--v2 > .agd-youth-register {
  position: relative;
  isolation: isolate;
  background-size: 145% 100%;
  background-position: 0% 50%;
  animation: agd-youth-register-gradient 18s ease-in-out infinite alternate;
}

.agd-youth-page--v2 > .agd-youth-register::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(116deg, transparent 0 48%, rgba(255,255,255,.055) 48.5% 49%, transparent 49.5% 67%, rgba(240,211,154,.12) 67.5% 68%, transparent 68.5% 100%);
  opacity: .9;
}

.agd-youth-page--v2 > .agd-youth-register > * {
  position: relative;
  z-index: 1;
}

@keyframes agd-youth-register-gradient {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}

.agd-youth-page--v2 > .agd-youth-register > div:first-child {
  max-width: 680px;
}

.agd-youth-page--v2 > .agd-youth-register .eyebrow {
  margin-bottom: 9px;
  color: #f0d39a;
}

.agd-youth-page--v2 > .agd-youth-register h2 {
  margin-bottom: 10px;
  letter-spacing: -.025em;
}

.agd-youth-page--v2 > .agd-youth-register > div:first-child > p:not(.eyebrow) {
  max-width: 590px;
  margin-bottom: 14px;
}

.agd-youth-page--v2 > .agd-youth-register .agd-youth-register__contact {
  padding-top: 13px;
  border-top: 1px solid rgba(255,255,255,.16);
}

.agd-youth-page--v2 > .agd-youth-register .agd-youth-register__actions {
  min-width: 215px;
  gap: 11px;
  padding: 6px;
  border: 1px solid rgba(240,211,154,.26);
  border-radius: 18px;
  background: rgba(6,29,58,.18);
}

.agd-youth-page--v2 > .agd-youth-register .agd-youth-register__actions .wp-element-button {
  width: 100%;
  justify-content: center;
  box-shadow: 0 8px 16px rgba(0,0,0,.14), inset 0 1px 0 rgba(255,255,255,.28);
}

.agd-youth-page--v2 > .agd-youth-register .agd-youth-register__actions .agd-youth-text-link {
  align-self: center;
  padding: 4px 8px;
  text-underline-offset: 5px;
}

@media (max-width: 700px) {
  body.page-id-11 .agd-youth-page--v2 {
    padding-bottom: 8px !important;
  }

  body.page-id-11 .wp-site-blocks > .wp-block-template-part:has(> .premium-footer) {
    margin-top: 8px !important;
  }

  .agd-youth-page--v2 > .agd-youth-register {
    background-size: 190% 100%;
    animation-duration: 22s;
  }

  .agd-youth-page--v2 > .agd-youth-register .agd-youth-register__actions {
    width: 100%;
    min-width: 0;
    padding: 5px;
    border-radius: 15px;
  }

  .agd-youth-page--v2 > .agd-youth-register .agd-youth-register__actions .agd-youth-text-link {
    align-self: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .agd-youth-page--v2 > .agd-youth-register {
    animation: none;
    background-position: 50% 50%;
  }
}

/* Compactage intrinsèque de la carte « Prochaine étape » sur petits écrans. */
@media (max-width: 520px) {
  body.page-id-11 .agd-youth-page--v2 > .agd-youth-register {
    padding-top: 14px !important;
    padding-bottom: 14px !important;
  }

  body.page-id-11 .agd-youth-page--v2 > .agd-youth-register .agd-youth-register__contact {
    padding-top: 8px !important;
  }

  body.page-id-11 .agd-youth-page--v2 > .agd-youth-register .agd-youth-register__actions {
    gap: 6px !important;
    padding: 4px !important;
  }
}

/* Flux mobile déterministe : une seule séparation de 34 px entre grandes cartes. */
@media (max-width: 420px) {
  /* Le conteneur passe en flux vertical normal afin d'éviter une rangée de
   * grille implicite qui créerait un vide entre le calendrier et l'accompagnement. */
  .agd-youth-page--v2 {
    display: flex !important;
    flex-direction: column !important;
    gap: 34px !important;
    row-gap: 34px !important;
  }

  /* WordPress wraps the inline calendar script in an empty paragraph. Keep
   * the script executable, but remove that non-visual flex item from the
   * separation calculation between Calendar and Accompagnement. */
  .agd-youth-page--v2 > p:has(> script) {
    display: none !important;
    margin: 0 !important;
  }

  .agd-youth-page--v2 > .agd-youth-hero,
  .agd-youth-page--v2 > .agd-youth-section {
    margin-block-start: 0 !important;
    margin-block-end: 0 !important;
  }

  body.page-id-11 .agd-youth-page--v2 {
    display: flex !important;
    flex-direction: column !important;
    gap: 34px !important;
    row-gap: 34px !important;
  }

  body.page-id-11 .agd-youth-page--v2 > .agd-youth-hero,
  body.page-id-11 .agd-youth-page--v2 > .agd-youth-section {
    margin-block-start: 0 !important;
    margin-block-end: 0 !important;
  }

  body.page-id-11 .agd-youth-page--v2 > .agd-youth-hero,
  body.page-id-11 .agd-youth-page--v2 > .agd-youth-section {
    box-shadow: 0 5px 12px rgba(6, 29, 58, .11) !important;
  }

  /* Jonction ciblée : Calendrier → Accompagnement. L'ancien rendu utilise
   * .agd-calendar-overview, le rendu synthétique .agd-youth-v2-calendar. */
  .agd-youth-page--v2 > .agd-calendar-overview + .agd-youth-v2-coaching,
  .agd-youth-page--v2 > .agd-youth-v2-calendar + .agd-youth-v2-coaching {
    margin-block-start: 0 !important;
  }

  .agd-youth-page--v2 > .agd-calendar-overview,
  .agd-youth-page--v2 > .agd-youth-v2-calendar {
    margin-block-end: 0 !important;
  }
}
