:root {
  --auth-primary: rgba(18, 46, 89, 1);
  --auth-success: #0fa91e;
  --auth-info: #1173c3;
  --auth-danger: #cb1c1c;
  --auth-padd: min(7vw, 2em);
  --auth-radius: 8px;
}
.auth-modal * {
  outline: 0;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

#account_login_form_wrapper,
#account_register_form_wrapper,
#account_profile_form_wrapper {
  display: none;
}

#websima-auth-modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 999;
  display: none;
  overflow: hidden;
  outline: 0;
  background-color: #000000cf;
  line-height: 1.5;
  font-size: 15px; /* This size affects everything, be careful. */
  color: #333;
  overflow-y: auto;
}

.auth-modal-dialog {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  width: 90%;
  max-width: 540px;
  max-height: 95%;
  transition: 0.3s;
  padding-top: 4em;
  display: flex;
  flex-direction: column;
  z-index: 2;
}

.show .auth-modal-dialog {
  animation: scaleIn 0.6s ease forwards;
}

@keyframes scaleIn {
  from {
    transform: translateX(-50%) translateY(-30px) scale(0.98);
  }

  to {
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

.auth-modal-content {
  position: relative;
  width: 100%;
  pointer-events: auto;
  border-radius: var(--auth-radius);
  outline: 0;
  padding: 3em var(--auth-padd) 2em;
  max-height: 100%;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.auth-modal .close {
  all: unset;
  width: 2em;
  height: 2em;
  fill: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: auto;
  padding-bottom: 0.3em;
  padding-left: 0.2em;
  transition: all 0.6s 0.1s;
  transform: translateY(3em);
}

.show.auth-modal .close {
  transform: translateY(0);
}

.auth-modal .close:active {
  transform: scale(1.04);
}

.auth-modal .close:hover {
  transform: scale(1.04);
  opacity: 0.8;
}

.auth-modal-body {
  position: relative;
  max-height: 100%;
}

.auth-modal-title {
  font-size: 1.3em;
  font-weight: bold;
  color: #000;
  display: block;
  margin-bottom: 1em;
}

#account_login_form_wrapper .auth-modal-title,
#account_register_form_wrapper .auth-modal-title {
  margin-top: 1.5em;
}

.auth-form-row {
  margin-bottom: 1em;
}

.auth-form-operation {
  margin-top: 2em;
}

.auth-form-row .auth-title {
  display: block;
  font-size: 0.875em;
  font-weight: 400;
  color: #3f4064;
  margin: 1.3em 0;
}

.auth-form-row .auth-label {
  font-size: 0.82em;
  display: block;
  color: #3f4064;
  margin-bottom: 0.5em;
}

.auth-form-row label.form-check-label span {
  font-size: 0.85em;
  color: #62666d;
}

.auth-form-row input:not([type="checkbox"]) {
  border: 1px solid #c0c2c5;
  border-radius: var(--auth-radius);
  padding: 0.6em 0.8em;
  height: 3.3em;
  display: flex;
  align-items: center;
  gap: 0.5em;
  width: 100%;
  transition: 0.3s;
  position: relative;
  font-size: 0.9em;
}

.auth-form-row input[name="password"],
.auth-form-row input[name="verification_code"] {
  text-align: center;
  letter-spacing: 0.5em;
}

.auth-form-row input:not([type="checkbox"])::placeholder {
  color: #a1a3a8 !important;
}

.auth-form-row input.error:not([type="checkbox"]) {
  border-color: var(--auth-danger) !important;
}

.auth-form-row input:not([type="checkbox"]):focus {
  border-color: var(--auth-primary);
}

.auth-form-row .form-check-label {
  display: flex;
  align-items: center;
  gap: 0.5em;
  cursor: pointer;
  user-select: none;
}

.auth-form-row .form-check-input[type="checkbox"]:focus {
  outline: none;
}

.auth-form-row .form-check-input[type="checkbox"]:checked {
  border-color: var(--auth-primary);
}

.auth-form-row .form-check-input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  background-color: #fff;
  margin: 0;
  font: inherit;
  color: currentColor;
  width: 1.15em;
  height: 1.15em;
  border: 0.15em solid #e0e0e0;
  border-radius: 0.25em;
  transform: translateY(-0.075em);
  display: grid;
  place-content: center;
  cursor: pointer;
  transition: 0.2s all ease-in-out;
}

.auth-form-row .form-check-input[type="checkbox"]::before {
  content: "";
  width: 0.65em;
  height: 0.65em;
  transform: scale(0);
  transition: 120ms transform ease-in-out;
  box-shadow: inset 1em 1em var(--auth-primary);
  background-color: var(--auth-primary);
  transform-origin: bottom left;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.auth-form-row .form-check-input[type="checkbox"]:checked::before {
  transform: scale(1);
}

.auth-modal .error {
  font-size: 0.75em;
  color: var(--auth-danger);
  display: block;
  margin-top: 0.375em;
  border-color: var(--auth-danger);
}

.auth-form-operation .auth-btn {
  all: unset;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  background: var(--auth-primary);
  color: #fff;
  border-radius: var(--auth-radius);
  height: 3em;
  cursor: pointer;
  user-select: none;
  font-weight: bold;
  transition: all 0.3s;
}

.auth-form-operation .auth-btn:disabled,
.auth-form-operation .auth-btn:hover {
  opacity: 0.8;
}
.auth-form-operation .auth-btn:active {
  transform: scale(0.96);
}
.auth-form-operation .auth-btn:disabled {
  pointer-events: none;
}

.auth-form-operation .auth-btn:disabled::after {
  content: "";
  display: block;
  width: 1.1em;
  height: 1.1em;
  border: 0.15em solid #fff;
  border-top-color: var(--auth-primary);
  border-radius: 50%;
  animation: auth-loading-spinner 0.8s linear infinite;
  margin-left: 0.8em;
}

@keyframes auth-loading-spinner {
  100% {
    transform: rotate(360deg);
  }
}

.previous-step {
  position: absolute;
  right: var(--auth-padd);
  top: 1.5em;
  cursor: pointer;
  line-height: 1;
  vertical-align: middle;
  display: flex;
}

.previous-step svg {
  width: 1.5em;
  height: 1.5em;
  fill: #3f4064;
}

.resend_code_wrapper {
  margin-top: 1em;
}

.resend-code {
  text-align: center;
  display: flex;
  font-size: 0.9em;
  color: var(--auth-primary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  width: max-content;
  margin: 0 auto;
  user-select: none;
}

.resend-code::after {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  border-top: 0.15em solid var(--auth-primary);
  border-left: 0.15em solid var(--auth-primary);
  transform: rotate(135deg);
  /* -webkit-transform: rotate(-45deg); */
  margin-left: 0.5em;
}

.resend-code.disable {
  pointer-events: none;
  font-size: 0.85em;
  color: #3f4064;
}

.resend-code.disable::after {
  display: none;
}

#websima-auth-modal .alert {
  all: unset;
  font-size: 0.86em !important;
  position: fixed;
  top: 0.4em;
  left: 50%;
  width: max-content;
  max-width: 95%;
  transform: translateX(-50%);
  padding: 1em;
  z-index: 4;
  box-sizing: border-box;
  border-radius: var(--auth-radius);
  display: flex;
  text-align: center;
  align-items: center;
  justify-content: center;
  font-weight: 400;
  color: #fff !important;
}

#websima-auth-modal .bg-danger {
  background: var(--auth-danger) !important;
}

#websima-auth-modal .bg-success {
  background: var(--auth-success) !important;
}

#websima-auth-modal .bg-primary {
  background: var(--auth-info) !important;
}

@media (min-width: 576px) {
  #websima-auth-modal {
    font-size: 16px; /* This size affects everything, be careful. */
  }

  :root {
    --auth-padd: 3em;
  }
}
