<template>
    <UiContainer class="flex py-20 sm:py-14">
        <div class="hidden xl:block rounded-2xl min-w-[60%] h-[830px]" :style="{
            backgroundImage: `url('/api/files/${component.image_collection}/${component.section_id}/${component.section_img[0]}?thumb=1200x0')`,
            backgroundSize: 'cover',
            backgroundPosition: 'center',
        }" />
        <div class="w-full sm:w-[80%] mx-auto my-auto xl:w-full xl:px-12 ">
            <div class="space-25-55">
                <div class="flex flex-wrap-reverse gap-y-4 justify-between">
                    <h2 class="h2-bold-bounded">{{ $t('login') }}</h2>
                    <button
                        class="h-[40px] sm:h-[43px] px-[10px] sm:px-[17px] border border-gray dark:border-button-disabled text-gray dark:text-button-disabled hover:bg-gray transition-all hover:text-white rounded-[8px] cursor-pointer">{{
                            $t('back_to_home') }}</button>
                </div>
                <div class="space-y-[15px]">
                    <p class="pl-6">{{ $t('email') }}</p>
                    <input v-model="store.email" :placeholder="$t('email')" type="text"
                        class="border-2 border-block placeholder:text-gray dark:placeholder:text-button-disabled text-bg-dark dark:text-bg-light rounded-lg px-6 h-[50px] sm:h-[67px] w-full focus:outline-none focus:ring-0 focus:border-2" />
                </div>
                <div class="space-y-[15px]">
                    <p class="pl-6">{{ $t('password') }}</p>
                    <input v-model="store.password" :placeholder="$t('placeholder_password')" type="text"
                        class="border-2 border-block placeholder:text-gray dark:placeholder:text-button-disabled text-bg-dark dark:text-bg-light rounded-lg px-6 h-[50px] sm:h-[67px] w-full focus:outline-none focus:ring-0 focus:border-2" />
                </div>
            </div>
            <p class="text-button hover:text-button-hover transition-all font-medium mt-[30px] cursor-pointer">{{
                $t('forgot_password_question')
                }}</p>
            <div class="py-[25px] sm:py-12 border-b border-gray flex justify-center w-full">
                <UiButtonArrow @click="store.logIn()" type="fill" :arrow="true">{{ $t('login') }}</UiButtonArrow>
            </div>
            <div class="mt-[25px] sm:mt-[30px] w-full flex justify-center gap-3">
                <p class="cursor-pointer hover:underline transition-all">{{
                    $t('no_account')
                    }}</p>
                <p class="text-button cursor-pointer hover:text-button-hover">{{
                    $t('sign_up_now')
                    }}</p>
            </div>
        </div>
    </UiContainer>
</template>

<script lang="ts" setup>
defineProps<{ component: Component }>();
type Component = {
    image_collection: string;
    section_id: string;
    section_img: string;
    section_lang_data: {};
};
const store = useStore()
</script>