﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Open Sans", sans-serif;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: auto;
    height: auto;
    padding: 0 10px;
    position: relative;
}

    body::before {
        content: "";
        position: absolute;
        width: 100%;
        height: 100%;
        background-image: url('../images/img/287109.jpg');
        background-position: center;
        background-size: cover;
        z-index: -1; /* ทำให้ภาพอยู่ด้านหลัง */
    }

.wrapper {
    width: 431px;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}

form {
    display: flex;
    flex-direction: column;
}

h2 {
    font-size: 2rem;
    margin-bottom: 20px;
}

.input-field {
    position: relative;
    border-bottom: 2px solid #ccc;
    margin: 15px 0;
}

    .input-field label {
        position: absolute;
        top: 50%;
        left: 0;
        transform: translateY(-50%);
        font-size: 16px;
        pointer-events: none;
        transition: 0.15s ease;
    }

    .input-field input {
        width: 100%;
        height: 40px;
        background: transparent;
        border: none;
        outline: none;
        font-size: 16px;
    }

        .input-field input:focus ~ label,
        .input-field input:valid ~ label {
            font-size: 0.8rem;
            top: 10px;
            transform: translateY(-120%);
        }

.forget {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 25px 0 35px 0;
    color: #fff;
}

#remember {
    accent-color: #fff;
}

.forget label {
    display: flex;
    align-items: center;
}

    .forget label p {
        margin-left: 8px;
    }

.wrapper a {
    color: rgba(104, 103, 103, 1);
    text-decoration: none;
}

    .wrapper a:hover {
        text-decoration: underline;
    }

button {
    background: rgba(162, 202, 113, 1);
    color: white;
    font-weight: 600;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 16px;
    border: 2px solid transparent;
    transition: 0.3s ease;
}

    button:hover {
        color: #fff;
        border-color: #fff;
        background: rgba(255, 255, 255, 0.15);
    }

.register {
    text-align: center;
    margin-top: 30px;
    color: #fff;
}

.container {
    display: flex;
    flex-direction: row;
    gap: 2%;
    margin-bottom: 5%;
    margin-left: 53%;
    color: rgba(104, 103, 103, 1);
}

.form-group {
    margin-bottom: 20px;
    width: 100%;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

.label-left {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
    display: block;
}

.form-control {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

    .form-control:focus {
        border-color: #007bff;
        box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
    }

.form-group {
    margin-bottom: 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .wrapper {
        width: 90%; /* ลดขนาดกล่องลง */
        padding: 20px;
    }

    h2, h3, h4 {
        font-size: 1.5rem; /* ลดขนาดฟอนต์ */
    }

    .input-field input {
        font-size: 14px; /* ลดขนาดตัวอักษรในฟอร์ม */
    }

    button {
        font-size: 14px; /* ลดขนาดปุ่ม */
        padding: 10px;
    }

    .container {
        flex-direction: column; /* เรียงแนวตั้ง */
        gap: 10px; /* เพิ่มช่องว่างระหว่าง */
        margin-left: 0; /* ตรงกลาง */
        text-align: center;
    }

    .form-group {
        max-width: 100%; /* ขยายฟอร์มให้เต็ม */
        margin: 10px 0;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0 5px; /* ลดระยะขอบข้าง */
    }

    .wrapper {
        padding: 15px; /* ลด Padding */
    }

    h2, h3, h4 {
        font-size: 1.2rem; /* ปรับขนาดฟอนต์ */
    }

    .input-field input {
        font-size: 12px; /* ลดขนาดฟอนต์ในฟิลด์ */
    }

    button {
        font-size: 12px;
        padding: 8px;
    }

    .container {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
}


/* ป้องกันพื้นหลังสีฟ้าและทำให้เคอร์เซอร์ยังคงอยู่ */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    background-color: white !important;
    color: black !important;
    transition: background-color 5000s ease-in-out 0s;
    caret-color: black !important; /* ทำให้เคอร์เซอร์มองเห็นได้ */
}

/* ทำให้แน่ใจว่า input ไม่ถูกซ่อน */
input {
    border: 1px solid #ccc;
    padding: 8px;
    font-size: 16px;
    caret-color: black; /* สีเคอร์เซอร์ */
}

    /* บังคับให้เคอร์เซอร์เมาส์ยังคงแสดงเมื่อพิมพ์ */
    input:focus {
        outline: none;
        box-shadow: 0 0 5px rgba(0, 0, 0, 0);
        cursor: text; /* บังคับให้เมาส์ยังเป็นแบบตัวพิมพ์ */
    }
.toggle-password {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    cursor: pointer;
}



.inputfield {
    display: flex;
    justify-content: center;
    gap: 10px; /* ระยะห่างระหว่างช่อง OTP */
    margin-bottom: 20px;
}

.otp-input {
    width: 40px;
    height: 50px;
    text-align: center;
    font-size: 24px;
    border: 2px solid #ccc;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s;
}

    .otp-input:focus {
        border-color: #007bff;
    }