<template>
  <div class="account">
    <div class="account-container">
      <div class="account-wrap-logo">
        <img src="@/assets/images/login/comnova-EYES2.png" alt="" />
      </div>
      <div class="content-detail">
        <div class="account-wrap-login">
          <div class="login-pic">
            <div>
              <img src="~@/assets/images/login/login-pic.png" alt="" />
            </div>
          </div>
          <div>
            <img src="~@/assets/images/login/login-Yubei-admin.png" alt="" style="width: 360px" />
            <div class="login-form">
              <div class="login-form-container">
                <!-- <div class="account-top"> 欢迎您进入<br />安全管控开放平台 </div> -->
                <LoginForm
                  v-if="tab === 'login'"
                  ref="LoginFormRef"
                  @go-register="changeGoRegister"
                />
                <RegisterForm v-else ref="RegisterFormRef" @back-login="changeBackLogin" />
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup>
  import { ref } from 'vue';
  import LoginForm from './LoginForm2.vue';
  import RegisterForm from './RegisterForm2.vue';

  const tab = ref('login');

  function changeBackLogin() {
    tab.value = 'login';
  }

  function changeGoRegister() {
    tab.value = 'register';
  }
</script>

<style lang="scss" scoped>
  .account {
    width: 100%;
    margin: 0 auto;

    &-container {
      width: 100%;
      min-height: 100vh;
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-start;
      flex-direction: column;
      align-content: center;
      padding: 15px;
      background: #fff;
      // background: -webkit-linear-gradient(-135deg, #c850c0, #4158d0);
      // background: -o-linear-gradient(-135deg, #c850c0, #4158d0);
      // background: -moz-linear-gradient(-135deg, #c850c0, #4158d0);
      // background: linear-gradient(-135deg, #c850c0, #4158d0);
    }

    &-wrap-logo {
      width: 1280px;
      margin-top: 30px;
      @media (max-width: 1280px) {
        width: 100%;
      }
      img {
        @media (max-width: 450px) {
          width: 100px;
        }
      }
    }
    &-wrap-login {
      width: 1280px;
      height: 554px;
      background: #fff;
      // border-radius: 10px;
      overflow: hidden;
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      padding: 30px 95px 33px 95px;
      .login-pic {
        display: flex;

        @media (max-width: 1020px) {
          display: none;
        }
        img {
          max-width: 100%;
        }
      }

      @media (max-width: 1280px) {
        width: 100%;
        padding: 30px 0px 33px 0px;
        justify-content: center;
      }

      .login-form {
        width: 350px;
        margin: auto;
        margin-top: 20px;
        @media (max-width: 1020px) {
          width: min(100%, 350px);
        }

        &-container {
          display: flex;
          flex-direction: column;
          img {
            padding: 40px;
            // @media (max-width: 400px) {
            //   padding: 25px;
            // }
          }
        }
      }
    }

    // @media (max-width: 640px) {
    //   &-wrap-login {
    //     width: 100%;
    //     padding: 30px;
    //     height: auto;
    //   }
    // }
  }

  .content-detail {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
  }
</style>
