/**
 * THOTIKA / Upmotion - Page recuperation de mot de passe
 * Compatible avec le HTML Classic fourni - sans JS, sans modification .tpl.
 * Cible uniquement la page password (avec fallback sur le formulaire).
 * Version 1.0 - 2026-10
 */

/* Carte principale, au meme niveau de sobriete que le checkout. */
body#password #main,
#main:has(form.forgotten-password) {
  --tp-ink: #103f40;
  --tp-muted: #647b79;
  --tp-border: #d9e6e2;
  --tp-accent: #15514c;
  --tp-accent-hover: #0f403d;
  --tp-focus: #31bb90;
  box-sizing: border-box;
  width: min(100%, 660px);
  max-width: 660px;
  margin: 36px auto 70px;
  padding: 42px 48px 34px;
  background: #fff;
  border: 1px solid #e5ece9;
  border-radius: 20px;
  box-shadow: 0 7px 24px rgba(16, 63, 64, .035);
  color: var(--tp-ink);
}

/* Titre de la page. */
body#password #main > .page-header,
#main:has(form.forgotten-password) > .page-header {
  display: block;
  margin: 0 0 14px;
  padding: 0;
  background: transparent;
  border: 0;
  text-align: left;
}
body#password #main > .page-header h1,
#main:has(form.forgotten-password) > .page-header h1 {
  margin: 0;
  padding: 0;
  color: #103f40;
  font-size: clamp(23px, 3vw, 29px);
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -.025em;
  text-transform: none;
}

/* PrestaShop enveloppe le formulaire dans une carte : on retire le double cadre. */
body#password #main > #content.page-content,
#main:has(form.forgotten-password) > #content.page-content {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body#password #main form.forgotten-password,
#main form.forgotten-password {
  width: 100%;
  margin: 0;
  padding: 0;
}
body#password #main .forgotten-password > header,
#main .forgotten-password > header {
  margin: 0 0 27px;
  padding: 0;
  background: transparent;
  border: 0;
}
body#password #main .send-renew-password-link,
#main .forgotten-password .send-renew-password-link {
  max-width: 54ch;
  margin: 0;
  color: #637b78;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.75;
  text-align: left;
}

/* Le HTML actuel met label, champ et bouton sur une meme ligne Bootstrap.
   On transforme le groupe en formulaire vertical clair et lisible. */
body#password #main .forgotten-password .form-fields,
#main .forgotten-password .form-fields {
  width: 100%;
  margin: 0;
  padding: 0;
}
body#password #main .forgotten-password .form-group.center-email-fields,
#main .forgotten-password .form-group.center-email-fields {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: start;
  width: 100%;
  margin: 0;
  padding: 0;
  text-align: left;
}
body#password #main .forgotten-password .center-email-fields > label.form-control-label,
#main .forgotten-password .center-email-fields > label.form-control-label {
  display: block;
  float: none;
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0 0 9px;
  padding: 0;
  color: #184647;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  text-align: left;
}
body#password #main .forgotten-password .center-email-fields > .email,
#main .forgotten-password .center-email-fields > .email {
  display: block;
  float: none;
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
  padding: 0;
}
body#password #main .forgotten-password input#email,
#main .forgotten-password input#email {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  min-width: 0;
  height: 50px;
  min-height: 50px;
  margin: 0;
  padding: 0 15px;
  color: #103f40;
  background: #fff;
  border: 1px solid #cfdfda;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(16, 63, 64, .025);
  outline: none;
  font: inherit;
  font-size: 14px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
body#password #main .forgotten-password input#email:hover,
#main .forgotten-password input#email:hover {
  border-color: #a8c7bd;
}
body#password #main .forgotten-password input#email:focus,
#main .forgotten-password input#email:focus {
  border-color: var(--tp-focus, #31bb90);
  box-shadow: 0 0 0 3px rgba(49, 187, 144, .13);
}
body#password #main .forgotten-password input#email:invalid:not(:placeholder-shown):not(:focus),
#main .forgotten-password input#email:invalid:not(:placeholder-shown):not(:focus) {
  /* La validation native du navigateur est conservee. */
  box-shadow: none;
}

/* Bouton principal : conserve les deux variantes desktop / mobile de Classic. */
body#password #main .forgotten-password .center-email-fields > button.form-control-submit,
#main .forgotten-password .center-email-fields > button.form-control-submit {
  box-sizing: border-box;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  margin: 22px 0 0;
  padding: 13px 18px;
  color: #fff;
  background: #15514c;
  border: 1px solid #15514c;
  border-radius: 11px;
  box-shadow: none;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  white-space: normal;
  cursor: pointer;
  transition: background-color .17s ease, border-color .17s ease, transform .17s ease;
}
body#password #main .forgotten-password .center-email-fields > button.form-control-submit:hover,
#main .forgotten-password .center-email-fields > button.form-control-submit:hover {
  background: #0f403d;
  border-color: #0f403d;
}
body#password #main .forgotten-password .center-email-fields > button.form-control-submit:active,
#main .forgotten-password .center-email-fields > button.form-control-submit:active {
  transform: translateY(1px);
}
body#password #main .forgotten-password .center-email-fields > button.form-control-submit:focus-visible,
#main .forgotten-password .center-email-fields > button.form-control-submit:focus-visible {
  outline: 3px solid rgba(49, 187, 144, .45);
  outline-offset: 3px;
}
body#password #main .forgotten-password .center-email-fields > button.form-control-submit:disabled,
#main .forgotten-password .center-email-fields > button.form-control-submit:disabled {
  opacity: .56;
  cursor: not-allowed;
}

/* Classic affiche un bouton long sur desktop et un bouton court sur mobile. */
body#password #main .center-email-fields > button.hidden-sm-up,
#main .forgotten-password .center-email-fields > button.hidden-sm-up {
  display: none !important;
}
body#password #main .center-email-fields > button.hidden-xs-down,
#main .forgotten-password .center-email-fields > button.hidden-xs-down {
  display: inline-flex !important;
}

/* Messages natifs PrestaShop, ne pas dissimuler les erreurs. */
body#password #main .forgotten-password .ps-alert-error,
#main .forgotten-password .ps-alert-error {
  margin: 0 0 18px;
  padding: 12px 15px;
  background: #fff5f4;
  border: 1px solid #f0c9c6;
  border-radius: 9px;
  color: #952e2a;
  list-style: none;
  font-size: 13px;
  line-height: 1.55;
}
body#password #main .forgotten-password .ps-alert-error:empty,
#main .forgotten-password .ps-alert-error:empty,
#main .forgotten-password .ps-alert-error:not(:has(li)) {
  display: none;
}
body#password #main .forgotten-password .ps-alert-error li,
#main .forgotten-password .ps-alert-error li {
  margin: 0;
  padding: 0;
  color: inherit;
}
body#password #main .alert-success,
#main:has(form.forgotten-password) .alert-success {
  padding: 14px 16px;
  background: #effaf4;
  border: 1px solid #ccead8;
  border-radius: 9px;
  color: #185b49;
  font-size: 14px;
}

/* Retour a la connexion : un lien secondaire, pas un deuxieme bouton principal. */
body#password #main > footer.page-footer,
#main:has(form.forgotten-password) > footer.page-footer {
  display: flex;
  justify-content: center;
  margin: 27px 0 0;
  padding: 21px 0 0;
  border-top: 1px solid #e7eeeb;
  background: transparent;
  text-align: center;
}
body#password #main #back-to-login,
#main:has(form.forgotten-password) #back-to-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 40px;
  margin: 0;
  padding: 7px 12px;
  color: #2a6760;
  background: transparent;
  border: 0;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.5;
  text-decoration: none;
  transition: background-color .16s ease, color .16s ease;
}
body#password #main #back-to-login:hover,
#main:has(form.forgotten-password) #back-to-login:hover {
  color: #103f40;
  background: #f0f7f4;
  text-decoration: none;
}
body#password #main #back-to-login:focus-visible,
#main:has(form.forgotten-password) #back-to-login:focus-visible {
  outline: 2px solid #31bb90;
  outline-offset: 2px;
}
body#password #main #back-to-login .material-icons,
#main:has(form.forgotten-password) #back-to-login .material-icons {
  display: none;
}
body#password #main #back-to-login::before,
#main:has(form.forgotten-password) #back-to-login::before {
  content: "\2190";
  display: inline-block;
  font-family: Arial, sans-serif;
  font-size: 19px;
  font-weight: 400;
  line-height: 1;
}

@media (max-width: 575.98px) {
  body#password #main,
  #main:has(form.forgotten-password) {
    margin: 8px auto 35px;
    padding: 29px 23px 22px;
    border-radius: 16px;
  }
  body#password #main > .page-header h1,
  #main:has(form.forgotten-password) > .page-header h1 {
    font-size: 24px;
  }
  body#password #main .forgotten-password > header,
  #main .forgotten-password > header {
    margin-bottom: 23px;
  }
  body#password #main .send-renew-password-link,
  #main .forgotten-password .send-renew-password-link {
    font-size: 13px;
    line-height: 1.7;
  }
  body#password #main .center-email-fields > button.hidden-xs-down,
  #main .forgotten-password .center-email-fields > button.hidden-xs-down {
    display: none !important;
  }
  body#password #main .center-email-fields > button.hidden-sm-up,
  #main .forgotten-password .center-email-fields > button.hidden-sm-up {
    display: inline-flex !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body#password #main .forgotten-password input#email,
  #main .forgotten-password input#email,
  body#password #main .forgotten-password button.form-control-submit,
  #main .forgotten-password button.form-control-submit,
  body#password #main #back-to-login,
  #main:has(form.forgotten-password) #back-to-login {
    transition: none;
  }
}
