/* =============================================================================
   Connexion · inscription · mot de passe oublie — Marcel Blanc
   Gabarits : woocommerce/myaccount/form-login.php, form-lost-password.php
   Charge uniquement sur ces pages (inc/auth-pages.php).
   Les anciennes regles du theme ciblent .woocommerce-form-login input,
   .woocommerce-account .form-row input, etc. (bordure noire, coins droits,
   texte de bouton aligne a droite) : tout est prefixe .mb-auth et force.
   ========================================================================== */

.mb-auth {
  font-family: "Plus Jakarta Sans", "Source Sans Pro", system-ui, sans-serif;
  color: #121A21;
  margin: 8px 0 48px;
}

/* --- Bandeau d'information (anciens clients) ------------------------------ */
.mb-auth__notice {
  display: flex;
  align-items: flex-start;
  gap: 14px 16px;
  flex-wrap: wrap;
  margin: 0 0 24px;
  padding: 18px 20px;
  background: #F1F5FA;
  border: 1px solid #D6E2EF;
  border-radius: 16px;
}
.mb-auth__notice-icon { flex: 0 0 auto; color: #2B6CB0; line-height: 0; margin-top: 1px; }
.mb-auth__notice-text { flex: 1 1 320px; min-width: 0; }
.mb-auth__notice-text strong { display: block; font-size: 15px; font-weight: 800; margin: 0 0 4px; color: #121A21; }
.mb-auth__notice-text p { margin: 0 !important; font-size: 14px; line-height: 1.55; color: #3E4A56; }
.mb-auth .mb-auth__notice-link {
  flex: 0 0 auto;
  align-self: center;
  display: inline-flex;
  align-items: center;
  height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #B9CCE0;
  color: #1F4F86 !important;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none !important;
  white-space: nowrap;
}
.mb-auth .mb-auth__notice-link:hover { border-color: #1F4F86; }

/* --- Grille des cartes ----------------------------------------------------- */
.mb-auth__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
}
.mb-auth--single .mb-auth__grid { grid-template-columns: minmax(0, 560px); }

.mb-auth__card {
  background: #fff;
  border: 1px solid #DDE3E9;
  border-radius: 16px;
  padding: 32px;
  box-sizing: border-box;
  min-width: 0;
}
.mb-auth__card--aside {
  background: #F5F7F9;
  border-color: #E4E9ED;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.mb-auth .mb-auth__title {
  margin: 0 0 6px !important;
  font-family: inherit !important;
  font-size: 26px !important;
  font-weight: 800 !important;
  letter-spacing: -.02em;
  line-height: 1.2 !important;
  color: #121A21 !important;
}
.mb-auth .mb-auth__title--small { font-size: 20px !important; }
.mb-auth .mb-auth__lead {
  margin: 0 0 24px !important;
  font-size: 15px;
  line-height: 1.55;
  color: #5A646E;
}

/* --- Champs ---------------------------------------------------------------- */
.mb-auth .mb-auth__form { margin: 0 !important; padding: 0 !important; border: 0 !important; }
.mb-auth .mb-auth__form > p,
.mb-auth .mb-auth__field { margin: 0 0 18px !important; padding: 0 !important; width: 100% !important; float: none !important; }

.mb-auth .mb-auth__field label,
.mb-auth .mb-auth__label-row label {
  display: block;
  margin: 0 0 6px !important;
  font-size: 14px;
  font-weight: 700;
  color: #121A21;
  line-height: 1.3;
}
.mb-auth .mb-auth__label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.mb-auth .required { color: #D40032; text-decoration: none; border: 0; }

.mb-auth .mb-auth__form input[type="text"],
.mb-auth .mb-auth__form input[type="email"],
.mb-auth .mb-auth__form input[type="password"],
.mb-auth .mb-auth__form input[type="tel"] {
  display: block;
  width: 100% !important;
  height: 48px !important;
  margin: 0 !important;
  padding: 0 14px !important;
  box-sizing: border-box;
  border: 1.5px solid #CBD3DA !important;
  border-radius: 10px !important;
  background: #fff !important;
  box-shadow: none !important;
  outline: none;
  font-family: inherit !important;
  font-size: 15px !important;
  color: #121A21 !important;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.mb-auth .mb-auth__form input[type="text"]:hover,
.mb-auth .mb-auth__form input[type="email"]:hover,
.mb-auth .mb-auth__form input[type="password"]:hover { border-color: #9AA6B0 !important; }
.mb-auth .mb-auth__form input[type="text"]:focus,
.mb-auth .mb-auth__form input[type="email"]:focus,
.mb-auth .mb-auth__form input[type="password"]:focus {
  border: 1.5px solid #D40032 !important;
  border-radius: 10px !important;
  box-shadow: 0 0 0 3px rgba(212, 0, 50, .12) !important;
}

/* Bouton afficher / masquer le mot de passe (ajoute par WooCommerce) */
.mb-auth .password-input { position: relative; display: block; width: 100%; }
.mb-auth .password-input input { padding-right: 52px !important; }
.mb-auth .show-password-input {
  display: flex !important;
  align-items: center;
  justify-content: center;
  position: absolute !important;
  top: 4px !important;
  right: 4px !important;
  width: 40px !important;
  height: 40px !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: #5A646E !important;
  box-shadow: none !important;
  cursor: pointer;
  font-size: 0 !important;
}
.mb-auth .show-password-input:hover { background: #F2F4F6 !important; color: #121A21 !important; }
.mb-auth .show-password-input::after {
  content: "";
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
}
.mb-auth .show-password-input.display-password::after {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3l18 18'/%3E%3Cpath d='M10.6 6.1A9.9 9.9 0 0 1 12 6c6.5 0 10 6 10 6a17 17 0 0 1-3.2 3.9M6.6 6.6C3.9 8.3 2 12 2 12s3.5 6 10 6a9.7 9.7 0 0 0 5.4-1.6'/%3E%3Cpath d='M9.9 9.9a3 3 0 0 0 4.2 4.2'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3l18 18'/%3E%3Cpath d='M10.6 6.1A9.9 9.9 0 0 1 12 6c6.5 0 10 6 10 6a17 17 0 0 1-3.2 3.9M6.6 6.6C3.9 8.3 2 12 2 12s3.5 6 10 6a9.7 9.7 0 0 0 5.4-1.6'/%3E%3Cpath d='M9.9 9.9a3 3 0 0 0 4.2 4.2'/%3E%3C/svg%3E");
}

/* Case « Rester connecte » */
.mb-auth .mb-auth__remember { margin: -4px 0 22px !important; }
.mb-auth .mb-auth__remember label {
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  margin: 0 !important;
  font-size: 14px;
  font-weight: 500;
  color: #3E4A56;
  cursor: pointer;
}
.mb-auth .mb-auth__remember input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  margin: 0 !important;
  padding: 0 !important;
  accent-color: #D40032;
}

/* --- Boutons --------------------------------------------------------------- */
/* Selecteur renforce : l'ancienne regle « .woocommerce-form.woocommerce-form-login
   .button { width: fit-content !important } » est plus specifique. */
.mb-auth .mb-auth__form .mb-auth__submit.button,
.mb-auth .mb-auth__submit {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100% !important;
  height: 50px !important;
  margin: 0 !important;
  padding: 0 20px !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: #D40032 !important;
  background-image: none !important;
  color: #fff !important;
  font-family: inherit !important;
  font-size: 15.5px !important;
  font-weight: 700 !important;
  text-align: center !important;
  box-shadow: none !important;
  opacity: 1 !important;
  cursor: pointer;
}
.mb-auth .mb-auth__form .mb-auth__submit.button:hover,
.mb-auth .mb-auth__submit:hover { background: #B00029 !important; opacity: 1 !important; }
.mb-auth .mb-auth__submit:focus-visible { outline: 2px solid #121A21; outline-offset: 3px; }
.mb-auth .mb-auth__submit::after,
.mb-auth .mb-auth__submit::before { content: none !important; display: none !important; }

.mb-auth .mb-auth__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 22px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none !important;
  box-sizing: border-box;
}
.mb-auth .mb-auth__btn--ghost {
  background: #fff;
  border: 1.5px solid #D40032;
  color: #D40032 !important;
}
.mb-auth .mb-auth__btn--ghost:hover { background: #FDF0F3; }

/* --- Liens et petits textes ------------------------------------------------ */
.mb-auth a.mb-auth__small-link,
.mb-auth .mb-auth__help a {
  color: #D40032 !important;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none !important;
}
.mb-auth a.mb-auth__small-link:hover,
.mb-auth .mb-auth__help a:hover { text-decoration: underline !important; }
.mb-auth .mb-auth__help { margin: 18px 0 0 !important; font-size: 13.5px; color: #5A646E; }
.mb-auth .mb-auth__card--aside .mb-auth__help { margin-top: auto !important; padding-top: 20px; }
.mb-auth .mb-auth__note { margin: -4px 0 20px !important; font-size: 14px; color: #5A646E; }

/* Avantages du compte */
.mb-auth .mb-auth__perks {
  list-style: none !important;
  margin: -8px 0 24px !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mb-auth .mb-auth__perks li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 !important;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.45;
  color: #121A21;
}
.mb-auth .mb-auth__perks li::before { display: none !important; }
.mb-auth .mb-auth__perks svg { flex: 0 0 auto; color: #187A41; margin-top: 1px; }

/* Captcha et champs ajoutes par des extensions */
.mb-auth .mb-turnstile { margin: 0 0 18px; }

/* Messages WooCommerce (erreurs de connexion) au-dessus des cartes */
.mb-auth-page .woocommerce-error,
.mb-auth-page .woocommerce-message,
.mb-auth-page .woocommerce-info {
  border-radius: 12px !important;
  font-family: "Plus Jakarta Sans", "Source Sans Pro", system-ui, sans-serif;
}

/* Formulaire « nouveau mot de passe » (lien recu par e-mail, gabarit WooCommerce
   d'origine) : memes champs et bouton. */
.mb-auth-page form.woocommerce-ResetPassword:not(.mb-auth__form) {
  max-width: 560px;
  padding: 32px;
  border: 1px solid #DDE3E9;
  border-radius: 16px;
  background: #fff;
}
.mb-auth-page form.woocommerce-ResetPassword:not(.mb-auth__form) input.input-text {
  height: 48px !important;
  padding: 0 14px !important;
  border: 1.5px solid #CBD3DA !important;
  border-radius: 10px !important;
  background: #fff !important;
}
.mb-auth-page form.woocommerce-ResetPassword:not(.mb-auth__form) .button {
  width: 100% !important;
  height: 50px;
  border-radius: 10px !important;
  background: #D40032 !important;
  text-align: center !important;
  justify-content: center;
}

/* --- Responsive ------------------------------------------------------------ */
@media (max-width: 900px) {
  .mb-auth__grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .mb-auth__card { padding: 24px 20px; }
  .mb-auth .mb-auth__title { font-size: 23px !important; }
  .mb-auth .mb-auth__notice-link { width: 100%; justify-content: center; }
  .mb-auth .mb-auth__form input[type="text"],
  .mb-auth .mb-auth__form input[type="email"],
  .mb-auth .mb-auth__form input[type="password"] { font-size: 16px !important; } /* evite le zoom iOS */
}
