/* ============================================================
   AVENUE BELMONT — PAGE AUTHENTIFICATION (4 points de contrôle)
   Par défaut (mobile, JS indisponible) : 4 blocs texte/image empilés,
   révélés au scroll via l'utilitaire global .reveal (base.css).
   Sur desktop/tablette (≥901px), assets/js/authentification.js ajoute
   la classe .is-pinned : la section reste épinglée sous le header
   pendant le scroll et les étapes se fondent l'une dans l'autre.
   ============================================================ */

.ab-auth {
  background: var(--color-white);
  padding-block: clamp(3rem, 6vw, 5rem) 0;
  font-family: var(--font-body);
  color: var(--color-black);
}

.ab-auth__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-inline: var(--container-px);
}

/* En-tête */
.ab-auth__header { margin-bottom: 0; max-width: 620px; margin-inline: auto; }

/* H1 centré sur toute la largeur de .ab-auth__inner (donc sur toute la
   page), volontairement en dehors de la colonne de lecture de 720px
   utilisée par le paragraphe d'intro ci-dessous. */
.ab-auth__title {
  width: 100%;
  font-family: var(--font-heading);
  font-size: clamp(2.25rem, 5.5vw, 4.25rem);
  font-weight: 700;
  line-height: 1.05;
  margin: 0 0 var(--space-6);
  color: var(--color-primary);
  letter-spacing: -0.02em;
  text-align: center;
  white-space: nowrap;
}
.ab-auth__title em { font-style: italic; font-weight: 300; color: var(--color-primary-mid); }

/* Intro visible — apporte le contexte et les mots-clés de la niche pour
   le SEO (le H1 ci-dessus est désormais visible mais volontairement plus
   court/percutant ; le mot-clé "authentification Rolex" reste porté par
   ce paragraphe et par les sous-titres H2 plus bas sur la page). */
.ab-auth__intro {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: var(--leading-loose);
  color: var(--color-grey-800);
  font-weight: 300;
  margin: 0;
  text-align: center;
}

/* Bloc éditorial (WordPress > Pages > Authentification, the_content()) —
   seul contenu réellement analysé par Yoast. Typographie recalée sur
   l'échelle de la page plutôt que sur les tailles h1-h6 génériques (trop
   grandes) définies dans base.css. */
.ab-auth__content {
  max-width: 680px;
  margin: clamp(2rem, 4vw, 3rem) 0 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: var(--leading-loose);
  color: var(--color-grey-800);
  font-weight: 300;
}
.ab-auth__content h2,
.ab-auth__content h3 {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  font-weight: 400;
  color: var(--color-primary);
  letter-spacing: -0.01em;
  margin: var(--space-6) 0 var(--space-4);
}
.ab-auth__content p { margin: 0 0 var(--space-4); }
.ab-auth__content p:last-child { margin-bottom: 0; }
.ab-auth__content a {
  color: var(--color-primary-mid);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ab-auth__content a:hover { color: var(--color-primary); }
.ab-auth__content img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: var(--space-5) 0;
}

/* ============================================================
   RESSOURCE — cadre de fin de page pour le contenu éditorial
   (donne un contexte visuel minimal en attendant le travail de design
   complet de la page ; voir .ab-auth__content ci-dessus pour la typo).
   ============================================================ */
.ab-auth-resource {
  padding-block: clamp(2.5rem, 6vw, 4rem);
}
.ab-auth-resource__inner {
  max-width: 760px;
  margin: 0 auto;
  padding-inline: var(--container-px);
}
.ab-auth-resource__title {
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  font-weight: 400;
  color: var(--color-primary);
  margin: 0;
}
.ab-auth-resource .ab-auth__content { margin-top: var(--space-5); max-width: none; }

/* Bloc <details>/<summary> natif : pas de JS nécessaire pour déplier la
   ressource sur la même page. */
.ab-auth-resource__details { }
.ab-auth-resource__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  cursor: pointer;
  list-style: none;
}
.ab-auth-resource__summary::-webkit-details-marker { display: none; }
.ab-auth-resource__summary::marker { content: ''; }
.ab-auth-resource__summary:hover .ab-auth-resource__title { color: var(--color-primary-mid); }
.ab-auth-resource__icon {
  flex-shrink: 0;
  font-size: 1.6rem;
  font-weight: 200;
  line-height: 1;
  color: var(--color-primary-mid);
  transition: transform 0.3s ease;
}
.ab-auth-resource__details[open] .ab-auth-resource__icon { transform: rotate(45deg); }

.ab-auth-resource__panel { padding-top: var(--space-5); }

/* Ressources externes — favicon + domaine, un lien par ligne. */
.ab-auth-resource__links-intro {
  margin: var(--space-6) 0 var(--space-3);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--color-grey-800);
  font-weight: 300;
}
.ab-auth-resource__links-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.ab-auth-resource__inline-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-primary-mid);
  border-bottom: 1px solid transparent;
}
.ab-auth-resource__inline-link:hover {
  color: var(--color-primary);
  border-bottom-color: currentColor;
}
.ab-auth-resource__favicon {
  width: 16px;
  height: 16px;
  border-radius: 3px;
}

/* ── Étapes ── */
.ab-auth-steps {
  margin-top: clamp(2.5rem, 5vw, 4rem);
}

.ab-auth-step {
  padding-block: clamp(3rem, 7vw, 6rem);
  border-top: 1px solid var(--color-border);
}
.ab-auth-step:nth-child(even) { background: var(--color-off-white); }

.ab-auth-step__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-inline: var(--container-px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

/* Colonne texte (gauche) — condensée à 2 lignes : badge+titre, puis description */
.ab-auth-step__text { max-width: 580px; }

/* "01" à la même typographie et taille que le titre (hérite de la
   taille du parent h2), sans badge ni icône. */
.ab-auth-step__num-inline {
  font-weight: 400;
  color: var(--color-primary-mid);
  margin-right: 0.4em;
}

.ab-auth-step__title {
  font-family: var(--font-heading);
  font-size: clamp(1.35rem, 1.9vw, 1.9rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--color-primary);
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ab-auth-step__desc {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: var(--leading-loose);
  color: var(--color-grey-800);
  font-weight: 300;
  margin: 0;
}

/* Preuve de confiance (chiffre/fait concret) sous la description :
   répond au "pourquoi vous croire", pas seulement au "comment". Elle
   apparaît légèrement après le reste du bloc (fondu + léger décalage vers
   le haut, puis un trait qui se dessine sous le chiffre) pour lui donner
   plus de poids visuel qu'un simple texte statique. */
.ab-auth-step__proof {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4em 0.5em;
  margin: var(--space-4) 0 0;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.ab-auth-step__proof-stat {
  position: relative;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-primary-mid);
  white-space: nowrap;
}
.ab-auth-step__proof-stat::after {
  content: '';
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -3px;
  height: 2px;
  background: var(--color-primary-mid);
  opacity: 0.5;
  transition: right 0.45s ease;
}
.ab-auth-step__proof-label {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 300;
  line-height: 1.4;
  color: var(--color-grey-800);
  opacity: 0.85;
}

/* Déclencheurs : reveal classique (mobile/stacked, une seule fois) et
   étape active en mode épinglé (desktop, à chaque passage). */
.ab-auth-step.is-visible .ab-auth-step__proof,
.ab-auth-steps.is-pinned .ab-auth-step.is-active .ab-auth-step__proof {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.2s;
}
.ab-auth-step.is-visible .ab-auth-step__proof-stat::after,
.ab-auth-steps.is-pinned .ab-auth-step.is-active .ab-auth-step__proof-stat::after {
  right: 0;
  transition-delay: 0.5s;
}

@media (prefers-reduced-motion: reduce) {
  .ab-auth-step__proof { opacity: 1; transform: none; transition: none; }
  .ab-auth-step__proof-stat::after { transition: none; right: 0; }
}

/* Colonne image (droite) */
.ab-auth-step__media {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-cream);
}

.ab-auth-step__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  transition: transform 0.9s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.ab-auth-step.is-visible .ab-auth-step__media img { transform: scale(1); }

/* Espace réservé tant que le visuel définitif n'est pas fourni */
.ab-auth-step__media-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-cream);
  color: var(--color-primary-mid);
  opacity: 0.3;
}
.ab-auth-step__media-placeholder span {
  font-family: var(--font-heading);
  font-size: 4rem;
  font-weight: 300;
  font-style: italic;
}

/* ── Mode épinglé (desktop/tablette, JS actif) ──
   authentification.js ajoute .is-pinned sur .ab-auth-steps et fixe une
   hauteur inline (nb d'étapes × ~130vh) qui crée la distance de scroll.
   Pendant ce défilement, .ab-auth-steps__sticky reste collé sous le header
   et chaque étape (absolument positionnée) s'efface en fondu vers la
   suivante au lieu de s'empiler. */
.ab-auth-steps.is-pinned { position: relative; }

.ab-auth-steps.is-pinned .ab-auth-steps__sticky {
  position: sticky;
  top: 80px;
  height: calc(100vh - 80px);
  overflow: hidden;
}
.admin-bar .ab-auth-steps.is-pinned .ab-auth-steps__sticky {
  top: 112px;
  height: calc(100vh - 112px);
}

.ab-auth-steps.is-pinned .ab-auth-step {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  border-top: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.ab-auth-steps.is-pinned .ab-auth-step.is-active {
  opacity: 1;
  pointer-events: auto;
}
.ab-auth-steps.is-pinned .ab-auth-step__inner { width: 100%; }
.ab-auth-steps.is-pinned .ab-auth-step__media { max-height: min(62vh, 580px); }

/* Fondu simple et minimaliste en mode épinglé : pas de zoom sur l'image,
   juste le crossfade géré par l'opacité ci-dessus. */
.ab-auth-steps.is-pinned .ab-auth-step__media img {
  transform: none;
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .ab-auth-steps.is-pinned .ab-auth-step { transition: none; }
}

/* Barre de progression discrète — visible uniquement en mode épinglé,
   indique à l'utilisateur que le scroll fait bien avancer les étapes. */
.ab-auth-progress {
  display: none;
  position: absolute;
  left: 50%;
  bottom: clamp(1.25rem, 3vw, 2rem);
  transform: translateX(-50%);
  width: min(90%, 220px);
  height: 2px;
  background: var(--color-border);
  border-radius: 2px;
  overflow: hidden;
}
.ab-auth-steps.is-pinned .ab-auth-progress { display: block; }

.ab-auth-progress__bar {
  height: 100%;
  width: 0%;
  background: var(--color-primary-mid);
  border-radius: inherit;
}
@media (prefers-reduced-motion: no-preference) {
  .ab-auth-progress__bar { transition: width 0.15s linear; }
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .ab-auth-step__inner {
    grid-template-columns: 1fr;
    gap: clamp(1.5rem, 5vw, 2.5rem);
  }
  .ab-auth-step__text { max-width: none; }
  .ab-auth-step__media { order: -1; aspect-ratio: 16 / 11; }
  .ab-auth-step__title {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    font-size: clamp(1.4rem, 4.5vw, 1.8rem);
  }
}

@media (max-width: 480px) {
  .ab-auth-step { padding-block: clamp(2.25rem, 10vw, 3rem); }
}

/* Sur mobile, le H1 doit rester un vrai titre imposant : on autorise le
   retour à la ligne plutôt que de rapetisser la police pour tenir sur
   une seule ligne. */
@media (max-width: 600px) {
  .ab-auth__title {
    white-space: normal;
    font-size: clamp(2rem, 9vw, 2.75rem);
    line-height: 1.1;
  }
}

/* Respect des préférences d'accessibilité */
@media (prefers-reduced-motion: reduce) {
  .ab-auth-step__media img { transition: none; transform: none; }
}

/* ============================================================
   CTA DE CONVERSION — capitaliser sur la confiance après les 4 étapes
   ============================================================ */
.ab-auth-cta {
  background: var(--color-primary);
  padding-block: clamp(2.5rem, 6vw, 4rem);
  text-align: center;
}
.ab-auth-cta__inner {
  max-width: 640px;
  margin: 0 auto;
  padding-inline: var(--container-px);
}
.ab-auth-cta__title {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-weight: 400;
  color: var(--color-white);
  margin: 0 0 var(--space-5);
  line-height: 1.3;
}
.ab-auth-cta__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-4) var(--space-6);
}
.ab-auth-cta__actions .btn--tertiary { color: var(--color-white); }
.ab-auth-cta__actions .btn--tertiary:hover { color: rgba(255,255,255,0.75); }

/* Bordure blanche au survol du bouton principal du CTA (le fond passe déjà
   à var(--color-primary) au hover via buttons.css, qui se fond dans le
   fond de section — la bordure blanche garde le bouton bien visible). */
.ab-auth-cta__actions .btn--primary {
  border: 1px solid transparent;
}
.ab-auth-cta__actions .btn--primary:hover {
  border-color: var(--color-white);
}

.ab-auth-cta__legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2) var(--space-5);
  list-style: none;
  margin: var(--space-6) 0 0;
  padding: 0;
}
.ab-auth-cta__legal-links a {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 400;
  color: rgba(255,255,255,0.65);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ab-auth-cta__legal-links a:hover { color: var(--color-white); }

/* ============================================================
   FAQ — longue traîne SEO (accordéon .ab-faq-acc partagé, voir faq.css)
   ============================================================ */
.ab-auth-faq {
  padding-block: clamp(2.5rem, 6vw, 4rem);
}
.ab-auth-faq__inner {
  max-width: 760px;
  margin: 0 auto;
  padding-inline: var(--container-px);
}
.ab-auth-faq__title {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-weight: 400;
  color: var(--color-primary);
  margin: 0 0 var(--space-5);
  text-align: center;
}
@media (max-width: 560px) {
  .ab-auth-cta__actions { flex-direction: column; gap: var(--space-4); }
  /* .btn--primary a un padding fixe de 81px pensé pour un texte court sur
     desktop : sur mobile, avec "Voir nos montres authentifiées", ça
     déborderait. On resserre pour cette page. */
  .ab-auth-cta__actions .btn--primary {
    padding: 14px 28px;
    font-size: 0.8rem;
    white-space: normal;
    text-align: center;
    width: 100%;
    max-width: 320px;
  }
  /* .btn hérite white-space: nowrap (buttons.css) : avec "Une question ?
     Contacter un conseiller →", ça débordait sur mobile. */
  .ab-auth-cta__actions .btn--tertiary {
    white-space: normal;
    text-align: center;
    max-width: 320px;
  }
}

@media (max-width: 480px) {
  .ab-auth-resource__summary { align-items: flex-start; }
  .ab-auth-resource__icon { margin-top: 0.15em; }
}
