@import url('https://fonts.googleapis.com/css?family=Montserrat:400,800');

* {
    box-sizing: border-box;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    font-family: 'Montserrat', sans-serif;
    height: 100vh;
}

h1 {
    font-weight: bold;
    margin: 0px;
}

h3 {
    font-weight: bold;
    margin: 0px;
    margin-bottom: 10px;
    background-image: linear-gradient(to right, #7ba6f6, #3969a1);
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
}

h2 {
    text-align: center;
}

p {
    font-size: 14px;
    font-weight: 100;
    line-height: 20px;
    letter-spacing: 0.5px;
    margin: 20px 0 30px;
}

span {
    font-size: 12px;
}

a {
    color: #333;
    font-size: 14px;
    text-decoration: none;
    margin: 15px 0;
}

button {
    border-radius: 5px;
    border: 1px solid #FF4B2B;
    background-color: #FF4B2B;
    color: #ffffff;
    font-size: 12px;
    font-weight: bold;
    padding: 12px 45px;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: transform 80ms ease-in;
}

button:active {
    transform: scale(0.95);
}

button:focus {
    outline: none;
}

button.ghost {
    background-color: transparent;
    border-color: #ffffff;
}

form {
    background-color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    height: 100%;
    text-align: center;
}

.container {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
    position: relative;
    overflow: hidden;
    width: 768px;
    max-width: 100%;
    min-height: 80%;
}

.form-container {
    position: absolute;
    top: 0;
    height: 100%;
    transition: all 0.6s ease-in-out;
    overflow-y: auto;
}


.sign-in-container {
    left: 0;
    width: 50%;
    z-index: 2;
}

.container.right-panel-active .sign-in-container {
    transform: translateX(100%);
}

.sign-up-container {
    left: 0;
    width: 50%;
    opacity: 0;
    z-index: 1;
}

.container.right-panel-active .sign-up-container {
    transform: translateX(100%);
    opacity: 1;
    z-index: 5;
    animation: show 0.6s;
}

@keyframes show {
    0%,
    49.99% {
        opacity: 0;
        z-index: 1;
    }

    50%,
    100% {
        opacity: 1;
        z-index: 5;
    }
}

.overlay-container {
    position: absolute;
    top: 0;
    left: 50%;
    width: 50%;
    height: 100%;
    overflow: hidden;
    transition: transform 0.6s ease-in-out;
    z-index: 100;
}

.container.right-panel-active .overlay-container {
    transform: translateX(-100%);
}

.overlay {
    background: #3946a1;
    background: -webkit-linear-gradient(to right, #7bc3f6, #3946a1);
    background: linear-gradient(to right, #7bc3f6, #3946a1);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: 0 0;
    color: #FFFFFF;
    position: relative;
    left: -100%;
    height: 100%;
    width: 200%;
    transform: translateX(0);
    transition: transform 0.6s ease-in-out;
}

.container.right-panel-active .overlay {
    transform: translateX(50%);
}

.overlay-panel {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    top: 0;
    height: 100%;
    width: 50%;
    transform: translateX(0);
    transition: transform 0.6s ease-in-out;
}

.overlay-left {
    transform: translateX(-20%);
}

.container.right-panel-active .overlay-left {
    transform: translateX(0);
}

.overlay-right {
    right: 0;
    transform: translateX(0);
}

.container.right-panel-active .overlay-right {
    transform: translateX(20%);
}

.social-container {
    margin: 20px 0;
}

.social-container a {
    border: 1px solid #DDDDDD;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin: 0 5px;
    height: 40px;
    width: 40px;
}

.my_form-control {
    width: 100%;
    margin: 10px;
    padding: 5px;
    border: none;
    border-bottom: 1pt solid #bfbfbf;
    transition: all 200ms ease-in-out;
}

.form-group {
    position: relative;
}

label {
    width: 100%;
}

.my_place {
    position: absolute;
    pointer-events: none;
    top: 25px;
    left: 5px;
    color: #0073ff;
    transition: 0.2s ease all;
}

.my_form-control:focus {
    width: 100%;
    border: none;
    border-bottom: 2px solid #0073ff;
    outline: none;
}

input:focus ~ .my_place,
input:not(:focus):valid ~ .my_place {
    top: -6px;
}

.btn {
    border-radius: 5px;
    box-shadow: 0 3px 4px #8abfff;
    background-image: linear-gradient(to right, #7bc3f6, #3946a1, #7bc3f6);
    background-size: 200%;
    width: 250px;
    border: none;
    outline: none;
    transition: .3s ease-in-out;
    color: #ffffff;
    font-size: 12px;
    font-weight: bold;
    padding: 12px 45px;
    letter-spacing: 1px;
}

.btn:hover {
    background-position: right;
}

.btn:focus,
.btn:active,
.btn:active:focus {
    outline: none !important;
    box-shadow: 0 3px 4px #8abfff !important;
}

.forgot {
    font-size: 12px;
    color: #0073ff;
    cursor: pointer;
}

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#loading-screen p {
    margin-top: 10px;
    font-size: 1.2em;
    color: #007bff;
}

/* Media Queries for Responsive Design */
@media (min-width: 769px) {
    .toggle-form {
        display: none; /* ซ่อนปุ่ม toggle-form เมื่อหน้าจอมีขนาดใหญ่ */
    }
}

@media (max-width: 768px) {
    .toggle-form {
        display: block; /* แสดงปุ่ม toggle-form เมื่อหน้าจอมีขนาดเล็ก */
    }
}

@media (max-width: 768px) {
    body {
        height: auto;
        margin: 0;
        padding: 20px;
    }

    .container {
        width: 100%;
        max-width: 100%;
        min-height: auto;
        box-shadow: none;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }

    .form-container {
        display: none;
    }

    .form-container.active {
        display: block;
    }

    .form-container,
    .overlay-container,
    .sign-in-container,
    .sign-up-container,
    .overlay-panel {
        position: relative;
        width: 100%;
        height: auto;
        transform: none;
        opacity: 1;
        z-index: 1;
        background: none;
    }

    .sign-in-container,
    .sign-up-container {
        padding: 20px;
    }

    .overlay {
        display: none;
    }

    .social-container {
        margin: 10px 0;
    }

    .btn {
        width: 100%;
    }

    /* ปรับตำแหน่งฟอร์มเข้าสู่ระบบให้อยู่ข้างบน */
    .sign-in-container {
        order: 1;
    }

    .sign-up-container {
        order: 2;
    }
}