@font-face {
    font-family: 'Kanit';
    src: url('../fonts/Kanit-Regular.ttf') format('truetype');
    font-weight: 400;
}
@font-face {
    font-family: 'Kanit';
    src: url('../fonts/Kanit-SemiBold.ttf') format('truetype');
    font-weight: 600;
}

:root {
    --smi-navy: #11223D;
    --smi-blue: #044770;
    --smi-grey: #6B6B6B;
    --white: #FFFFFF;
    --accent: #f7a61d; /* สีส้มเส้นขอบหัวข้อตามแบบ EMS */
}

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

body {
    font-family: 'Kanit', sans-serif;
    height: 100vh;
    overflow: hidden; 
    background-color: var(--smi-navy);
    background-image: url("../img/smi-bg.png");
    background-attachment: fixed;
    background-size: cover;
    background-position: right center;
}

.smi-main-container {
    display: flex;
    width: 100%;
    height: 100vh;
}

/* ฝั่งซ้าย: สไตล์ไทยน้ำทิพย์ (Overlay) */
.smi-panel-left {
    flex: 0 0 65%;
    /*background: linear-gradient(135deg, #11223D 0%, #044770 100%); /* ใช้สี SMI */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* คลาสเดิม .smi-bg-img: ล็อกขนาดไม่ให้ล้น */
.smi-bg-img {
    width: 85%; /* ไม่ให้เต็ม 100% เพื่อไม่ให้ทับตัวหนังสือ */
    height: auto;
    object-fit: contain;
    opacity: 0.9;
	margin-top: 40px; /* เพิ่มระยะห่างด้านบนเพื่อไม่ให้ทับข้อความ */
}

/* คลาสเดิม .smi-overlay-content: ปรับ Font Size ให้เล็กลงตามรูปล่าง */
.smi-overlay-content {
    position: absolute;
    top: 60px;
    left: 60px;
    text-align: left;
}

.smi-overlay-content h1 {
    font-size: 2.2rem; /* ลดขนาดลงไม่ให้พัง */
    border-left: 5px solid #f7a61d;
    padding-left: 20px;
	color: #cfcfcf;
}

.smi-overlay-content p {
    font-size: 1.2rem;
    font-style: italic;
    color: #cfcfcf;
	padding-left: 20px;
	border-left: 5px solid #f7a61d;
}

/* ฝั่งขวา: Card Login (สไตล์ Clean เทาอ่อน) */
.smi-panel-right {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    /*background: rgba(0, 0, 0, 0.1); /* มืดลงนิดนึงเพื่อให้ Card เด่น */
}

.smi-login-card {
    width: 100%;
    max-width: 420px;
    background: rgba(226, 226, 226, 0.96); /* สีเทาอ่อนตามตัวอย่าง */
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: 0 15px 45px rgba(0,0,0,0.4);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.smi-card-header { text-align: center; margin-bottom: 30px; }
.smi-logo-sm { max-width: 130px; margin-bottom: 20px; height: auto; }
.smi-title { color: var(--smi-navy); font-size: 1.5rem; font-weight: 600; }
.smi-subtitle { color: var(--smi-grey); font-size: 0.85rem; margin-top: 5px; text-transform: uppercase; }

hr { border: 0; border-top: 1px solid rgba(17, 34, 61, 0.2); margin: 25px 0; }

.smi-form-group { margin-bottom: 15px; }
.smi-form-group label { display: block; margin-bottom: 10px; font-size: 0.95rem; color: var(--smi-navy); font-weight: 600; }

.smi-form-group input {
    width: 100%;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.1);
    background: rgba(17, 34, 61, 0.05); /* พื้นหลัง Input จางๆ แบบตัวอย่าง */
    font-family: 'Kanit';
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
}

.smi-form-group input:focus {
    background: var(--white);
    border-color: var(--smi-blue);
    box-shadow: 0 0 0 4px rgba(4, 71, 112, 0.1);
}

.smi-btn-submit {
    width: 100%;
    padding: 16px;
    background: var(--smi-navy);
    color: white;
    border: none;
    border-radius: 30px;
    font-family: 'Kanit';
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 10px;
}

.smi-btn-submit:hover { 
    background: #cc2f05; /* สีส้มแดงตอน Hover ตามตัวอย่างปอนด์ */
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(204, 47, 5, 0.3);
}

.msg {
    color: #cc2f05;
    text-align: center;
    margin-bottom: 15px;
    font-weight: 600;
    font-style: italic;
    display: none;
}

/* กล่องแจ้งเตือนเซสชันหมดอายุ (แสดงเมื่อถูกเด้งมาจากหน้าที่ session หมด) */
.msg-warn {
    display: block;
    color: #92560a;
    background: #fff7e6;
    border: 1px solid #ffd591;
    border-radius: 10px;
    padding: 10px 14px;
    font-style: normal;
    font-weight: 500;
    font-size: 0.9rem;
    line-height: 1.4;
}
.msg-warn i { margin-right: 6px; }

/* บอกว่าล็อกอินแล้วจะพากลับหน้าที่เปิดไว้ (มี ?next= · HD #201) */
.msg-info {
    display: block;
    color: #0b4f8a;
    background: #eaf4ff;
    border: 1px solid #b6d8fb;
    border-radius: 10px;
    padding: 10px 14px;
    font-style: normal;
    font-weight: 500;
    font-size: 0.9rem;
    line-height: 1.4;
}
.msg-info i { margin-right: 6px; }

@media (max-width: 992px) {
    .smi-panel-left { display: none !important; }
    .smi-panel-right { flex: 0 0 100%; background: var(--smi-navy); }
}