/* Connexion, inscription, mot de passe oublié et les champs communs de Mes informations (D-162, inc/connexion.php).
   Sur le fond sombre du site (comptes-sombre.css) et ses variables : --orange, --ink, --muted, --line, --carte, --champ.
   Chargée seulement sur ces écrans. Direction A « Cour » (.cx--a), choisie par Lucas le 6 nov. */

/* ---------- Le titre de la page : petit, au-dessus du panneau ---------- */
body.mc-connexion .martin-app-main { padding-top: 22px; }
body.mc-connexion .martin-app-title {
  margin: 0 0 14px; color: var(--orange, #f17940); font: 800 15px/1.2 var(--cz-display, BarlowCondensed, 'Arial Narrow', Arial, sans-serif);
  letter-spacing: .14em; text-transform: uppercase;
}

/* ---------- Champs, cases et boutons communs ---------- */
.cx-form { margin: 0; }
.cx-champ { margin: 0 0 14px; padding: 0; }
.cx-champ label, .cx-form .form-row label { display: block; margin: 0 0 6px; color: #dfe6e5; font-size: 14px; font-weight: 700; line-height: 1.3; }
.cx-champ .required { display: none; }
.cx-facultatif { color: var(--muted, #9fb0b1); font-weight: 400; }
body.martin-sombre .martin-app-main .cx-input,
body.martin-sombre .martin-app-main .cx-form select {
  width: 100%; min-height: 48px; margin: 0; padding: 11px 14px; border: 1px solid var(--contour, #3b4a4b); border-radius: 6px;
  background: var(--champ, #152022); color: #fff; font: 400 16px/1.3 Lato, Arial, sans-serif; box-shadow: none;
}
body.martin-sombre .martin-app-main .cx-form select { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23f17940' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 15px center; }
body.martin-sombre .martin-app-main .cx-input:hover, body.martin-sombre .martin-app-main .cx-form select:hover { border-color: #56696a; }
body.martin-sombre .martin-app-main .cx-input:focus, body.martin-sombre .martin-app-main .cx-form select:focus { border-color: var(--orange, #f17940); outline: 2px solid rgba(241, 121, 64, .35); outline-offset: 0; }
body.martin-sombre .martin-app-main .cx-input::placeholder { color: #6f8283; }
.cx-form .woocommerce-invalid .cx-input, .cx-form .woocommerce-invalid select { border-color: #e2583e; }
.cx-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }

.cx-mdp { position: relative; display: block; }
/* woocommerce.js enveloppe chaque mot de passe et y ajoute son œil : celui du thème le remplace. */
.cx-mdp .password-input { display: block; position: static; }
.cx-mdp .show-password-input { display: none !important; }
.cx-mdp .cx-input { padding-right: 52px; }
.cx-oeil {
  position: absolute; top: 50%; right: 4px; display: grid; place-items: center; width: 44px; height: 40px; margin: 0; padding: 0;
  transform: translateY(-50%); border: 0; border-radius: 4px; background: transparent; color: #9fb0b1; cursor: pointer;
}
body.martin-sombre .martin-app-main .cx-oeil { background: transparent; color: #9fb0b1; box-shadow: none; }
.cx-oeil:hover, body.martin-sombre .martin-app-main .cx-oeil:hover { background: transparent; color: #fff; }
.cx-oeil svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cx-oeil .cx-oeil-ferme, .cx-oeil[aria-pressed="true"] .cx-oeil-ouvert { display: none; }
.cx-oeil[aria-pressed="true"] .cx-oeil-ferme { display: inline; }
.cx-force { display: flex; align-items: center; gap: 10px; margin-top: 8px; color: var(--muted, #9fb0b1); font-size: 13px; }
.cx-force-barres { display: grid; grid-template-columns: repeat(4, 22px); gap: 4px; }
.cx-force-barres i { height: 4px; border-radius: 2px; background: #3b4a4b; }
.cx-force[data-niveau="1"] i:nth-child(-n+1) { background: #e2583e; }
.cx-force[data-niveau="2"] i:nth-child(-n+2) { background: #f1a340; }
.cx-force[data-niveau="3"] i:nth-child(-n+3) { background: #9cc65a; }
.cx-force[data-niveau="4"] i { background: #5fc27e; }
.cx-force[data-niveau="1"] .cx-force-texte { color: #f0a08f; }
.cx-force[data-niveau="3"] .cx-force-texte, .cx-force[data-niveau="4"] .cx-force-texte { color: #b9e3a0; }

/* Les formulaires de WooCommerce ont leur cadre (app.css, comptes-sombre.css) : ici, c'est le panneau qui encadre. */
body.martin-sombre .martin-app-main .cx .woocommerce-form-login, body.martin-sombre .martin-app-main .cx .woocommerce-form-register,
body.martin-sombre .martin-app-main .cx .lost_reset_password { margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
body.martin-sombre .martin-app-main label.cx-case { display: inline-flex; margin: 0; font-size: 15px; font-weight: 400; }
.cx-case { display: inline-flex; align-items: center; gap: 10px; margin: 0; color: #dfe6e5; font-size: 15px; font-weight: 400; cursor: pointer; }
.cx-case input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--orange, #f17940); }
.cx-ligne { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 2px 0 18px; }
body.martin-sombre .martin-app-main .cx-oublie, .cx-bascule a, .cx-aide a { color: #fff; font-weight: 700; text-decoration: underline; text-decoration-color: var(--orange, #f17940); text-underline-offset: 4px; }
body.martin-sombre .martin-app-main .cx-oublie:hover, .cx-bascule a:hover, .cx-aide a:hover { color: var(--orange, #f17940); }
body.martin-sombre .martin-app-main .cx-bouton { min-height: 50px; margin: 0; padding: 12px 22px; }
body.martin-sombre .martin-app-main .cx-bouton--plein { display: block; width: 100%; font-size: 18px; }
.cx-lien, body.martin-sombre .martin-app-main button.cx-lien {
  margin: 0; padding: 6px 2px; border: 0; background: none; color: #fff; font: 700 15px/1.2 Lato, Arial, sans-serif;
  letter-spacing: 0; text-transform: none; text-decoration: underline; text-decoration-color: var(--orange, #f17940); text-underline-offset: 4px; cursor: pointer;
}
body.martin-sombre .martin-app-main button.cx-lien:hover { background: none; color: var(--orange, #f17940); }
.cx-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: 6px 0 0; }
.cx-piege { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.cx-form .woocommerce-privacy-policy-text p { margin: 4px 0 16px; color: var(--muted, #9fb0b1); font-size: 13px; line-height: 1.5; }
.cx-form .woocommerce-privacy-policy-text a { color: #dfe6e5; }

/* ---------- Commun ---------- */
.cx h2 { margin: 0 0 20px; color: #fff; font: 800 clamp(28px, 2.6vw, 36px)/1.05 var(--cz-display, BarlowCondensed, 'Arial Narrow', Arial, sans-serif); letter-spacing: .01em; text-transform: uppercase; }
.cx-sur { margin: 0 0 8px; color: var(--orange, #f17940); font: 800 14px/1.2 var(--cz-display, BarlowCondensed, 'Arial Narrow', Arial, sans-serif); letter-spacing: .14em; text-transform: uppercase; }
.cx h2 + .cx-chapeau { margin-top: -12px; }
.cx-chapeau { margin: 0 0 18px; color: #c9d3d2; font-size: 16px; line-height: 1.5; }
.cx-bascule { margin: 16px 0 0; color: var(--muted, #9fb0b1); font-size: 15px; }
.cx-aide { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line, #303d3e); color: var(--muted, #9fb0b1); font-size: 14px; line-height: 1.5; }
.cx-aide p { margin: 0 0 4px; }
.cx-atout-icone { display: grid; flex: none; place-items: center; width: 40px; height: 40px; border-radius: 8px; background: rgba(241, 121, 64, .14); color: var(--orange, #f17940); }
.cx-atout-icone svg { display: block; }

/* ---------- Direction A « Cour » : la photo du magasin à gauche, le panneau à droite ---------- */
.cx--a:not(.cx--seul) { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); min-height: 640px; overflow: hidden; border: 1px solid var(--line, #303d3e); border-radius: 12px; background: var(--carte, #222c2d); }
.cx--a .cx-cour {
  position: relative; display: flex; align-items: flex-end; min-height: 100%; padding: 40px;
  background: linear-gradient(180deg, rgba(29, 39, 40, 0) 0%, rgba(29, 39, 40, .1) 28%, rgba(29, 39, 40, .82) 50%, #1d2728 66%), var(--cx-photo) 30% 0 / 100% auto no-repeat, #1d2728;
}
.cx--a .cx-cour::before { content: ""; position: absolute; inset: 0 0 auto; height: 8px; background: repeating-linear-gradient(-45deg, #f17940 0 14px, #1b2425 14px 28px); }
.cx--a .cx-cour-texte { max-width: 540px; }
.cx--a .cx-accroche { margin: 0 0 24px; color: #fff; font: 800 clamp(34px, 3.4vw, 48px)/1 var(--cz-display, BarlowCondensed, 'Arial Narrow', Arial, sans-serif); text-transform: uppercase; text-shadow: 0 2px 18px rgba(0, 0, 0, .45); }
.cx--a .cx-atouts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 22px; margin: 0; padding: 0; list-style: none; }
.cx--a .cx-atouts li { display: flex; gap: 12px; align-items: flex-start; color: #d7dfde; font-size: 14px; line-height: 1.45; }
.cx--a .cx-atouts b { display: block; margin-bottom: 2px; color: #fff; font-size: 15px; }
.cx--a .cx-atouts .cx-atout-icone { background: rgba(27, 36, 37, .78); border: 1px solid rgba(241, 121, 64, .5); }
.cx--a .cx-panneau { display: flex; flex-direction: column; justify-content: center; padding: 40px 44px; }
.cx--a .cx-onglets { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 0 0 26px; padding: 4px; border-radius: 8px; background: #172021; }
body.martin-sombre .martin-app-main .cx--a .cx-onglets button {
  min-height: 46px; margin: 0; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; color: #b5c2c1;
  font: 800 16px/1 var(--cz-display, BarlowCondensed, 'Arial Narrow', Arial, sans-serif); letter-spacing: .06em; text-transform: uppercase; box-shadow: none;
}
body.martin-sombre .martin-app-main .cx--a .cx-onglets button:hover { background: #222c2d; color: #fff; }
body.martin-sombre .martin-app-main .cx--a .cx-onglets button[aria-selected="true"] { background: var(--orange, #f17940); color: #1b2425; }
/* Sans JavaScript : pas d'onglets, les deux volets l'un après l'autre. Avec : un seul volet à la fois. */
.cx--a .cx-onglets { display: none; }
.cx-js .cx--a .cx-onglets { display: grid; }
.cx-js .cx--a[data-cx-ouvert="connexion"] #cx-inscription, .cx-js .cx--a[data-cx-ouvert="inscription"] #cx-connexion { display: none; }
html:not(.cx-js) .cx--a .cx-volet + .cx-volet { margin-top: 34px; padding-top: 30px; border-top: 1px solid var(--line, #303d3e); }
html:not(.cx-js) .cx--a .cx-bascule { display: none; }
.cx-annuler { display: none; }
.mi-js .mi--a .cx-annuler { display: inline-block; }

/* Mot de passe oublié et nouveau mot de passe : une seule carte, au centre. */
.cx--seul { display: flex; justify-content: center; }
.cx-panneau--seul { width: 100%; max-width: 520px; padding: 36px 40px; border: 1px solid var(--line, #303d3e); border-radius: 12px; background: var(--carte, #222c2d); }
.cx--seul .cx-panneau--seul { position: relative; overflow: hidden; }
.cx--seul .cx-panneau--seul::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; background: repeating-linear-gradient(-45deg, #f17940 0 14px, #1b2425 14px 28px); }

/* ---------- Cell ---------- */
@media (max-width: 960px) {
  .cx--a:not(.cx--seul) { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .cx--a .cx-cour { min-height: 0; padding: 200px 22px 22px; background-size: 100% auto, auto; }
  .cx--a .cx-accroche { margin-bottom: 18px; font-size: 32px; }
  .cx--a .cx-panneau { padding: 26px 22px 24px; }
}
@media (max-width: 600px) {
  body.mc-connexion .martin-app-main { padding-top: 14px; }
  .cx-duo { grid-template-columns: minmax(0, 1fr); }
  .cx--a .cx-cour { padding: 196px 18px 18px; background: linear-gradient(180deg, rgba(29, 39, 40, 0) 0, rgba(29, 39, 40, 0) 140px, #1d2728 222px), var(--cx-photo) 0 0 / 100% auto no-repeat, #1d2728; }
  .cx--a .cx-atouts { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .cx--a .cx-atouts li span:last-child { font-size: 0; }
  .cx--a .cx-atouts li b { margin: 0; font-size: 15px; }
  .cx--a .cx-atouts li { align-items: center; }
  .cx--a .cx-atouts .cx-atout-icone { width: 34px; height: 34px; }
  .cx--a .cx-panneau { padding: 22px 18px; }
  .cx-panneau--seul { padding: 30px 20px; }
}
@media (prefers-reduced-motion: no-preference) {
  .cx-force-barres i { transition: background-color .2s ease; }
}
