/**
 * Écran de connexion et de création de compte.
 *
 * Traduction fidèle de la maquette. Deux colonnes à partir de 901 px : la
 * photo tient toute la hauteur à gauche, le formulaire occupe la droite.
 * En dessous, la photo devient un bandeau de 160 px et le formulaire prend
 * toute la largeur.
 *
 * Cet écran n'a ni en-tête ni pied de site : il porte donc lui-même sa mise à
 * zéro et ses couleurs, sans dépendre de 3-layout.css ni de 5-chrome.css.
 */

.cx-corps {
  margin: 0;
  background: var(--paper);
  color: var(--encre-texte);
  font-family: var(--police-texte);
  font-size: 17px;
  line-height: 1.6;
}

.cx {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  min-height: 100vh;
  min-height: 100dvh;
}

/* ── Colonne photo ───────────────────────────────────────── */

.cx-photo {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
}

.cx-photo__fond {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Le cadrage remonte : centré, la fenêtre mange le sujet. */
  object-position: 50% 40%;
}

.cx-photo__voile {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgb(28 27 53 / 0.12) 0%,
    rgb(28 27 53 / 0.08) 40%,
    rgb(28 27 53 / 0.78) 100%
  );
}

.cx-photo__contenu {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(24px, 3vw, 44px);
}

.cx-marque {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  color: var(--paper);
  text-decoration: none;
}

.cx-marque img {
  width: 40px;
  height: auto;
  border-radius: var(--rayon-rond);
  background: var(--paper);
  padding: 3px;
}

.cx-marque span {
  font-family: var(--police-titre);
  font-weight: 500;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--paper);
}

.cx-parole {
  margin: 0;
  max-width: 34ch;
}

/* La base habille tout blockquote d'un filet doré : pas ici. */
.cx-parole blockquote {
  margin: 0;
  padding-inline-start: 0;
  border-inline-start: 0;
  font-family: var(--police-titre);
  font-style: normal;
  font-size: clamp(1.4rem, 1rem + 1.4vw, 2.1rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--paper);
}

.cx-parole figcaption {
  margin-top: 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--or);
}

/* ── Bandeau photo mobile ────────────────────────────────── */

.cx-photo-mob {
  display: none;
  position: relative;
  height: 160px;
}

/* Enfant direct seulement : le logo de la marque est lui aussi un <img> dans
   ce bandeau, et il ne doit pas être étiré au format de la photo. */
.cx-photo-mob > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 45%;
}

.cx-photo-mob .cx-photo__voile {
  background: linear-gradient(180deg, rgb(28 27 53 / 0.1) 0%, rgb(28 27 53 / 0.55) 100%);
}

.cx-photo-mob .cx-marque {
  position: absolute;
  left: 22px;
  bottom: 16px;
  gap: 10px;
}

.cx-photo-mob .cx-marque img { width: 36px; }
.cx-photo-mob .cx-marque span { font-size: 18px; }

/* ── Colonne formulaire ──────────────────────────────────── */

.cx-panneau {
  display: flex;
  flex-direction: column;
}

.cx-centre {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 4vw, 64px) clamp(22px, 5vw, 96px);
}

.cx-boite {
  width: 100%;
  max-width: 440px;
  margin-inline: auto;
}

/* `width: fit-content` plutôt que `inline-flex` : le lien garde sa largeur
   naturelle mais occupe sa propre ligne, sinon les onglets viennent se coller
   à sa droite dès que la place le permet. */
.cx-retour {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-bottom: 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
}

.cx-retour:hover,
.cx-retour:focus-visible { color: var(--terre); }

.cx-retour i { font-size: 11px; }

/* ── Onglets ─────────────────────────────────────────────── */

.cx-onglets {
  display: inline-flex;
  padding: 4px;
  border-radius: var(--rayon-rond);
  background: var(--paper-2);
  border: 1px solid var(--trait);
  margin-bottom: 26px;
}

.cx-onglet {
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--rayon-rond);
  cursor: pointer;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  white-space: nowrap;
  background: transparent;
  color: var(--ink-2);
  transition: background-color var(--transition), color var(--transition);
}

.cx-onglet[aria-selected="true"] {
  background: var(--ink);
  color: var(--paper);
}

/* ── Formulaires ─────────────────────────────────────────── */

/* `display: flex` l'emporterait sur le [hidden] du navigateur : on le remet
   explicitement, sinon les deux formulaires s'affichent l'un sous l'autre. */
.cx-formulaire[hidden] { display: none; }

.cx-formulaire {
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: cx-fondu 220ms cubic-bezier(0.2, 0.6, 0.3, 1) both;
}

@keyframes cx-fondu {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .cx-formulaire { animation: none; }
}

.cx-formulaire h1 {
  margin: 0;
  font-family: var(--police-titre);
  font-weight: 500;
  font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.cx-chapo {
  margin: 10px 0 0;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-2);
}

.cx-champ {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cx-champ label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terre-fonce);
}

.cx-champ__entete {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.cx-oubli {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1px solid var(--terre);
  white-space: nowrap;
  text-decoration: none;
}

.cx-oubli:hover,
.cx-oubli:focus-visible { color: var(--terre); }

.cx-champ__boite { position: relative; }

.cx-champ input[type="text"],
.cx-champ input[type="email"],
.cx-champ input[type="password"] {
  width: 100%;
  min-height: 54px;
  /* La réserve de droite laisse la place à l'œil, même sans lui : les deux
     champs gardent ainsi exactement la même géométrie. */
  padding: 0 52px 0 18px;
  border-radius: 12px;
  border: 1px solid var(--trait);
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.cx-champ input::placeholder { color: #8E8898; }

.cx-champ input:focus-visible {
  border-color: var(--terre);
}

.cx-oeil {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--rayon-rond);
  background: transparent;
  cursor: pointer;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cx-oeil i { font-size: 15px; }
.cx-oeil:hover { color: var(--ink); }

.cx-souvenir {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 15px;
  color: var(--ink-2);
  cursor: pointer;
}

.cx-souvenir input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--ink);
  cursor: pointer;
}

.cx-bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 26px;
  border: 0;
  border-radius: var(--rayon-rond);
  background: var(--ink);
  color: var(--paper);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color var(--transition), transform var(--transition);
}

.cx-bouton:hover,
.cx-bouton:focus-visible {
  background: var(--c-nuit-clair);
  transform: translateY(-2px);
}

.cx-bouton i { font-size: 12px; }

.cx-bascule {
  margin: 6px 0 0;
  font-size: 15px;
  color: var(--ink-2);
}

.cx-mention {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-2);
}

.cx-mention a,
.cx-lien {
  color: var(--ink);
  border-bottom: 1px solid var(--terre);
  text-decoration: none;
}

.cx-lien {
  padding: 0;
  border-top: 0;
  border-inline: 0;
  background: transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.cx-mention a:hover,
.cx-lien:hover,
.cx-lien:focus-visible { color: var(--terre); }

/* ── Messages de WooCommerce ─────────────────────────────── */

.cx-messages:empty { display: none; }

.cx-messages ul {
  margin: 0 0 18px;
  padding: 14px 16px;
  list-style: none;
  border-radius: 12px;
  border: 1px solid var(--trait);
  background: var(--paper-2);
  font-size: 14.5px;
  line-height: 1.45;
}

.cx-messages li + li { margin-block-start: 8px; }

.cx-messages .woocommerce-error {
  border-color: #B00000;
  background: rgb(176 0 0 / 0.06);
  color: #B00000;
}

/* ── Pied de l'écran ─────────────────────────────────────── */

.cx-pied {
  padding: 18px clamp(22px, 5vw, 96px);
  border-top: 1px solid var(--trait);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  font-size: 13px;
  color: var(--ink-2);
}

.cx-pied a {
  color: var(--ink);
  border-bottom: 1px solid var(--terre);
  text-decoration: none;
}

.cx-pied a:hover { color: var(--terre); }

/* ── Sous 900 px : une seule colonne ─────────────────────── */

@media (max-width: 900px) {
  .cx {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .cx-photo { display: none; }
  .cx-photo-mob { display: block; }
}
