/* ========================================================
   [Login Page Styles - PharmaSales Hub & Glowing Background]
   ======================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* พื้นหลังปรับให้มีสีเหลือบๆ สบายตา */
html, body {
    height: 100%;
}

body {
    background-color: #f1f5f9;
    background-image: 
        radial-gradient(at 0% 0%, rgba(141, 146, 247, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(113, 120, 227, 0.15) 0px, transparent 50%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    padding: 20px;
}

/* Fix for SweetAlert2 layout shift */
body.swal2-shown {
    padding-right: 0 !important;
}

/* ลูกเล่นแสงฟุ้งๆ ลอยอยู่ด้านหลังการ์ด */
.bg-blob-1 {
    position: absolute;
    top: -10%; left: -5%;
    width: 45vw; height: 45vw;
    background: #a5b4fc;
    filter: blur(90px);
    border-radius: 50%;
    z-index: -1;
    opacity: 0.5;
    animation: floatBlob 12s ease-in-out infinite alternate;
}

.bg-blob-2 {
    position: absolute;
    bottom: -15%; right: -5%;
    width: 40vw; height: 40vw;
    background: #93c5fd;
    filter: blur(90px);
    border-radius: 50%;
    z-index: -1;
    opacity: 0.5;
    animation: floatBlob 15s ease-in-out infinite alternate-reverse;
}

@keyframes floatBlob {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.05); }
}

/* คอนเทนเนอร์หลักของการ์ด Login */
.login-wrapper {
    background: #ffffff;
    width: 100%;
    max-width: 950px;
    height: 550px;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.08);
    display: flex;
    position: relative;
    z-index: 10;
}

/* ================= ฝั่งซ้าย (Image) ================= */
.login-image-side {
    flex: 1;
    background-color: #8d92f7; 
    border-radius: 20px 0 0 20px;
    position: relative;
    padding: 40px;
    display: flex;
    flex-direction: column;
    color: #ffffff;
    overflow: hidden; 
}

/* วงกลมตกแต่งในฝั่งสีฟ้า */
.circle-1 {
    position: absolute;
    width: 150px; height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    top: -20px; left: -20px;
    z-index: 1;
}
.circle-2 {
    position: absolute;
    width: 250px; height: 250px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    bottom: -50px; right: 50px;
    z-index: 1;
}

.brand {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    opacity: 0.9;
    z-index: 5;
    margin-bottom: 25px;
}

.illustration-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 5;
}

.illustration-container img {
    width: 100%;
    max-width: 280px; 
    filter: drop-shadow(0 15px 25px rgba(0,0,0,0.15));
}

.footer-links {
    font-size: 12px;
    opacity: 0.7;
    z-index: 5;
    margin-top: auto; 
}

/* ================= ฝั่งขวา: ฟอร์ม Login ================= */
.login-form-side {
    flex: 1.1;
    background-color: #ffffff;
    border-radius: 0 20px 20px 0;
    position: relative;
    padding: 60px 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-form-side h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #1e293b;
}

.subtitle {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 35px;
}

/* ช่อง Input แบบขอบมน มีไอคอน */
.custom-input-group {
    display: flex;
    align-items: center;
    background-color: #f4f7fb;
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.custom-input-group:focus-within {
    border-color: #8d92f7;
    background-color: #ffffff;
    box-shadow: 0 4px 15px rgba(141, 146, 247, 0.1);
}

.custom-input-group .material-symbols-rounded {
    color: #94a3b8;
    font-size: 20px;
    margin-right: 12px;
    transition: color 0.3s ease;
}

.custom-input-group:focus-within .material-symbols-rounded {
    color: #8d92f7;
}

.custom-input-group input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 14px;
    color: #333333;
    background: transparent;
}

.custom-input-group input::placeholder {
    color: #94a3b8;
}

/* 🌟 จัดการแถว "Remember me" และ "Forgot Password" */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    margin-bottom: 25px;
    width: 100%;
    padding: 0 6px; /* 🌟 เพิ่มบรรทัดนี้: ขยับซ้าย-ขวาเข้ามา 6px ให้ตรงกับความโค้งของช่องกรอก */
}

.form-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
    cursor: pointer;
}

.form-options input[type="checkbox"] {
    accent-color: #8d92f7; 
    cursor: pointer;
    width: 15px; /* ปรับขนาด checkbox ให้พอดี */
    height: 15px;
}

.forgot-link {
    color: #8d92f7;
    font-size: 13px;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: #5b62e0;
    text-decoration: underline;
}

/* ปุ่ม Login แบบแคปซูล */
.btn-capsule {
    width: 100%;
    color: #ffffff;
    border: none;
    border-radius: 50px; 
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(141, 146, 247, 0.3);
    background: #8d92f7;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); 
}

.btn-capsule:hover {
    background: #767ce3;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(113, 120, 227, 0.4); 
}

.btn-capsule:active {
    transform: translateY(1px); 
    box-shadow: 0 2px 6px rgba(113, 120, 227, 0.2);
}

/* Responsive สำหรับมือถือ */
@media (max-width: 768px) {
    .login-wrapper {
        flex-direction: column;
        height: auto;
        max-width: 400px;
        margin: 20px;
    }
    .login-image-side {
        border-radius: 20px 20px 0 0;
        padding: 40px 30px;
    }
    .login-form-side {
        border-radius: 0 0 20px 20px;
        padding: 40px 30px;
    }
    .bg-blob-1, .bg-blob-2 { display: none; }
}