<template>
  <div class="loginPage">
    <section class="mobileMain" v-if="$isMobile">
      <header class="headerBox">
        <img
          @click="handelJump(`/`)"
          src="../../assets/mobile/login/LOGO.svg"
          alt="logo"
          loading="lazy"
        />
        <span class="title">{{ $t(`home.MLogin`) }}</span>
        <span></span>
      </header>
      <div class="imgTop">
        <img
          src="../../assets/mobile/login/logointop.svg"
          alt="Login for mining"
          loading="lazy"
        />
      </div>
      <section class="formInput">
        <el-form
          :model="loginForm"
          status-icon
          :rules="loginRules"
          ref="ruleForm"
          class="demo-ruleForm"
        >
          <el-form-item prop="userName">
            <el-input
              prefix-icon="el-icon-user"
              v-model="loginForm.userName"
              @input="handleEmailInput($event)"
              autocomplete="off"
              :placeholder="$t('user.Account')"
            ></el-input>
          </el-form-item>
          <el-form-item prop="password">
            <el-input
              type="password"
              v-model="loginForm.password"
              @input="handlePasswordInput($event)"
              prefix-icon="el-icon-unlock"
              autocomplete="off"
              showPassword
              :placeholder="$t('user.password')"
            ></el-input>
          </el-form-item>
          <el-form-item prop="code">
            <div class="verificationCode">
              <el-input
                type="text"
                prefix-icon="el-icon-chat-line-square"
                v-model="loginForm.code"
                @input="handleCodeInput($event)"
                autocomplete="off"
                :placeholder="$t(`user.verificationCode`)"
              ></el-input>
              <el-button
                class="codeBtn"
                :disabled="btnDisabled"
                @click="handelCode"
                ><span v-if="countDownTime < 60 && countDownTime > 0">{{
                  countDownTime
                }}</span>
                {{ $t(bthText) }}</el-button
              >
            </div>
          </el-form-item>

          <div class="registerBox">
            <span class="noAccount">{{ $t("user.noAccount") }}</span>
            <span style="color: #661fff" @click="handelJump(`register`)">{{
              $t("user.register")
            }}</span>
            <span
              style="color: #661fff"
              class="forget"
              @click="handelJump(`resetPassword`)"
              >{{ $t("user.forgotPassword") }}</span
            >
          </div>
          <el-form-item>
            <el-button
              style="
                width: 100%;
                background: #661fff;
                color: aliceblue;
                margin-top: 6%;
              "
              :loading="loginLoading"
              @click="submitForm('ruleForm')"
              >{{ $t("user.login") }}</el-button
            >
            <div style="text-align: left">
              <el-radio @input="handelRadio" v-model="radio" label="zh"
                >简体中文</el-radio
              >
              <el-radio @input="handelRadio" v-model="radio" label="en"
                >English</el-radio
              >
            </div>
          </el-form-item>
        </el-form>
      </section>
    </section>

    <section class="loginModular" v-else>
      <div class="leftBox">
        <img
          class="logo"
          src="../../assets/img/WILOGO.png"
          alt="logo"
          @click="handleClick"
        />
        <img src="../../assets/img/logicon.png" alt="Login for mining" />
      </div>

      <div class="loginBox">
        <div class="closeBox" @click="handleClick">
          <i class="iconfont icon-guanbi1 close"></i>
        </div>

        <el-form
          :model="loginForm"
          status-icon
          :rules="loginRules"
          ref="ruleForm"
          class="demo-ruleForm"
        >
          <el-form-item>
            <p class="loginTitle">{{ $t(`user.login`) }}</p>
          </el-form-item>
          <el-form-item prop="userName">
            <el-input
              prefix-icon="el-icon-user"
              v-model="loginForm.userName"
              @input="handleEmailInput($event)"
              autocomplete="off"
              :placeholder="$t('user.Account')"
              type="email"
            ></el-input>
          </el-form-item>
          <el-form-item prop="password">
            <el-input
              type="password"
              v-model="loginForm.password"
              @input="handlePasswordInput($event)"
              prefix-icon="el-icon-unlock"
              autocomplete="off"
              showPassword
              :placeholder="$t('user.password')"
            ></el-input>
          </el-form-item>
          <el-form-item prop="code">
            <div class="verificationCode">
              <el-input
                type="text"
                prefix-icon="el-icon-chat-line-square"
                v-model="loginForm.code"
                @input="handleCodeInput($event)"
                autocomplete="off"
                :placeholder="$t(`user.verificationCode`)"
              ></el-input>
              <el-button
                class="codeBtn"
                :disabled="btnDisabled"
                @click="handelCode"
                ><span v-if="countDownTime < 60 && countDownTime > 0">{{
                  countDownTime
                }}</span>
                {{ $t(bthText) }}</el-button
              >
            </div>
          </el-form-item>

          <div class="registerBox">
            <span class="noAccount">{{ $t("user.noAccount") }}</span>
            <span style="cursor: pointer" @click="handelJump(`/register`)">{{
              $t("user.register")
            }}</span>
            <span class="forget" @click="handelJump(`/resetPassword`)">{{
              $t("user.forgotPassword")
            }}</span>
          </div>
          <el-form-item>
            <el-button
              style="
                width: 100%;
                background: #661fff;
                color: aliceblue;
                margin-top: 6%;
              "
              :loading="loginLoading"
              @click="submitForm('ruleForm')"
              >{{ $t("user.login") }}</el-button
            >
            <div style="text-align: left">
              <el-radio @input="handelRadio" v-model="radio" label="zh"
                >简体中文</el-radio
              >
              <el-radio @input="handelRadio" v-model="radio" label="en"
                >English</el-radio
              >
            </div>
          </el-form-item>
        </el-form>
      </div>
    </section>
  </div>
</template>

<script>
import {
  getLogin,
  getLoginCode,
  getAccountGradeList,
  getUserProfile,
} from "../../api/login";
import { encryption } from "../../utils/fun";
import { getAccountList } from "../../api/personalCenter";
import { validatePassword, formatPasswordErrors } from "../../utils/passwordValidator";


export default {
  data() {
    return {
      loginForm: {
        userName: "",
        password: "",
        code: "",
      },
      loginRules: {
        userName: [
          {
            required: true,
            trigger: "blur",
            message: this.$t(`user.inputEmail`),
            // type: "email",
          },
        ],
        password: [
          {
            required: true,
            trigger: "blur",
            message: this.$t(`user.inputPassword`),
          },
        ],
        code: [
          {
            required: true,
            trigger: "change",
            message: this.$t(`user.inputCode`),
          },
        ],
      },
      radio: `en`,
      btnDisabled: false,
      bthText: "user.obtainVerificationCode",
      time: "",
      loginLoading: false,
      accountList: [],
      loginCodeTime: "",
      countDownTime: 60,
      timer: null,
      lang: "en",
      currencyList: [
                {
                    path: "nexaAccess",
                    value: "nexa",
                    label: "nexa",
                    img: require("../../assets/img/currency-nexa.png"),
                    imgUrl: `${this.$baseApi}img/nexa.png`,
                    name: "course.NEXAcourse",
                    show: true,
                    amount: 10000,

                },
                {
                    path: "grsAccess",
                    value: "grs",
                    label: "grs",
                    img: require("../../assets/img/currency/grs.svg"),
                    imgUrl: `${this.$baseApi}img/grs.svg`,
                    name: "course.GRScourse",
                    show: true,
                    amount: 1,

                },
                {
                    path: "monaAccess",
                    value: "mona",
                    label: "mona",
                    img: require("../../assets/img/currency/mona.svg"),
                    imgUrl: `${this.$baseApi}img/mona.svg`,
                    name: "course.MONAcourse",
                    show: true,
                    amount: 1,

                },
                {
                    path: "dgbsAccess",
                    value: "dgbs",
                    // label: "dgb-skein-pool1",
                    label: "dgb(skein)",
                    img: require("../../assets/img/currency/DGB.svg"),
                    imgUrl: `${this.$baseApi}img/dgb.svg`,
                    name: "course.dgbsCourse",
                    show: true,
                    amount: 1,
                },
                {
                    path: "dgbqAccess",
                    value: "dgbq",
                    // label: "dgb(qubit-pool1)",
                    label: "dgb(qubit)",
                    img: require("../../assets/img/currency/DGB.svg"),
                    imgUrl: `${this.$baseApi}img/dgb.svg`,
                    name: "course.dgbqCourse",
                    show: true,
                    amount: 1,
                },
                {
                    path: "dgboAccess",
                    value: "dgbo",
                    // label: "dgb-odocrypt-pool1",
                    label: "dgb(odocrypt)",
                    img: require("../../assets/img/currency/DGB.svg"),
                    imgUrl: `${this.$baseApi}img/dgb.svg`,
                    name: "course.dgboCourse",
                    show: true,
                    amount: 1,
                },
                {
                    path: "rxdAccess",
                    value: "rxd",
                    label: "radiant(rxd)",
                    img: require("../../assets/img/currency/rxd.png"),
                    imgUrl: `${this.$baseApi}img/rxd.png`,
                    name: "course.RXDcourse",
                    show: true,
                    amount: 100,

                },
                // {
                //     path: "enxAccess",
                //     value: "enx",
                //     label: "Entropyx(enx)",
                //     img: require("../../assets/img/currency/enx.svg"),
                //     imgUrl: `${this.$baseApi}img/enx.svg`,
                //     name: "course.ENXcourse",
                //     show: true,
                //     amount: 5000,

                // },
                {
                    path: "alphminingPool",
                    value: "alph",
                    label: "alephium",
                    img: require("../../assets/img/currency/alph.svg"),
                    imgUrl: `${this.$baseApi}img/alph.svg`,
                    name: "course.alphCourse",
                    show: true,
                    amount: 1,

                },
                {
                    path: "xmr",
                    value: "monero",
                    label: "xmr",
                    img: require("../../assets/img/currency/xmr.png"),
                    imgUrl: `${this.$baseApi}img/xmr.png`,
                    name: "course.xmrCourse",
                    show: true,
                    amount: 1,

                },
                {
                    path: "xtm",
                    value: "sha3x",
                    label: "xtm(sha3x)",
                    img: require("../../assets/img/currency/xtm.svg"),
                    imgUrl: `${this.$baseApi}img/xtm.svg`,
                    name: "course.xmrCourse",
                    show: true,
                    amount: 10000,

                },
            
                // { //告知已删除此币种  Radiant
                //     value: "dgb2_odo",
                //     label: "dgb-odocrypt-pool2",
                //     img: require("../../assets/img/currency/DGB.svg"),
                //     imgUrl: "https://s2.coinmarketcap.com/static/img/coins/64x64/109.png",
                // },
                // {
                //     value: "dgb_qubit_a10",
                //     label: "dgb-qubit-pool2",
                //     img: require("../../assets/img/currency/DGB.svg"),
                //     imgUrl: "https://s2.coinmarketcap.com/static/img/coins/64x64/109.png",
                // },
                // {
                //     value: "dgb_skein_a10",
                //     label: "dgb-skein-pool2",
                //     img: require("../../assets/img/currency/DGB.svg"),
                //     imgUrl: "https://s2.coinmarketcap.com/static/img/coins/64x64/109.png",
                // },
                // {
                //     value: "dgb_odo_b20",
                //     label: "dgb-odoscrypt-pool3",
                //     img: require("../../assets/img/currency/DGB.svg"),
                //     imgUrl: "https://s2.coinmarketcap.com/static/img/coins/64x64/109.png",
                // },

            ],
    };
  },

  computed: {
    countDown() {
      const minutes = Math.floor(this.countDownTime / 60);
      const seconds = this.countDownTime % 60;
      const m = minutes < 10 ? "0" + minutes : minutes;
      const s = seconds < 10 ? "0" + seconds : seconds;
      return `${s}`;
    },
  },
  watch: {
    '$route'(to) {
      // 路由变化时自动同步语言和radio
      const match = to.path.match(/^\/(zh|en)(\/|$)/);
      if (match) {
        this.radio = match[1];
        this.lang = match[1];
        this.$i18n.locale = match[1];
        localStorage.setItem("lang", match[1]);
      }
    },
    "$i18n.locale": function () {
      this.translate();
    },
  },

  created() {
    if (window.sessionStorage.getItem("exam_time")) {
      this.countDownTime = Number(window.sessionStorage.getItem("exam_time"));
      this.startCountDown();
      this.btnDisabled = true;
      this.bthText = `user.again`;
    }
    // if (window.sessionStorage.getItem("exam_time") == null){
    //   this.startCountDown()
    // }else{
    //   this.countDownTime = Number(window.sessionStorage.getItem("exam_time"));
    //   this.startCountDown()
    // }
  },
  mounted() {
    this.$addStorageEvent(1, `currencyList`, JSON.stringify(this.currencyList))
    // this.lang = this.$i18n.locale; // 初始化语言值
    // this.radio = localStorage.getItem("lang")
    //   ? localStorage.getItem("lang")
    //   : "en";

 // 获取当前路由路径
 const path = this.$route.path;
  // 匹配 /zh/ 或 /en/ 作为语言前缀
  const match = path.match(/^\/(zh|en)(\/|$)/);
  if (match) {
    this.radio = match[1];
    this.lang = match[1];
    this.$i18n.locale = match[1];
    localStorage.setItem("lang", match[1]);
  } else {
    // fallback 到 localStorage 或 "en"
    this.radio = localStorage.getItem("lang") || "en";
    this.lang = this.radio;
    this.$i18n.locale = this.radio;
  }



  },
  methods: {
    translate() {
      this.loginRules = {
        // type: "email",
        userName: [
          {
            required: true,
            trigger: "blur",
            message: this.$t(`user.inputEmail`),
          },
        ],
        password: [
          {
            required: true,
            trigger: "blur",
            message: this.$t(`user.inputPassword`),
          },
        ],
        code: [
          {
            required: true,
            trigger: "change",
            message: this.$t(`user.inputCode`),
          },
        ],
      };
    },
    //账户权限
    async fetchJurisdiction() {
      const data = await getUserProfile();

      this.$addStorageEvent(1, "jurisdiction", JSON.stringify(data.data.role));
      this.$addStorageEvent(1, "userEmail", JSON.stringify(data.data.email));
      if (data && data.code == 200) {
        this.$message({
          message: this.$t(`user.loginSuccess`),
          type: "success",
          showClose: true,
        });

        this.$router.push(`/${this.lang}`);
      }
    },
    async fetchAccountGradeList() {
      const data = await getAccountGradeList();
      if (data && data.code == 200) {
        this.$addStorageEvent(
          1,
          `miningAccountList`,
          JSON.stringify(data.data)
        );
      }
    },

    async fetchAccountList(params) {
      const data = await getAccountList(params);

      if (data && data.code == 200) {
        this.accountList = data.data;
        this.$addStorageEvent(
          1,
          `accountList`,
          JSON.stringify(this.accountList)
        );
      }
    },
    async fetchLogin(params) {
      this.loginLoading = true;
      const data = await getLogin(params);

      if (data && data.code === 200) {
        this.$addStorageEvent(1, "userName", data.data.userName);
        this.$addStorageEvent(
          1,
          "token",
          JSON.stringify(data.data.access_token)
        );

         
        // 等待一小段时间确保写入完成
        await new Promise(resolve => setTimeout(resolve, 50));
        // 登录成功后
        this.$bus.$emit('user-logged-in'); // 触发登录成功全局事件
        this.fetchAccountList();
        this.fetchAccountGradeList();
        this.fetchJurisdiction();
      }

      this.loginLoading = false;
    },
    async fetchCOde(params) {
      const data = await getLoginCode(params);
      if (data && data.code == 200) {
        this.$message({
          message: this.$t(`user.codeSuccess`),
          type: "success",
          showClose: true,
        });
      }
    },

    handelCode() {
      if (!this.loginForm.userName) {
        this.$message({
          message: this.$t(`user.inputAccount`),
          type: "error",
          customClass: "messageClass",
          showClose: true,
        });
        return;
      }

      //邮箱格式验证 /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
      const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}$/;

      let isMailbox = emailRegex.test(this.loginForm.userName);

      if (!this.loginForm.userName || !isMailbox) {
        this.$message({
          message: this.$t(`user.emailVerification`),
          type: "error",
          showClose: true,
        });

        return;
      }

      this.fetchCOde({ account: this.loginForm.userName });

      if (window.sessionStorage.getItem("exam_time") == null) {
        this.startCountDown();
      } else {
        this.countDownTime = Number(window.sessionStorage.getItem("exam_time"));
        this.startCountDown();
      }

      // this.time = 60;
      //   let timer = setInterval(()=>{
      //     if (this.time) {
      //       this.time--
      //       this.btnDisabled = true;
      //       // this.bthText=this.time+`s后重新获取`
      //       this.bthText=`user.again`
      //     }else {
      //       this.btnDisabled = false;
      //       this.bthText=`user.obtainVerificationCode`
      //       this.time = "";
      //       clearTimeout(timer)
      //     }
      //   },1000)
    },
    startCountDown() {
      this.timer = setInterval(() => {
        if (this.countDownTime <= 1) {
          //当监测到countDownTime为0时,清除计数器并且移除sessionStorage,然后执行提交试卷逻辑
          clearInterval(this.timer);
          sessionStorage.removeItem("exam_time");

          this.countDownTime = 60;
          this.btnDisabled = false;
          this.bthText = `user.obtainVerificationCode`;
        } else if (this.countDownTime > 0) {
          //每秒让countDownTime -1秒,并设置到sessionStorage中
          this.countDownTime--;
          this.btnDisabled = true;
          this.bthText = `user.again`;
          window.sessionStorage.setItem("exam_time", this.countDownTime);
        }
      }, 1000);
    },

    handelJump(url) {
      // 移除开头的斜杠
      const cleanPath = url.startsWith("/") ? url.slice(1) : url;
      this.$router.push(`/${this.lang}/${cleanPath}`);
    },
    handelRadio(val) {
      // 保存旧的语言值用于路径替换
      const oldLang = this.lang;

      // 更新语言设置
      this.lang = val;
      this.$i18n.locale = val;
      localStorage.setItem("lang", val);

      // 更新当前路由的语言部分
      const currentPath = this.$route.path;
      const newPath = currentPath.replace(`/${oldLang}`, `/${val}`);

      // 保持查询参数
      this.$router
        .push({
          path: newPath,
          query: this.$route.query,
        })
        .catch((err) => {
          if (err.name !== "NavigationDuplicated") {
            console.error("Navigation failed:", err);
          }
        });
    },
    submitForm() {
      this.$refs.ruleForm.validate((valid) => {
        if (valid) {
          //去空格
          this.loginForm.userName = this.loginForm.userName.trim();
          this.loginForm.password = this.loginForm.password.trim();
          //邮箱格式验证
          const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}$/;
          let isMailbox = emailRegex.test(this.loginForm.userName);
          if (!isMailbox) {
            this.$message({
              message: this.$t(`user.emailVerification`),
              type: "error",
              customClass: "messageClass",
              showClose: true,
            });

            return;
            // 用户名规则1.长度限制：3<=用户名<=16; 字符限制：仅允许使用字母、数字、下划线 用户名必须以字母开头
            // const regex = /^[a-zA-Z][a-zA-Z0-9_]{2,15}$/; // 正则表达式
            // const isValid = regex.test(this.loginForm.userName);
            // if (!isValid) {
            //   // 如果输入不符合要求，可以根据具体需求给出错误提示或进行其他处理
            //   this.$message({
            //     message: this.$t(`user.accountReminder`),
            //     type: "error",
            //     customClass: "messageClass",
            //     showClose: true
            //   });

            //   return;
            // }
          }

          // 密码验证 - 使用优化后的详细校验逻辑
          const validation = validatePassword(this.loginForm.password);
          if (!validation.valid) {
            // 生成友好的逐项错误提示
            const errorMessage = formatPasswordErrors(validation.errors, this.$t.bind(this));
            this.$message({
              message: errorMessage,
              type: "error",
              showClose: true,
              duration: 5000, // 延长显示时间,因为错误信息可能有多条
            });

            return;
          }

          //加密
          const form = { ...this.loginForm };
          form.password = encryption(this.loginForm.password);
          this.fetchLogin(form);
        }
      });
    },
    handleClick() {
      this.$router.push(`/${this.lang}`);
    },
    /**
     * 去除输入值中的空格
     * @param {string} value - 输入值
     * @returns {string} 去除空格后的值
     */
    removeSpaces(value) {
      if (typeof value === 'string') {
        return value.replace(/\s/g, '');
      }
      return value;
    },
    /**
     * 处理邮箱输入，自动去除空格
     * @param {string} value - 输入值
     */
    handleEmailInput(value) {
      this.loginForm.userName = this.removeSpaces(value);
    },
    /**
     * 处理密码输入，自动去除空格
     * @param {string} value - 输入值
     */
    handlePasswordInput(value) {
      this.loginForm.password = this.removeSpaces(value);
    },
    /**
     * 处理验证码输入，自动去除空格
     * @param {string} value - 输入值
     */
    handleCodeInput(value) {
      this.loginForm.code = this.removeSpaces(value);
    },
  },
};
</script>

<style scoped lang="scss">
.loginPage {
  width: 100%;
  height: 100%;
  background-color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 100px 0px;
  background-image: url(../../assets/img/logBg.png);
  background-size: cover;
  background-repeat: no-repeat;
  .loginModular {
    width: 50%;
    height: 85%;
    display: flex;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0px 0px 20px 18px #d6d2ea;
    // box-shadow: 0px 0px 20PX 30PX #000;
  }
  .leftBox {
    width: 47%;
    height: 100%;
    background-image: linear-gradient(150deg, #18b7e6 -20%, #651fff 60%);
    position: relative;
    .logo {
      position: absolute;
      left: 30px;
      top: 18px;
      width: 22%;
    }
    img {
      width: 100%;
      position: absolute;
      right: -16%;
      bottom: 0;
      z-index: 99;
    }
  }
}
.el-form {
  width: 90%;
  padding: 0px 20px 50px 20px;
}
.el-form-item {
  width: 100%;
}
.loginBox {
  width: 53%;
  // box-shadow: 0px 0px 5PX 1PX #ccc;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 10px;
  position: relative;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  position: relative;
  padding: 0px 35px;
  .demo-ruleForm {
    height: 100%;
    padding-top: 5%;
  }
  img {
    width: 18%;
    position: absolute;
    top: 20px;
    left: 30px;
    cursor: pointer;
  }
  .closeBox {
    position: absolute;
    top: 18px;
    right: 30px;
    cursor: pointer;
    .close {
      font-size: 1.3em;
    }
  }
  .closeBox:hover {
    color: #661fff;
  }
}
.loginTitle {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 30px;
  text-align: center;
}
.loginColor {
  width: 100%;
  height: 15px;
  background: #661fff;
}
.langBox {
  display: flex;
  justify-content: space-between;
  align-content: center;
}
.registerBox {
  display: flex;
  justify-content: start;
  margin: 0;
  font-size: 12px;
  height: 20px;

  span {
    padding: 5px 0px;
    display: inline-block;
    height: 100%;
    z-index: 99;
  }
  span:hover {
    color: #661fff;
  }
  .noAccount:hover {
    color: #000;
  }
  .forget {
    margin-left: 8px;
    cursor: pointer;
  }
}
.forget {
  margin-left: 10px;
}
.forgotPassword {
  display: inline-block;
  width: 20%;
}

.verificationCode {
  display: flex;
  .codeBtn {
    font-size: 13px;
    margin-left: 2px;
  }
}

// 手机端适配
@media screen and (min-width: 220px) and (max-width: 1279px) {
  .mobileMain {
    width: 100vw;
    min-height: 100vh;
    background: #fff;
    background-image: url("../../assets/mobile/login/bgtop.svg");
    background-repeat: no-repeat;
    background-size: 115%;
    background-position: 49% 47%;
  }

  .headerBox {
    width: 100%;
    height: 60px;
    // background: palegoldenrod;
    // border-bottom: 1px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0px 20px;
    box-shadow: 0px 0px 2px 1px #ccc;
    img {
      width: 30px;
    }
    .title {
      font-weight: 600;
    }
  }

  .imgTop {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 2%;
    img {
      height: 159px;
    }
  }

  .formInput {
    width: 100%;
    display: flex;
    justify-content: center;
  }
  .footer {
    width: 100%;
    height: 100px;
    background: #651fff;
  }
}
</style>