/* KU All Login: sign-in block of the legacy login forms (heading, button, card) */
.kuall-head {
  display: flex; align-items: center; gap: 12px; margin: 2px 0 14px; text-align: left;
  font-family: "Sarabun", "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif;
}
.kuall-logo {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 12px; background: #006b3f;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0, 80, 45, .25);
}
.kuall-logo svg { width: 24px; height: 24px; fill: #fff; }
.kuall-title { font-size: 16px; font-weight: 700; color: #0b3d2a; line-height: 1.35; }
.kuall-sub { font-size: 13px; color: #56675e; line-height: 1.45; margin-top: 2px; font-weight: 400; }

.kuall-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-sizing: border-box; width: 100%; max-width: 360px; min-height: 46px; margin: 12px auto 4px; padding: 10px 18px;
  border: 0; border-radius: 10px; background: #006b3f; color: #fff !important; cursor: pointer;
  font: 600 16px/1.25 "Sarabun", "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif;
  box-shadow: 0 2px 6px rgba(0, 80, 45, .25); transition: background-color .15s, transform .05s; -webkit-appearance: none;
}
.kuall-btn:hover { background: #00563a; }
.kuall-btn:active { transform: translateY(1px); }
.kuall-btn:focus-visible { outline: 3px solid #f2b705; outline-offset: 2px; }
.kuall-btn svg { width: 18px; height: 18px; fill: currentColor; flex: 0 0 auto; }

/* old table forms become a card */
form.kuall-form {
  box-sizing: border-box; max-width: 440px; margin: 10px auto; padding: 18px 20px; text-align: left;
  background: #fff; color: #1f2d27; border: 1px solid #dfe7e2; border-top: 4px solid #006b3f; border-radius: 12px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .08); font-family: "Sarabun", "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif;
}
form.kuall-form table { width: 100% !important; height: auto !important; border-collapse: collapse; background: transparent; }
form.kuall-form td { padding: 5px 4px; background: transparent; }
form.kuall-form select,
form.kuall-form input[type=number],
form.kuall-form input[type=text] {
  box-sizing: border-box; min-height: 38px; max-width: 100%; padding: 6px 10px;
  border: 1px solid #c5d3cb; border-radius: 8px; background: #fff; color: #1f2d27; font-size: 15px;
}
form.kuall-form select:focus,
form.kuall-form input:focus { outline: 2px solid #006b3f; outline-offset: 1px; }
form.kuall-form br + br { display: none; }

/* phones: the fixed-width page around the form is allowed to shrink, the form rows stack */
@media (max-width: 768px) {
  html, body { min-width: 0 !important; }
  img { max-width: 100%; height: auto; }
  :has(form.kuall-form), :has(form.kuall-plain) {
    box-sizing: border-box; width: auto !important; min-width: 0 !important; max-width: 100% !important;
    float: none !important; margin-left: 0 !important; margin-right: 0 !important;
  }
  table:has(form.kuall-form), table:has(form.kuall-form) > tbody, tr:has(form.kuall-form),
  tr:has(form.kuall-form) > td, tr:has(form.kuall-form) > th { display: block; width: 100% !important; }
  form.kuall-plain table { width: 100% !important; height: auto !important; }
  form.kuall-plain td { white-space: normal; }
  form.kuall-plain div, form.kuall-plain table { width: auto !important; max-width: 100% !important; background-size: cover; }
  form.kuall-form { max-width: none; margin: 10px 8px; padding: 16px; }
  form.kuall-form tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
  form.kuall-form td { display: block; width: auto !important; text-align: left !important; }
  form.kuall-form td[colspan] { flex: 1 1 100%; }
  form.kuall-form select, form.kuall-form input[type=number], form.kuall-form input[type=text] { min-height: 44px; font-size: 16px; }
  .kuall-btn { max-width: none; min-height: 50px; }
}

/* forms that keep the page's own frame: only the fields are restyled */
form.kuall-plain select,
form.kuall-plain input[type=number],
form.kuall-plain input[type=text] {
  box-sizing: border-box; min-height: 36px; max-width: 100%; padding: 5px 10px;
  border: 1px solid #c5d3cb; border-radius: 8px; background: #fff; font-size: 15px;
}
form.kuall-plain .kuall-head { justify-content: center; }
/* narrow places (side columns): label and field stack */
form.kuall-form { container-type: inline-size; }
@container (max-width: 300px) {
  form.kuall-form tr { display: flex; flex-wrap: wrap; gap: 2px 6px; }
  form.kuall-form td { display: block; width: 100% !important; text-align: left !important; white-space: normal; }
}
