/* =========================================================
   KA EMPLOYEE PORTAL
   LOGIN PAGE
========================================================= */


/* =========================================================
   RESET
========================================================= */

* {
    margin: 0;
    padding: 0;

    box-sizing: border-box;
}


html,
body {
    width: 100%;
    min-height: 100%;
}


body {
    font-family:
        "Segoe UI",
        "Noto Sans Thai",
        Tahoma,
        Arial,
        sans-serif;

    background: #ffffff;

    color: #252525;
}



/* =========================================================
   MAIN PAGE
========================================================= */

.login-page {
    display: flex;

    width: 100%;

    height: 100vh;
    min-height: 100vh;

    overflow: hidden;

    background: #ffffff;
}



/* =========================================================
   LEFT BANNER
========================================================= */

.login-banner {
    position: relative;

    width: 60%;
    height: 100vh;

    flex: 0 0 60%;

    overflow: hidden;

    background:
        linear-gradient(
            135deg,
            #ed007f,
            #ff7fba
        );
}


/*
    รูป Banner จะเต็มพื้นที่ฝั่งซ้าย
    โดยไม่เหลือขอบขาว
*/

.banner-image {
    position: absolute;

    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;


    /*
       ปรับจุดโฟกัสของรูป

       38% = ขยับภาพไปทางซ้ายเล็กน้อย
       เพื่อไม่ให้ Logo KA ถูกตัด
    */

      object-position: left center;
}


/* =========================================================
   RIGHT LOGIN AREA
========================================================= */

.login-panel {
    width: 40%;
    height: 100vh;

    flex: 0 0 40%;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 40px;

    overflow-y: auto;

    background:

        radial-gradient(
            circle at top right,
            rgba(237, 0, 127, 0.04),
            transparent 35%
        ),

        #ffffff;
}



/* =========================================================
   LOGIN CARD
========================================================= */

.login-card {
    width: 100%;

    max-width: 460px;

    padding: 42px 36px;

    background: rgba(
        255,
        255,
        255,
        0.98
    );

    border-radius: 24px;

    border:
        1px solid
        rgba(0, 0, 0, 0.025);

    box-shadow:
        0 20px 60px
        rgba(30, 30, 30, 0.08);
}



/* =========================================================
   BRAND
========================================================= */

.brand {
    text-align: center;

    margin-bottom: 34px;
}


.brand-logo {
    width: 82px;
    height: 82px;

    object-fit: contain;

    border-radius: 18px;

    margin-bottom: 18px;
}


.brand h1 {
    margin-bottom: 8px;

    font-size: 29px;

    line-height: 1.25;

    font-weight: 700;

    color: #e6007e;

    letter-spacing: -0.4px;
}


.brand p {
    font-size: 15px;

    color: #686868;
}



/* =========================================================
   FORM
========================================================= */

.login-form {
    width: 100%;
}


.form-group {
    width: 100%;

    margin-bottom: 21px;
}


.form-group label {
    display: block;

    margin-bottom: 9px;

    font-size: 15px;

    font-weight: 600;

    color: #333333;
}



/* =========================================================
   NORMAL INPUT
========================================================= */

.form-group input {
    font-family: inherit;
}



/* =========================================================
   EMAIL
========================================================= */

.email-box {
    width: 100%;

    min-height: 52px;

    display: flex;

    align-items: center;

    background: #ffffff;

    border:
        1px solid
        #d7dae3;

    border-radius: 14px;

    overflow: hidden;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}


.email-box:focus-within {
    border-color: #e6007e;

    box-shadow:
        0 0 0 4px
        rgba(230, 0, 126, 0.09);
}


.email-box input {
    min-width: 0;

    flex: 1;

    height: 52px;

    padding:
        0
        15px;

    border: none;

    outline: none;

    background: transparent;

    font-size: 15px;

    color: #333333;
}


.email-box input::placeholder {
    color: #a0a0a0;
}


.email-domain {
    height: 34px;

    display: flex;

    align-items: center;

    padding:
        0
        13px;

    margin-right: 7px;

    border-radius: 8px;

    background: #fff1f7;

    color: #986075;

    font-size: 14px;

    white-space: nowrap;
}



/* =========================================================
   PASSWORD
========================================================= */

.password-box {
    position: relative;

    width: 100%;

    min-height: 52px;
}


.password-box input {
    width: 100%;
    height: 52px;

    padding:
        0
        50px
        0
        15px;

    border:
        1px solid
        #d7dae3;

    border-radius: 14px;

    outline: none;

    background: #ffffff;

    color: #333333;

    font-size: 15px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}


.password-box input:focus {
    border-color: #e6007e;

    box-shadow:
        0 0 0 4px
        rgba(230, 0, 126, 0.09);
}


.password-box input::placeholder {
    color: #a0a0a0;
}



/* =========================================================
   SHOW PASSWORD
========================================================= */

.password-toggle {
    position: absolute;

    top: 50%;
    right: 10px;

    transform: translateY(-50%);

    width: 38px;
    height: 38px;

    display: flex;

    align-items: center;
    justify-content: center;

    border: none;

    border-radius: 10px;

    background: transparent;

    cursor: pointer;

    font-size: 17px;
}


.password-toggle:hover {
    background: #fff1f7;
}



/* =========================================================
   LOGIN OPTIONS
========================================================= */

.form-options {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin:
        3px
        0
        25px;
}


.remember-device {
    display: flex;

    align-items: center;

    gap: 8px;

    cursor: pointer;

    user-select: none;

    font-size: 14px;

    color: #505050;
}


.remember-device input {
    width: 17px;
    height: 17px;

    accent-color: #e6007e;

    cursor: pointer;
}


.forgot-password {
    font-size: 14px;

    font-weight: 600;

    color: #e6007e;

    text-decoration: none;
}


.forgot-password:hover {
    text-decoration: underline;
}



/* =========================================================
   LOGIN BUTTON
========================================================= */

.login-button {
    width: 100%;

    min-height: 52px;

    padding:
        0
        20px;

    border: none;

    border-radius: 14px;

    background:
        linear-gradient(
            135deg,
            #f00086,
            #cf066e
        );

    color: #ffffff;

    font-family: inherit;

    font-size: 17px;

    font-weight: 700;

    cursor: pointer;

    box-shadow:
        0 9px 20px
        rgba(220, 0, 118, 0.16);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        opacity 0.2s ease;
}


.login-button:hover {
    transform: translateY(-2px);

    box-shadow:
        0 12px 25px
        rgba(220, 0, 118, 0.25);
}


.login-button:active {
    transform: translateY(0);
}



/* =========================================================
   FOOTER
========================================================= */

.login-footer {
    margin-top: 26px;

    text-align: center;
}


.login-footer p {
    font-size: 13px;

    color: #8c8c8c;
}



/* =========================================================
   NOTEBOOK / SMALL PC
========================================================= */

@media (max-width: 1200px) {

    .login-banner {
        width: 55%;

        flex-basis: 55%;
    }


    .login-panel {
        width: 45%;

        flex-basis: 45%;

        padding: 28px;
    }


    .login-card {
        padding:
            36px
            28px;
    }

}



/* =========================================================
   TABLET
========================================================= */

@media (max-width: 900px) {

    .login-page {
        display: block;

        height: auto;

        min-height: 100vh;

        overflow: visible;
    }


    /*
       Banner กลายเป็น Header
       บนมือถือ / Tablet
    */

    .login-banner {
        position: relative;

        width: 100%;
        height: 300px;

        min-height: 300px;

        flex: none;
    }


    .banner-image {
        object-fit: cover;

        /*
           Tablet / Mobile
           ให้ยึด Logo เป็นหลัก
        */

        object-position: 35% center;
    }


    .login-panel {
        width: 100%;
        height: auto;

        min-height:
            calc(
                100vh - 300px
            );

        flex: none;

        padding:
            30px
            20px
            45px;
    }


    .login-card {
        max-width: 520px;

        margin:
            -55px
            auto
            0;

        position: relative;

        z-index: 10;
    }

}



/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 600px) {

    .login-banner {
        height: 230px;

        min-height: 230px;
    }


    .banner-image {
        object-position: 36% center;
    }


    .login-panel {
        min-height:
            calc(
                100vh - 230px
            );

        padding:
            20px
            14px
            35px;
    }


    .login-card {
        margin-top: -35px;

        padding:
            30px
            21px;

        border-radius: 20px;
    }


    .brand {
        margin-bottom: 27px;
    }


    .brand-logo {
        width: 68px;
        height: 68px;
    }


    .brand h1 {
        font-size: 24px;
    }


    .brand p {
        font-size: 14px;
    }


    /*
       Email บนมือถือ
       ยังอยู่บรรทัดเดียว
    */

    .email-domain {
        padding:
            0
            8px;

        margin-right: 5px;

        font-size: 12px;
    }


    .email-box input {
        padding-left: 12px;

        font-size: 14px;
    }


    .form-options {
        align-items: flex-start;

        gap: 10px;
    }

}



/* =========================================================
   VERY SMALL MOBILE
========================================================= */

@media (max-width: 390px) {

    .login-card {
        padding:
            26px
            17px;
    }


    .email-domain {
        font-size: 11px;

        padding:
            0
            6px;
    }


    .remember-device,
    .forgot-password {
        font-size: 13px;
    }

}
/* =========================================================
   LOGIN MOTION V0.4.1
========================================================= */
.login-card { animation: loginCardEnter .72s cubic-bezier(.2,.85,.3,1.12) both; }
.brand-logo { animation: brandFloat 4.2s ease-in-out infinite; }
.login-button { position: relative; display: grid; place-items: center; overflow: hidden; }
.login-button:disabled { cursor: wait; opacity: .88; transform: none; }
.login-spinner {
    position: absolute;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    opacity: 0;
    animation: spin .72s linear infinite;
}
.login-button.loading .login-button-text { opacity: 0; }
.login-button.loading .login-spinner { opacity: 1; }
.login-button-text { transition: opacity .15s ease; }

@keyframes loginCardEnter {
    from { opacity: 0; transform: translateY(20px) scale(.975); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes brandFloat {
    0%,100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .login-card, .brand-logo { animation: none !important; }
}
