/* ตั้งค่าพื้นฐาน */
body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #f0f0f0;
    flex-direction: column;
}

h2 {
    text-align: center;
}

#bot_trap{
    display: none;
}

/* สไตล์ฟอร์ม */
form {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    width: 90%;
    max-width: 350px;
}

/* ปรับ margin ให้ช่องอินพุตห่างกัน */
form div {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

/* ปรับขนาดอินพุตให้พอดี */
input[type="email"], input[type="password"], input[type="text"] {
    width: calc(100% - 7%);
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

/* ปรับขนาดปุ่ม Submit */
input[type="submit"] {
    background-color: #007BFF;
    width: 100%;
    color: #FFFFFF;
    border: none;
    padding: 12px;
    border-radius: 4px;
    font-size: 6vh;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

input[type="submit"]:hover {
    background-color: #0056b3;
}

/* ปรับสไตล์ CAPTCHA */
.captcha-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
}

/* ปรับตำแหน่งของ CAPTCHA Image */
.captcha-image {
    display: block;
    width: auto;
    max-width: 100%;
    height: 40px; /* คงขนาดไว้ที่ 40px */
}

/* ปุ่มฟังเสียง CAPTCHA */
button.speak-button {
    background-color: #007BFF;
    width: 100%;
    color: #FFFFFF;
    border: none;
    padding: 12px;
    border-radius: 4px;
    font-size: 6vh;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button.speak-button:hover {
    background-color: #0056b3;
}

#showCaptchaButton {
    display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0.75rem 1.5rem;
        border-radius: var(--radius-sm);
        font-weight: 500;
        font-size: 1rem;
        line-height: 1.5;
        cursor: pointer;
        transition: all 0.2s;
        border: none;
        text-decoration: none;
        user-select: none;
        width: 100%;
}

/* กำหนดสไตล์ให้กับกลุ่มฟอร์ม */
.form-group {
    margin-bottom: 16px;          /* เว้นระยะห่างระหว่างกลุ่ม */
    padding: 16px;                /* พื้นที่ภายในกลุ่ม */
    border: 1px solid #ccc;       /* เส้นขอบสีอ่อน */
    border-radius: 4px;           /* มุมโค้งมน */
    background-color: #fff;       /* พื้นหลังสีขาว */
}

/* กำหนดสไตล์ให้กับ label */
.form-group label {
    display: block;               /* ให้ label แสดงในบรรทัดใหม่ */
    margin-bottom: 8px;           /* เว้นระยะห่างด้านล่างของ label */
    font-weight: bold;            /* ทำให้ตัวหนังสือหนา */
    color: #333;                  /* สีตัวอักษรที่มีความตัดกันชัดเจน */
}

/* กำหนดสไตล์ให้กับ input */
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;                  /* ใช้พื้นที่ความกว้างเต็มที่ของ container */
    padding: 10px;                /* เพิ่มพื้นที่ภายใน input */
    font-size: 16px;              /* ขนาดตัวหนังสือที่อ่านง่าย */
    border: 1px solid #aaa;       /* เส้นขอบของ input */
    border-radius: 4px;           /* มุมโค้งมนของ input */
    box-sizing: border-box;       /* รวม padding และ border ในความกว้าง */
}

/* สไตล์เมื่อ input ได้รับ focus (สำหรับ accessibility) */
.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus {
    border-color: #007BFF;        /* เปลี่ยนสีเส้นขอบเมื่อโฟกัส */
    outline: none;                /* ยกเลิกเส้น outline เริ่มต้น */
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25); /* แสดงแสงไฮไลท์รอบ input */
}


/* รองรับ Tablet */
@media (max-width: 768px) {
    form {
        width: 95%;
    }

    .captcha-container {
        align-items: center;
    }

    button.speak-button {
        width: 100%;
        text-align: center;
    }
}

/* รองรับ Mobile */
@media (max-width: 480px) {
    form {
        padding: 15px;
    }

    input[type="email"], input[type="password"], input[type="text"] {
        padding: 8px;
        font-size: 14px;
    }

    input[type="submit"] {
        padding: 10px;
        font-size: 3.3vh;
    }

    button.speak-button {
        font-size: 3.3vh;
        padding: 8px 12px;
    }

    .captcha-image {
        height: 35px; /* ปรับขนาดในมือถือให้ไม่ใหญ่เกินไป */
    }
}
