<script setup lang="ts">
definePageMeta({
  layout: false,
  name: "hadithaLogin",
});
useHead({
  title: `${import.meta.env.VITE_HADITH_PAGE_TITLE} | ورود`,
  meta: [
    { name: "description", content: "کاوش با هوش مصنوعی در احادیث اسلامی" },
    {
      name: "msapplication-TileImage",
      content: "/img/haditha/fav-icons/ms-icon-144x144.png",
    },
    { name: "theme-color", content: "#ffffff" },
  ],
  bodyAttrs: {
    class: import.meta.env.VITE_HADITH_SYSTEM,
  },
  link: [
    {
      rel: "icon",
      type: "image/x-icon",
      href: "/img/haditha/fav-icons/favicon.ico",
    },
    { rel: "manifest", href: "/img/haditha/fav-icons/manifest.json" },
    // rel: icon
    {
      rel: "icon",
      type: "image/png",
      sizes: "16x16",
      href: "/img/haditha/fav-icons/favicon-16x16.png",
    },
    {
      rel: "icon",
      type: "image/png",
      sizes: "32x32",
      href: "/img/haditha/fav-icons/favicon-32x32.png",
    },
    {
      rel: "icon",
      type: "image/png",
      sizes: "96x96",
      href: "/img/haditha/fav-icons/favicon-96x96.png",
    },
    {
      rel: "icon",
      sizes: "192x192",
      type: "image/png",
      href: "/img/haditha/fav-icons/android-icon-192x192.png",
    },
    // rel: apple
    {
      rel: "apple-touch-icon",
      sizes: "57x57",
      href: "/img/haditha/fav-icons/apple-icon-57x57.png",
    },
    {
      rel: "apple-touch-icon",
      sizes: "60x60",
      href: "/img/haditha/fav-icons/android-icon-60x60.png",
    },
    {
      rel: "apple-touch-icon",
      sizes: "72x72",
      href: "/img/haditha/fav-icons/android-icon-72x72.png",
    },
    {
      rel: "apple-touch-icon",
      sizes: "76x76",
      href: "/img/haditha/fav-icons/android-icon-76x76.png",
    },
    {
      rel: "apple-touch-icon",
      sizes: "114x114",
      href: "/img/haditha/fav-icons/android-icon-114x114.png",
    },
    {
      rel: "apple-touch-icon",
      sizes: "120x120",
      href: "/img/haditha/fav-icons/android-icon-120x120.png",
    },
    {
      rel: "apple-touch-icon",
      sizes: "144x144",
      href: "/img/haditha/fav-icons/android-icon-144x144.png",
    },
    {
      rel: "apple-touch-icon",
      sizes: "152x152",
      href: "/img/haditha/fav-icons/android-icon-152x152.png",
    },
    {
      rel: "apple-touch-icon",
      sizes: "180x180",
      href: "/img/haditha/fav-icons/android-icon-180x180.png",
    },
  ],
});

const stepOne = ref(true);

// components declaration
const HadithaLayout = defineAsyncComponent(
  () => import("@haditha/layouts/HadithaLayout.vue")
);
const NavigationMenu = defineAsyncComponent(
  () => import("@haditha/components/haditha/NavigationMenu.vue")
);
const EnterMobile = defineAsyncComponent(
  () => import("@haditha/components/haditha/login/EnterMobile.vue")
);
const EnterVerifyCode = defineAsyncComponent(
  () => import("@haditha/components/haditha/login/EnterVerifyCode.vue")
);
</script>

<template>
  <HadithaLayout>
    <div class="haditha-login-page h-full">
      <div class="page-container pt-20 h-full">
        <navigation-menu></navigation-menu>

        <UContainer
          ui="{
          base: 'sm:px-6 lg:px-4',
        }"
          class="page-inner-container sm:px-6 lg:px-4 h-full"
        >
          <div
            class="page-content flex flex-col items-center justify-center h-full"
          >
            <enter-mobile
              v-if="stepOne"
              @next-step="stepOne = !stepOne"
            ></enter-mobile>
            <enter-verify-code v-else></enter-verify-code>
          </div>
        </UContainer>
      </div>
    </div>
  </HadithaLayout>
</template>

<style scoped>
.haditha-login-page {
  background: #f7fffd;

  .page-container {
    .page-inner-container {
      margin: auto;
      /* max-width: 512px; */
      max-width: 300px;
      /* height: 125px; */
      gap: 24px;

      .title {
        margin-bottom: 1.2em;
        font-family: IRANSansX;
        font-weight: 400;
        font-size: 20px;
        line-height: 30px;
        letter-spacing: 0%;

        /* Fallback color */
        color: #4d00ff;

        /* Gradient background */
        background: linear-gradient(268.94deg, #d284ff -0.65%, #4d00ff 104.59%);

        /* Clip the background to the text */
        background-clip: text;
        -webkit-background-clip: text; /* For Safari */

        /* Make the text transparent */
        color: transparent;
        -webkit-text-fill-color: transparent; /* For Safari */
      }

      .description {
        font-family: IRANSansX;
        font-weight: 400;
        font-size: 14px;
        line-height: 21px;
        letter-spacing: 0%;
        color: #626b84;
        margin-bottom: 5em; /* 70px */
      }
    }
  }
}
</style>

<style>
.haditha-login-page {
  .page-container {
    .page-inner-container {
      .input-elem {
        input {
          width: 48;
          height: 53px;
          justify-content: space-between;
          border-radius: 12px;
          border-width: 0.3px;
          padding: 16px;
          background: #ffffff;
          border: 0.3px solid #d9d9d9;
          box-shadow: 0px 1px 4px 0px #0000000d;

          font-family: IRANSansX;
          font-weight: 400;
          font-size: 16px;
          line-height: 24px;
          letter-spacing: 0%;
          text-align: center;
          color: var(--ui-color-two);
        }
      }

      .submit-btn {
        width: 480;
        height: 48px;
        gap: 4px;
        padding-top: 9.1px;
        padding-right: 32px;
        padding-bottom: 9.1px;
        padding-left: 32px;
        border-radius: 12px;
        border-width: 0.3px;

        background: linear-gradient(102.02deg, #4be8ae 7.38%, #00a762 91.78%);
        border: 0.3px solid #d9d9d9;
        box-shadow: 0px 1px 4px 0px #0000000d;
      }

      .root-pin-input {
        direction: ltr;

        .base-pin-input {
          width: 56px;
          height: 53px;
          justify-content: space-between;
          border-radius: 12px;
          border-width: 0.3px;
          padding: 16px;

          border: 0.3px solid #d9d9d9;
          box-shadow: 0px 1px 4px 0px #0000000d;

          font-family: IRANSansX;
          font-weight: 400;
          font-size: 16px;
          line-height: 100%;
          letter-spacing: 0%;
          text-align: center;

          color: var(--ui-color-two);
        }
      }
    }
  }
}
</style>
