/* =========================================
   สไตล์สำหรับหน้า Login
========================================= */
.login-layout {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px 0;
}

.login-card {
  border: none;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(124, 92, 191, 0.2) !important;
  background-color: #ffffff;
}

.login-card .card-header {
  background: transparent;
  border-bottom: none;
  padding-top: 2.5rem !important;
}

/* =========================================
   สไตล์สำหรับปุ่มทั่วไป (ปรับเป็นโทน Pastel Purple)
========================================= */
.btn-primary-gradient {
  background: #7c5cbf;
  border: none;
  border-radius: 10px;
  padding: 10px;
  font-weight: bold;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

.btn-primary-gradient:hover {
  background: #6a4dab;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(124, 92, 191, 0.4);
}

.page-header .btn-secondary, 
.page-header .btn-success {
  margin-bottom: 1.2rem;
}

/* =========================================
   สไตล์สำหรับ Layout (Navbar & ทั่วไป)
========================================= */

/* สีของ Navbar (โทนม่วง Pastel) */
.navbar-pastel {
  background: linear-gradient(135deg, #7c5cbf 0%, #9b90b8 100%) !important;
  box-shadow: 0 4px 15px rgba(124, 92, 191, 0.2);
}

.navbar-brand {
  font-weight: 800;
  letter-spacing: 1px;
}

.nav-link {
  font-weight: 500;
  position: relative;
  transition: color 0.3s ease;
}

/* เอฟเฟกต์ขีดเส้นใต้ตอนเอาเมาส์ชี้เมนู (เปลี่ยนเป็นสีชมพูพาสเทล) */
.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 50%;
  background-color: #f8b8d8; /* สีชมพูพาสเทล */
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-link:hover::after {
  width: 80%;
}

.nav-link:hover {
  color: #f8b8d8 !important; /* ตัวหนังสือเปลี่ยนเป็นสีชมพูพาสเทล */
}

/* =========================================
   Responsive Design (หน้าจอมือถือ & แท็บเล็ต)
========================================= */
@media (max-width: 768px) {
  .navbar-brand { font-size: 1.2rem; }
  .card-body { padding: 1.25rem !important; }
  .login-card .card-body { padding: 1.5rem !important; }
  .navbar-collapse {
      background-color: rgba(255, 255, 255, 0.1);
      padding: 10px;
      border-radius: 10px;
      margin-top: 10px;
  }
  .nav-link::after { display: none; }
  .btn { font-size: 0.95rem; }
}

@media (max-width: 576px) {
  .d-flex.align-items-center span.text-light {
      font-size: 0.85rem;
  }
  .page-header h2 { font-size: 1.5rem; }
  .page-header {
      flex-direction: column;
      align-items: flex-start !important;
      gap: 15px;
  }
}

/* =========================================
   ปรับขยายความกว้างของเนื้อหา (Container)
========================================= */
@media (min-width: 1200px) {
  .container { max-width: 90%; }
}
@media (min-width: 1400px) {
  .container { max-width: 90%; }
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* =========================================
   ธีมพื้นหลัง Pastel (ใช้งานครอบคลุมทุกหน้า)
========================================= */
body.bg-pastel-theme {
  background: linear-gradient(135deg, #eef2ff 0%, #fdf2f8 50%, #f0fdfa 100%) !important;
  font-family: 'DM Sans', 'Prompt', sans-serif;
  min-height: 100vh;
  position: relative;
}

/* ===== Canvas พื้นหลัง (อยู่หลังสุด) ===== */
#bg-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: -1; 
  pointer-events: none;
}

/* ===== วงกลม Pastel Blobs (อยู่หลังสุด) ===== */
.bg-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  z-index: -1; 
  pointer-events: none;
  animation: floatBlob 14s ease-in-out infinite;
}
.bg-blob.b1 { width: 420px; height: 420px; background: #f8bbd0; top: -120px; left: -100px; animation-delay: 0s; }
.bg-blob.b2 { width: 380px; height: 380px; background: #b5c8f8; bottom: -140px; right: -100px; animation-delay: 3s; }
.bg-blob.b3 { width: 300px; height: 300px; background: #c8f7e4; top: 40%; left: 60%; animation-delay: 6s; }
.bg-blob.b4 { width: 260px; height: 260px; background: #e0c3fc; bottom: 10%; left: 5%; animation-delay: 9s; }

@keyframes floatBlob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%      { transform: translate(40px, -30px) scale(1.08); }
  50%      { transform: translate(-20px, 30px) scale(0.95); }
  75%      { transform: translate(25px, 20px) scale(1.04); }
}

/* ===== กล่อง Login (Scene) ===== */
.scene {
  width: 820px;
  min-height: 520px;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  box-shadow: 0 12px 40px rgba(120, 100, 180, 0.18);
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease-out;
  margin: 0 auto;
}

/* ===== ฝั่งซ้าย (Branding) ===== */
.left-panel {
  flex: 1;
  background: linear-gradient(160deg, #b5c8f8 0%, #d4b8f0 50%, #f8b8d8 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  min-width: 220px;
}
.blob { position: absolute; border-radius: 50%; opacity: 0.3; pointer-events: none; }
.blob1 { width: 180px; height: 180px; background: #fff; top: -50px; left: -50px; }
.blob2 { width: 120px; height: 120px; background: #fff; bottom: 20px; right: -30px; }
.blob3 { width: 70px;  height: 70px;  background: #f8b8d8; top: 55%; left: 10%; }

.brand-icon {
  width: 64px; height: 64px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.25rem;
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  position: relative; z-index: 1;
}
.brand-icon svg { width: 28px; height: 28px; color: #7c5cbf; }
.brand-name { font-size: 20px; font-weight: 600; color: #4a3a7a; position: relative; z-index: 1; margin-bottom: 8px; }
.brand-tagline { font-size: 13px; color: rgba(74, 58, 122, 0.7); text-align: center; position: relative; z-index: 1; line-height: 1.5; max-width: 160px; }

.dots-deco { display: flex; gap: 8px; margin-top: 2rem; position: relative; z-index: 1; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.5); }
.dot.active { background: #fff; width: 22px; border-radius: 4px; }

/* ===== ฝั่งขวา (ฟอร์ม Login) ===== */
.right-panel {
  flex: 1.2;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.5rem 2.5rem;
}
.form-title { font-size: 22px; font-weight: 600; color: #2d2150; margin-bottom: 4px; text-align: center; }
.form-sub { font-size: 13px; color: #9b90b8; margin-bottom: 1.5rem; text-align: center; }

.field-label { display: block; font-size: 12px; font-weight: 500; color: #b0a8cc; letter-spacing: 0.05em; margin-bottom: 5px; }
.field-wrap { position: relative; margin-bottom: 1.2rem; }
.field-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: #c4bade; pointer-events: none; }
.field-input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  border: 1.5px solid #e8e3f5;
  border-radius: 10px;
  font-size: 14px;
  color: #2d2150;
  font-family: 'DM Sans', 'Prompt', sans-serif;
  background: #faf9ff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field-input:focus { border-color: #b5a8e8; background: #fff; box-shadow: 0 0 0 3px rgba(181, 168, 232, 0.18); }
.field-input::placeholder { color: #cdc8e8; }

.btn-login {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: #7c5cbf;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-family: 'DM Sans', 'Prompt', sans-serif;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.2s, transform 0.15s;
}
.btn-login:hover { background: #6a4dab; transform: translateY(-1px); }
.btn-login:active { transform: scale(0.98); }

.alert-error {
  background: #fff0f3;
  border: 1.5px solid #f8b8c8;
  color: #c0405a;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 1rem;
}

/* ===== Responsive บนมือถือ ===== */
@media (max-width: 768px) {
  .scene { flex-direction: column; width: 100%; min-height: unset; border-radius: 16px; }
  .left-panel { padding: 1.5rem; min-height: 160px; }
  .brand-tagline { display: none; }
  .dots-deco { margin-top: 1rem; }
  .right-panel { padding: 2rem 1.5rem; }
}