/* ==========================================================
   Sign in / OTP / Forgot password / Sign up (So_CustomerLogin)
   Body class: .ml-auth-page (layout handle customerlogin_auth)
   ========================================================== */

#html-body.ml-auth-page,
#html-body.ml-auth-page .page-wrapper,
#html-body.ml-auth-page .page-main {
  background: #f4eee6;
}

/* Header: logo only, centred */
#html-body.ml-auth-page .page-header {
  background: #fff;
  border-bottom: 1px solid #ececec;
}

#html-body.ml-auth-page .page-header .header.content.ml-header-bottom {
  justify-content: center;
  min-height: 64px;
}

#html-body.ml-auth-page .page-header .header.content.ml-header-bottom .logo {
  max-width: 140px;
  margin: 0 auto;
}

#html-body.ml-auth-page .page-main {
  min-height: calc(100vh - 66px);
  padding-top: 36px;
  padding-bottom: 50px;
  box-sizing: border-box;
}

/* Page messages (errors / success) */
#html-body.ml-auth-page .page.messages {
  max-width: 380px;
  margin: 0 auto 14px;
}

#html-body.ml-auth-page .page.messages .message {
  margin: 0 0 8px;
  padding: 12px 16px 12px 44px;
  font-family: 'DM Sans', 'Lato', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  border-radius: 10px;
}

#html-body.ml-auth-page .page.messages .message.error {
  color: #fff;
  background: #a72122;
}

#html-body.ml-auth-page .page.messages .message.error > *:first-child:before {
  color: #fff;
}

/* ---------- Card ---------- */
.ml-auth {
  max-width: 360px;
  margin: 0 auto;
  font-family: 'DM Sans', 'Lato', sans-serif;
  color: #3a3734;
  text-align: center;
}

.ml-auth-image {
  display: block;
  width: 100%;
  max-width: 230px;
  height: auto;
  margin: 0 auto 10px;
  animation: ml-auth-in .5s ease both;
}

.ml-auth-image--otp {
  max-width: 190px;
}

@keyframes ml-auth-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

#html-body .ml-auth-title {
  margin: 0 0 10px;
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.2;
  color: #1f7a68;
}

.ml-auth-text {
  max-width: 300px;
  margin: 0 auto 18px;
  font-size: 13px;
  line-height: 1.6;
  color: #6b6763;
}

/* ---------- Form ---------- */
.ml-auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 14px 0 0;
}

.ml-auth-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

#html-body .ml-auth .ml-auth-input {
  width: 100%;
  height: 46px;
  margin: 0;
  padding: 0 20px;
  font-family: inherit;
  font-size: 14px;
  color: #2b2b2b;
  background: #fff;
  border: 1.5px solid transparent;
  border-radius: 30px;
  box-shadow: none;
  box-sizing: border-box;
  transition: border-color .2s, box-shadow .2s;
}

#html-body .ml-auth .ml-auth-input::placeholder {
  color: #6b6763;
}

#html-body .ml-auth .ml-auth-input:focus {
  border-color: #1f7a68;
  outline: none;
  box-shadow: 0 0 0 3px rgba(31, 122, 104, .12);
}

#html-body .ml-auth .ml-auth-input.is-invalid {
  border-color: #a72122;
}

#html-body .ml-auth .ml-auth-select {
  padding-right: 42px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%233a3734' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E") no-repeat right 18px center / 12px 12px;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

#html-body .ml-auth .ml-auth-select.is-placeholder {
  color: #6b6763;
}

/* Buttons */
#html-body .ml-auth .ml-auth-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 46px;
  margin: 0;
  padding: 0 24px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  border: 0;
  border-radius: 30px;
  box-shadow: none;
  box-sizing: border-box;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, color .2s, transform .1s;
}

#html-body .ml-auth .ml-auth-button:active {
  transform: scale(.98);
}

#html-body .ml-auth .ml-auth-button--light {
  color: #1f7a68;
  background: #c7d8a9;
}

#html-body .ml-auth .ml-auth-button--light:hover {
  color: #1f7a68;
  background: #b9cf96;
}

#html-body .ml-auth .ml-auth-button--dark,
#html-body .ml-auth .ml-auth-button--dark:visited {
  color: #fff;
  background: #1f7a68;
}

#html-body .ml-auth .ml-auth-button--dark:hover {
  color: #fff;
  background: #175c4a;
}

#html-body .ml-auth .ml-auth-button[disabled],
.ml-auth-form.is-loading .ml-auth-button[type="submit"] {
  opacity: .7;
  pointer-events: none;
}

/* Small text / links */
.ml-auth-legal {
  max-width: 300px;
  margin: 18px auto 0;
  font-size: 11px;
  line-height: 1.7;
  color: #3a3734;
}

.ml-auth-legal a,
.ml-auth-check a {
  font-weight: 700;
  color: #2b2b2b;
  text-decoration: underline;
}

.ml-auth-small {
  margin: 14px 0 0;
  font-size: 12px;
  color: #6b6763;
}

#html-body .ml-auth .ml-auth-link {
  display: inline;
  margin: 0;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: #1f7a68;
  background: none;
  border: 0;
  box-shadow: none;
  text-decoration: none;
  cursor: pointer;
}

#html-body .ml-auth .ml-auth-link:hover {
  text-decoration: underline;
}

#html-body .ml-auth .ml-auth-link[disabled] {
  opacity: .5;
  cursor: default;
}

.ml-auth-back,
.ml-auth-back:visited {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 12px;
  font-weight: 600;
  color: #3a3734;
  text-decoration: none;
  align-self: flex-start;
}

.ml-auth-back:hover {
  color: #1f7a68;
  text-decoration: none;
}

.ml-auth > .ml-auth-back {
  display: flex;
  width: fit-content;
}

.ml-auth-error {
  margin: 0;
  font-size: 12px;
  color: #a72122;
  text-align: left;
}

/* Checkboxes */
.ml-auth-check {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 2px 0 0;
  font-size: 11px;
  line-height: 1.6;
  text-align: left;
  color: #3a3734;
  cursor: pointer;
}

.ml-auth-check input {
  position: absolute;
  opacity: 0;
  width: 18px;
  height: 18px;
  margin: 0;
}

.ml-auth-check-box {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  background: #fff;
  border: 1.5px solid #c9c4bc;
  border-radius: 4px;
  box-sizing: border-box;
  transition: background .15s, border-color .15s;
}

.ml-auth-check input:checked + .ml-auth-check-box {
  background: #1f7a68 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3.2 3.2L15 6.8' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / 14px 14px;
  border-color: #1f7a68;
}

.ml-auth-check input:focus-visible + .ml-auth-check-box {
  box-shadow: 0 0 0 3px rgba(31, 122, 104, .2);
}

.ml-auth-check input.is-invalid + .ml-auth-check-box {
  border-color: #a72122;
}

/* ---------- OTP boxes ---------- */
.ml-otp-boxes {
  display: flex;
  justify-content: center;
  gap: 10px;
}

#html-body .ml-auth .ml-otp-box {
  width: 46px;
  height: 52px;
  margin: 0;
  padding: 0;
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 24px;
  text-align: center;
  color: #1f7a68;
  background: #fff;
  border: 1.5px solid transparent;
  border-radius: 8px;
  box-shadow: none;
  caret-color: #1f7a68;
  transition: background .25s, border-color .2s, transform .2s;
}

#html-body .ml-auth .ml-otp-box:focus {
  border-color: #1f7a68;
  outline: none;
  box-shadow: 0 0 0 3px rgba(31, 122, 104, .12);
}

/* Correct code: boxes turn green one after another */
.ml-otp.is-success .ml-otp-box {
  background: #c7d8a9 !important;
  border-color: #c7d8a9 !important;
  animation: ml-otp-pop .35s ease both;
}

.ml-otp.is-success .ml-otp-box:nth-child(2) { animation-delay: .06s; }
.ml-otp.is-success .ml-otp-box:nth-child(3) { animation-delay: .12s; }
.ml-otp.is-success .ml-otp-box:nth-child(4) { animation-delay: .18s; }
.ml-otp.is-success .ml-otp-box:nth-child(5) { animation-delay: .24s; }

@keyframes ml-otp-pop {
  50% { transform: scale(1.12); }
}

/* Wrong code */
.ml-otp.is-error .ml-otp-boxes {
  animation: ml-otp-shake .4s ease;
}

#html-body .ml-auth .ml-otp.is-error .ml-otp-box {
  border-color: #a72122;
}

@keyframes ml-otp-shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.ml-otp-message {
  min-height: 18px;
  margin: 0;
  font-size: 12px;
}

.ml-otp-message.is-error {
  color: #a72122;
}

.ml-otp-message.is-success {
  font-weight: 600;
  color: #1f7a68;
}

/* ---------- Mobile ---------- */
@media screen and (max-width: 767px) {
  #html-body.ml-auth-page .page-main {
    padding-top: 24px;
  }

  .ml-auth-image {
    max-width: 200px;
  }

  .ml-auth-image--otp {
    max-width: 160px;
  }

  #html-body .ml-auth .ml-otp-box {
    width: 44px;
    height: 50px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ml-auth-image,
  .ml-otp.is-success .ml-otp-box,
  .ml-otp.is-error .ml-otp-boxes {
    animation: none;
  }
}
