﻿/* ==========================================
   RESET
========================================== */

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
}


/* ==========================================
   BACKGROUND
========================================== */

body {
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    background-image: linear-gradient( rgba(2, 20, 45, 0.48), rgba(2, 20, 45, 0.48) ), url('/image/login.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    overflow-x: hidden;
}


/* ==========================================
   LOGIN PAGE
========================================== */

.login-page {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: hidden;
}


/* ==========================================
   LOGIN CARD
========================================== */

.login-card {
    width: 100%;
    max-width: 310px;
    background: rgba(255, 255, 255, 0.97);
    padding: 22px 24px;
    border-radius: 15px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
    /* الحركة */
    animation: moveLoginBox 12s ease-in-out infinite alternate;
    will-change: transform;
}


/* ==========================================
   LOGIN CARD MOVEMENT
========================================== */

@keyframes moveLoginBox {
    /* Left */
    0% {
        transform: translateX(-250px);
    }
    /* Center */
    50% {
        transform: translateX(0);
    }
    /* Right */
    100% {
        transform: translateX(250px);
    }
}


/* ==========================================
   PAUSE MOVEMENT WHEN MOUSE IS OVER CARD
========================================== */

.login-card:hover,
.login-card:focus-within {
    animation-play-state: paused;
}


/* ==========================================
   LOGO
========================================== */

.logo {
    width: 45px;
    height: 45px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #eaf2ff;
    color: #0d6efd;
    font-size: 22px;
}


/* ==========================================
   TITLE
========================================== */

.login-card h2 {
    margin: 0;
    text-align: center;
    color: #172033;
    font-size: 20px;
    font-weight: 700;
}


.subtitle {
    margin-top: 4px;
    margin-bottom: 20px;
    text-align: center;
    color: #64748b;
    font-size: 11px;
}


/* ==========================================
   FORM
========================================== */

.form-group {
    margin-bottom: 13px;
}


.form-label {
    margin-bottom: 5px;
    color: #172033;
    font-size: 11px;
    font-weight: 700;
}


.form-control {
    width: 100%;
    height: 38px;
    padding: 7px 11px;
    border: 1px solid #d7dee8;
    border-radius: 8px;
    font-size: 11px;
    background: white;
}


    .form-control::placeholder {
        color: #8b95a5;
    }


    .form-control:focus {
        border-color: #0d6efd;
        box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.10);
        outline: none;
    }


/* ==========================================
   PASSWORD
========================================== */

.password-wrapper {
    position: relative;
}


    .password-wrapper .form-control {
        padding-right: 38px;
    }


.toggle-password {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #64748b;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
}


    .toggle-password:hover {
        color: #0d6efd;
    }


/* ==========================================
   VALIDATION
========================================== */

.validation-message {
    display: block;
    margin-top: 3px;
    font-size: 10px;
}


/* ==========================================
   REMEMBER ME
========================================== */

.remember-me {
    margin-top: 4px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    min-height: 20px;
}


    .remember-me .form-check-input {
        width: 15px;
        height: 15px;
        margin-top: 0;
        cursor: pointer;
    }


    .remember-me .form-check-label {
        margin-left: 6px;
        font-size: 11px;
        color: #172033;
        cursor: pointer;
    }


/* ==========================================
   LOGIN BUTTON
========================================== */

.login-button {
    width: 100%;
    height: 38px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}


    .login-button:hover {
        transform: translateY(-1px);
    }


/* ==========================================
   DIVIDER
========================================== */

.login-divider {
    height: 1px;
    margin: 17px 0;
    background: #e2e8f0;
}


/* ==========================================
   REGISTER
========================================== */

.register-box {
    text-align: center;
}


    .register-box p {
        margin: 0 0 5px;
        color: #64748b;
        font-size: 10px;
    }


    .register-box a {
        color: #0d6efd;
        text-decoration: none;
        font-size: 11px;
        font-weight: 700;
    }


        .register-box a:hover {
            text-decoration: underline;
        }


/* ==========================================
   SUCCESS MESSAGE
========================================== */

.alert-success {
    font-size: 11px;
    border-radius: 8px;
    margin-bottom: 13px;
}


/* ==========================================
   TABLET
========================================== */

@media (max-width: 1000px) {

    @keyframes moveLoginBox {

        0% {
            transform: translateX(-120px);
        }

        50% {
            transform: translateX(0);
        }

        100% {
            transform: translateX(120px);
        }
    }
}


/* ==========================================
   MOBILE
========================================== */

@media (max-width: 768px) {

    body {
        background-attachment: scroll;
    }


    .login-page {
        padding: 15px;
    }


    .login-card {
        max-width: 300px;
        /*
           Stop movement on mobile
           so the card stays inside screen.
        */
        animation: none;
        transform: none;
    }
}


/* ==========================================
   SMALL MOBILE
========================================== */

@media (max-width: 576px) {

    .login-page {
        padding: 12px;
    }


    .login-card {
        width: 90%;
        max-width: 290px;
        padding: 19px 20px;
        border-radius: 14px;
    }


    .logo {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }


    .login-card h2 {
        font-size: 18px;
    }


    .subtitle {
        font-size: 10px;
        margin-bottom: 17px;
    }


    .form-control {
        height: 37px;
        font-size: 11px;
    }


    .login-button {
        height: 37px;
    }
}


/* ==========================================
   VERY SMALL MOBILE
========================================== */

@media (max-width: 360px) {

    .login-card {
        width: 94%;
        padding: 17px;
    }
}


/* ==========================================
   ACCESSIBILITY
   Stop animation if user disables animations
========================================== */

@media (prefers-reduced-motion: reduce) {

    .login-card {
        animation: none;
        transform: none;
    }
}

.forgot-password-link {
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    color: #0d6efd;
}

    .forgot-password-link:hover {
        text-decoration: underline;
    }

.password-wrapper {
    position: relative;
}

    .password-wrapper .form-control {
        padding-right: 50px;
    }

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #718096;
    font-size: 20px;
    cursor: pointer;
}

    .password-toggle:hover {
        color: #0d6efd;
    }