/* --- General Setup --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Kanit', sans-serif;
    min-height: 100vh;
    height: auto;
    display: flex;
}

/* --- Main Container --- */
.login-container {
    display: flex;
    width: 100%;
}

/* --- Left Panel (Logo) --- */
.left-panel {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #ffffff;
    transition: all 0.3s ease;
}

.logo-container img {
    max-width: 100%;
    width: 31.25rem; /* 500px */
}

/* --- Right Panel (Form) --- */
.right-panel {
    flex: 1;
    background: linear-gradient(to top, #FFE800, #BEA000);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2.5rem; /* 40px */
}

form {
    width: 100%;
    max-width: 22.5rem; /* 360px */
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
}

form h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5625rem; /* 25px */
    color: #ffffff;
}

.input-group {
    width: 100%;
    margin-bottom: 1.25rem; /* 20px */
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* 8px */
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem; /* 8px */
    color: #ffffff;
}

.input-group input {
    width: 100%;
    padding: 0.875rem 1.25rem; /* 14px 20px */
    border: none;
    border-radius: 50rem;
    font-size: 1rem;
    font-family: 'Kanit', sans-serif;
    outline: none;
}

.password-wrapper {
    position: relative;
    width: 100%;
}

.toggle-password {
    position: absolute;
    top: 50%;
    right: 1.25rem; /* 20px */
    transform: translateY(-50%);
    cursor: pointer;
    color: #aaa;
}

.btn {
    width: 100%;
    padding: 0.875rem; /* 14px */
    border: none;
    border-radius: 50rem;
    font-size: 1.1rem;
    font-family: 'Kanit', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-decoration: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.625rem; /* 10px */
}

.btn-top {
    width: 40%;
}

.btn-login {
    font-family: 'Kanit', sans-serif;
    border: none;
    padding: 0.875rem;
    font-weight: 700;
    border-radius: 50rem;
    background-color: #635A00;
    color: #ffffff;
    width: 100%;
}

.btn-login:hover {
    background-color: #3D380B;
}

.link-phone {
    color: #000000;
    text-decoration: underline;
    margin-top: 0.9375rem; /* 15px */
    font-size: 1rem;
}

.divider {
    width: 100%;
    text-align: center;
    border-bottom: 1px solid rgba(56, 56, 56, 0.2);
    line-height: 0.1em;
    margin: 1.5625rem 0; /* 25px */
}

.divider span {
    background: #e9c401;
    padding: 0 0.625rem; /* 10px */
    color: #383838;
    font-size: 0.9rem;
}

.social-login {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.625rem; /* 10px */
}

.btn-social {
    position: relative;
}

.btn-social img {
    height: 1.5rem; /* 24px */
    width: 1.5rem;
    /* ✨ FIX: ใช้ Flexbox จัดกลาง ไม่ต้องใช้ position absolute ✨ */
}

.btn-social.google {
    background-color: #ffffff;
    color: #333;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.1); /* 2px 4px */
}
.btn-social.google:hover {
    background-color: #E4DDDD;
}

.btn-social.facebook {
    background-color: #1877F2;
    color: #ffffff;
}
.btn-social.facebook:hover {
    background-color: #0046B7;
}

.btn-social.line {
    background-color: #06C755;
    color: #ffffff;
}
.btn-social.line:hover {
    background-color: #008600;
}

.signup-link {
    margin-top: 1.5625rem; /* 25px */
    font-size: 1rem;
    color: #000000;
}

.signup-link a {
    color: #383838;
    text-decoration: none;
    font-weight: 700;
}

.error-box {
    background-color: #ffdddd;
    color: #d8000c;
    padding: 0.75rem 0.9375rem; /* 12px 15px */
    margin-bottom: 1.25rem; /* 20px */
    border-radius: 0.5rem; /* 8px */
    width: 100%;
    text-align: center;
    font-weight: 500;
}

/* --- ✨ START: Responsive Design Section ✨ --- */

/* --- สำหรับจอ Tablet (ขนาดไม่เกิน 1024px) --- */
/* @media (max-width: 1024px) {
    .left-panel {
        flex: 0.7;
    }
    .right-panel {
        flex: 1.3;
    }
    .logo-container img {
        width: 25rem; 400px
    }
} */

/* --- สำหรับจอ Mobile (ขนาดไม่เกิน 768px) --- */
@media screen and (max-width: 768px) {
    .login-container {
        flex-direction: column;
    }
    .left-panel {
        display: none;
    }
    .right-panel {
        padding: 2rem 1.5rem;
    }
    form h1 {
        font-size: 2rem;
    }
    .btn-top {
        width: 60%; /* ขยายปุ่มให้ใหญ่ขึ้นเล็กน้อยบนมือถือ */
    }
}

/* --- สำหรับจอ Mobile ขนาดเล็ก (ขนาดไม่เกิน 430px) --- */
@media screen and (max-width: 430px) {
    .right-panel {
        padding: 1.5rem 1rem;
    }
    form h1 {
        font-size: 1.8rem;
    }
    .btn-top {
        width: 100%;
    }
}