:root {
  --bg-1: #f3f6f9;
  --card-bg: #ffffff;
  --muted: #6b737a;
  --text: #0b1a2b;
  --primary: #0078d4;
  --primary-600: #0065b8;
  --radius: 8px;
  --shadow: 0 10px 30px rgba(11,26,43,0.08);
  --glass: rgba(255,255,255,0.6);
  --success-color: #10b981; /* Green for success/confirm */
}

/* Page layout (unchanged) */
.login-widget {
  min-height: 100vh;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 18px;
  background: linear-gradient(180deg, #f7f9fb 0%, var(--bg-1) 100%);
  color: var(--text);
}

/* Card (unchanged) */
.login-widget .card{
  width: 380px;
  max-width: calc(100% - 40px);
  background: var(--card-bg);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow);
  padding: 22px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(100vh - 56px);
  overflow: auto;
}

/* Modal/backdrop styles (unchanged) */
.login-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1040;
  padding: 24px;
}
.login-modal{ width: 480px; max-width: 480px; }

.modal-card{
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(2,6,23,0.4);
}

/* Brand area (unchanged) */
.brand{
  text-align: center;
  padding: 18px;
  padding-bottom: 4px;
  border-bottom: 1px solid #eef2f5;
}
.brand .logo{
  height: 44px;
  width: 44px;
  object-fit: contain;
  display: inline-block;
  margin-bottom: 10px;
}
.brand h1{
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--text);
}
.brand .subtitle{
  margin: 6px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

/* Form area */
.form{
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 6px 22px 22px 22px;
}
/* Field label wrapper (unchanged) */
.field{
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field .label-text{
  font-size: 13px;
  color: var(--muted);
}
/* Inputs (class 'input-field' added to HTML) */
input[type="email"],
input[type="password"],
input[type="text"],
.input-field { /* เพิ่ม class input-field เพื่อให้สไตล์ถูกใช้กับ input ที่กำหนด */
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  font-size: 15px;
  color: var(--text);
  background: #fff;
  border: 1px solid #d8dee6;
  border-radius: 6px;
  outline: none;
  transition: box-shadow .14s ease, border-color .14s ease, transform .06s ease;
  -webkit-appearance: none;
  appearance: none;
}

input::placeholder{
  color: #9aa3ad;
}
input:focus{
  border-color: var(--primary);
  box-shadow: 0 6px 20px rgba(0,120,212,0.10);
  transform: translateZ(0);
}

/* Actions row */
.actions{
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  flex-direction: row-reverse;
}

/* Custom class for justify-end when using flex-row-reverse */
.actions.justify-end-custom {
    justify-content: flex-start;
}

/* Custom class for lift hover effect (used for 'เปิด Modal' button) */
.hover-lift:hover {
    transform: translateY(-2.5px);
    transition: transform .2s ease;
}

/* PRIMARY BUTTON - แก้ไขสีข้อความให้เป็นสีดำ */
button.primary{
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-600) 100%);
  color: #000000; /* ⬅️ แก้ไขเป็นสีดำตามคำขอ */
  border: none;
  padding: 10px 14px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  box-shadow: 0 6px 18px rgba(0,120,212,0.12);
  transition: transform .06s ease, box-shadow .12s ease, opacity .12s ease;
}

button.primary:hover:not(:disabled){
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0,120,212,0.14);
}
button.primary:active{
  transform: translateY(0);
}
button.primary:disabled{
  opacity: 0.55;
  cursor: not-allowed;
  color: #000000; /* ข้อความ disabled ก็เป็นสีดำ */
  box-shadow: none;
}

/* Secondary Button Style (สำหรับปุ่ม 'เปิด Modal', 'ส่งอีกครั้ง') */
.primary.secondary-button {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    box-shadow: none;
    transition: background-color .14s ease;
}
.primary.secondary-button:hover {
    background: rgba(0, 120, 212, 0.05);
    transform: none;
    box-shadow: none;
}


/* Footer (unchanged) */
.footer{
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid #eef2f5;
  font-size: 13px;
  color: var(--muted);
}
.footer a{
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

/* Focus styles (unchanged) */
:focus{ outline: none; }
:focus-visible{
  outline: 3px solid rgba(0,120,212,0.12);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Small screens */
@media (max-width:420px){
  .login-backdrop{ padding: 12px; }
  .login-modal{ max-width: 100%; }
  .modal-card .brand{ padding: 12px; }
  .login-widget .card{
    padding: 18px;
    width: 100%;
  }
  .brand h1{ font-size: 18px; }
  .biometric span, .primary{ font-size: 13px; }
}
