<template>
    <div class="login" :style="{ backgroundImage: `url(${backgroundUrl})`}">

        <div class="login-container">
            <div class="row">
                <div class="col-md-12 tour-1">

                    <div class="logo-login" style="text-align: center">
                        <slot/>
                    </div>

                    <div class="login-initials">
                        <h2 style="text-align: center"><strong>{{ initialsSystem }}</strong></h2>
                    </div>

                    <div class="login-message">
                        <h3 style="text-align: center"><cite>{{ descriptionSystem }}</cite></h3>
                    </div>

                    <div class="hpanel hblue" style="border: unset">

                        <prime-tab-view class="login-tabview">
                            <prime-tab-panel header="Autenticação">

                                <div class="panel-heading hbuilt text-center font-bold">
                                    {{ $t('label.restrictedAccess') }}
                                </div>

                                <div class="panel-body">
                                    <form id="formLogin">

                                        <div class="form-group">
                                            <label class="control-label" for="inputLogin" style="text-align: left">
                                                {{ $t('label.authentication') }}
                                            </label>
                                            <input id="inputLogin"
                                                   type="text"
                                                   :placeholder="$t('label.authentication')"
                                                   v-model="user.login"
                                                   title="$t('label.typeAuthentication')"
                                                   name="inputLogin"
                                                   class="form-control"/>
                                        </div>

                                        <div class="form-group">
                                            <label class="control-label password" for="inputPassword">
                                                {{ $t('label.password') }}
                                            </label>

                                            <input id="inputPassword"
                                                   type="password"
                                                   :placeholder="$t('label.password')"
                                                   v-model="user.password"
                                                   title="$t('label.typePassword')"
                                                   name="inputPassword"
                                                   class="form-control"/>
                                        </div>

<!--                                        <div class="form-group">-->
                                            <prime-button class="btn-block" :label="$t('label.entry')" @click.prevent="entry"/>
<!--                                        </div>-->

<!--                                        <div class="form-group">-->
                                            <prime-button :label="$t('label.forgotPassword')"
                                                          class="forgot-password btn-block p-button-raised p-button-outlined p-button-label"/>
<!--                                        </div>-->

                                    </form>
                                </div>

                            </prime-tab-panel>
                        </prime-tab-view>
                    </div>

                    <div class="panel-footer">

                        <div class="text-center">
                            <strong>
                                {{ initialsCompany }} |
                            </strong>
                            {{ nameCompany }}
                            <br/>
                            {{ new Date().getFullYear() }} | {{ $t('label.allRigthsReserved') }}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import PrimeTabView from "primevue/tabview";
import PrimeTabPanel from "primevue/tabpanel";
import PrimeButton from "primevue/button";

export default {
    name: "Login",
    components: {PrimeTabView, PrimeTabPanel, PrimeButton},
    props: ["initialsSystem", "descriptionSystem", "captcha", "initialsCompany", "nameCompany", "backgroundUrl"],
    mounted() {

    },
    data() {
        return {
            user: {login: '', password: ''},
        }
    },
    methods: {
        entry() {
            this.$emit('onClickSignin', this.user.login, this.user.password)
        },
        forgot() {
            this.$emit('onClickForgot', this.user.login)
        }
    }
}
</script>

<style lang="scss">
.login {
    font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: #fff;
    font-size: 12px;
    color: #6a6c6f;
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100%;
    display: flex;
    align-content: center;
    justify-content: center;
    background-size: 100% 100%;
}

.login .login-container {
    width: 420px;
    margin: auto;
}

.login .hpanel .hbuilt.panel-heading {
    border-bottom: none;
}

.login .hpanel.panel-collapse > .panel-heading, .login .hpanel .hbuilt {
    background: #fff;
    border: 1px solid #e4e5e7 /*$white*/
;
    padding: 10px 10px;
    border-radius: 2px;
}

.login .hpanel .panel-body {
    background: #fff;
    border: 1px solid #e4e5e7;
    border-radius: 2px;
    padding: 20px;
    position: relative;
}

.login .form-group {
    margin-bottom: 15px;
}

.login .form-control {
    display: block;
    width: 100%;
    height: 34px;
    padding: 6px 12px;
    font-size: 14px;
    line-height: 1.42857143;
    color: #555;
    background-color: #fff;
    background-image: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
    -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
    -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
    transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}

.login label {
    display: inline-block;
    max-width: 100%;
    margin-bottom: 5px;
    font-weight: bold;
}

.login .hpanel > .panel-footer {
    color: inherit;
    border: 1px solid #e4e5e7;
    border-top: none;
    font-size: 90%;
    background: #f7f9fa;
    padding: 10px 15px;
}

.login .panel-footer {
    padding: 10px 15px;
    background-color: #f5f5f5;
    border-top: 1px solid #ddd;
    border-bottom-right-radius: 3px;
    border-bottom-left-radius: 3px;
}

.login .hpanel > .panel-footer {
    color: inherit;
    border: 1px solid #e4e5e7;
    border-top: none;
    font-size: 90%;
    background: #f7f9fa;
}

.login .text-center {
    text-align: center;
}

.login .btn {
    display: inline-block;
    padding: 6px 12px;
    margin-bottom: 0;
    font-size: 14px;
    font-weight: normal;
    line-height: 1.42857143;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    -ms-touch-action: manipulation;
    touch-action: manipulation;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    background-image: none;
    border: 1px solid transparent;
    border-radius: 4px;
}

.login .btn-info {
    background-color: #3498db;
    border-color: #3498db;
    color: #FFFFFF;
}

.login .btn-block {
    display: block;
    width: 100%;
}

.login .btn:focus, .login .btn:hover {
    color: #FFFFFF;
    text-decoration: none;

    background-color: #3498db;
    border-color: #3498db;
    color: #FFFFFFEE;

}

.login a:hover, .login a:focus {
    color: #34495e;
    text-decoration: none;
}

.login a:hover, .login a:focus {
    color: #2a6496;
    text-decoration: underline;
}

.login a:active, .login a:hover {
    outline: 0;
}

.login .forgot-password {
    display: block;
    text-align: center;
}

.login h2, .h2 {
    font-size: 30px;
}

.login h3, .h3 {
    font-size: 24px;
}

.login h1, .h1, h2, .h2, h3, .h3 {
    margin-top: 10px;
    margin-bottom: 10px;
    font-weight: 200;
}

.login .nav-tabs {
    border-bottom: 1px solid #e4e5e7;
}

.login .nav-tabs {
    border-bottom: 1px solid #ddd;
}

.login .nav {
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}

.login nav-tabs > li {
    float: left;
    margin-bottom: -1px;
}

.login .nav > li {
    position: relative;
    display: block;
}

.login div ul li {
    font-size: 12px !important;
}

.login .login-tabview > .p-tabview-panels {
    background: #ffffff;
    padding: 0;
    border: 0 none;
    border-bottom-right-radius: 4px;
    border-bottom-left-radius: 4px;
    color: #6a6c6f;
    font-size: 13px;
    font-weight: unset;
}

.login {
    margin-bottom: 10px;
}

.login .btn-block {
    margin-top: 5px;
}

.login .btn {
    height: 30px;
}

//.login .btn-default {
//    background-color: #fff;
//    border-color: #e4e5e7;
//    color: #6a6c6f;
//}
</style>
