/* ==========================================================================
   POS - Auth pages (login / forgot password / OTP / change password)
   --------------------------------------------------------------------------
   Restrained, flat, product-style layout. Loaded only by the standalone auth
   views. Keeps the brand blue, the original logo and every form field/action.
   ========================================================================== */

:root {
  --auth-bg: #0b2a5b;
  --auth-bg-2: #0a234b;
  --auth-brand: #0a48b3;
  --auth-brand-dark: #073a90;
  --auth-text: #0f172a;
  --auth-label: #334155;
  --auth-muted: #64748b;
  --auth-border: #d7dee8;
  --auth-icon: #94a3b8;
  --auth-ring: rgba(10, 72, 179, .16);
  --auth-danger: #b42318;
  --auth-danger-bg: #fef3f2;
  --auth-danger-bd: #fecdca;
  --auth-success: #067647;
  --auth-success-bg: #ecfdf3;
  --auth-success-bd: #abefc6;
}

/* ---------- page ---------- */
/* Base font lives on the plain `body` selector so thai-fonts.css (loaded
   after this file) can override it for Thai without a specificity fight. */
body {
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body.auth-page {
  margin: 0;
  min-height: 100vh;
  display: flex;
  padding: 24px 16px;
  color: var(--auth-text);
  background-color: var(--auth-bg);
  background-image:
    linear-gradient(135deg, rgba(6, 41, 110, .90) 0%, rgba(8, 40, 95, .72) 45%, rgba(3, 16, 42, .93) 100%),
    url("../images/bg-1824.png");
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  background-attachment: fixed, fixed;
}

/* ---------- card ---------- */
.auth-card {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 404px;
  margin: auto;
  background: #fff;
  border-radius: 10px;
  padding: 34px 30px 26px;
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .85), 0 2px 8px -3px rgba(0, 0, 0, .4);
}
.auth-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--auth-brand) 0%, #2f7fe0 65%, var(--auth-accent) 100%);
}

/* ---------- header ---------- */
.auth-logo { text-align: center; margin-bottom: 18px; }
.auth-logo a { display: inline-block; }
.auth-logo img { max-height: 56px; max-width: 200px; width: auto; height: auto; }

.auth-title {
  margin: 0 0 4px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.2px;
  text-align: center;
  color: var(--auth-text);
}
.auth-sub {
  margin: 0 0 22px;
  text-align: center;
  font-size: 13.5px;
  color: var(--auth-muted);
}

/* ---------- flash alerts ---------- */
.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.4;
  margin-bottom: 16px;
  border: 1px solid transparent;
  text-align: left;
}
.auth-alert i { margin-top: 2px; font-size: 14px; }
.auth-alert.is-danger { color: var(--auth-danger); background: var(--auth-danger-bg); border-color: var(--auth-danger-bd); }
.auth-alert.is-success { color: var(--auth-success); background: var(--auth-success-bg); border-color: var(--auth-success-bd); }

/* ---------- form fields ---------- */
.auth-field { margin-bottom: 15px; }
.auth-label {
  display: block;
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--auth-label);
}
.auth-control { position: relative; }
.auth-control > i.fa,
.auth-control > i.glyphicon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--auth-icon);
  font-size: 14px;
  pointer-events: none;
  z-index: 2;
}
.auth-control input.form-control,
.auth-control input.input-text {
  width: 100%;
  height: 44px;
  padding: 0 42px 0 39px;
  border-radius: 8px;
  border: 1px solid var(--auth-border);
  background: #fff;
  color: var(--auth-text);
  font-size: 14.5px;
  line-height: 44px;
  box-shadow: none;
  transition: border-color .15s, box-shadow .15s;
}
.auth-control input.form-control::placeholder,
.auth-control input.input-text::placeholder { color: #a7b0bd; }
.auth-control input.form-control:focus,
.auth-control input.input-text:focus {
  outline: none;
  border-color: var(--auth-brand);
  box-shadow: 0 0 0 3px var(--auth-ring);
}
.auth-control .auth-eye {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--auth-icon);
  cursor: pointer;
  padding: 7px 8px;
  font-size: 14px;
  line-height: 1;
  z-index: 2;
}
.auth-control .auth-eye:hover { color: var(--auth-brand); }

/* ---------- button ---------- */
.auth-btn {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .1px;
  color: #fff;
  cursor: pointer;
  background: var(--auth-brand);
  transition: background .15s;
}
.auth-btn:hover { background: var(--auth-brand-dark); }
.auth-btn:focus { outline: none; box-shadow: 0 0 0 3px var(--auth-ring); }
.auth-btn:disabled { opacity: .6; cursor: default; }

/* ---------- links / footer ---------- */
.auth-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 15px;
  font-size: 13.5px;
}
.auth-links a { color: var(--auth-brand); font-weight: 600; text-decoration: none; }
.auth-links a:hover { color: var(--auth-brand-dark); text-decoration: underline; }
.auth-links .spacer { flex: 1 1 auto; }

.auth-version {
  margin: 20px 0 0;
  text-align: center;
  font-size: 12px;
  color: #9aa4b2;
}

/* ---------- language selector ---------- */
.language-wrap {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 60;
  margin: 0;
}
.language-wrap .form-group { margin: 0; width: auto !important; float: none !important; padding: 0; }
.language-wrap select,
.language-wrap .language_id {
  margin: 0 !important;
  height: 34px;
  min-width: 124px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 7px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
  background-color: rgba(255, 255, 255, .94);
  cursor: pointer;
}
.language-wrap select option { color: #0f172a; }
.language-wrap select:focus { outline: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, .45); }

/* ---------- demo accounts ---------- */
.auth-demo {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #eef1f5;
}
.auth-demo > label { font-size: 12.5px; color: var(--auth-muted); font-weight: 600; }
.auth-demo table { width: 100%; margin: 9px 0 8px; border-collapse: collapse; }
.auth-demo table td {
  padding: 6px 8px;
  font-size: 12.5px;
  border: 1px solid #e6ebf1;
  color: #475569;
  background: #fafbfd;
}
.auth-demo table tr td:first-child { font-weight: 600; color: #334155; }
.auth-demo .auth-mini-btn {
  border: 0;
  border-radius: 6px;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  background: var(--auth-brand);
}
.auth-demo .auth-mini-btn:hover { background: var(--auth-brand-dark); }
.auth-demo .auth-demo-note {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  font-size: 12px;
  color: #92400e;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  /* fixed backgrounds are janky on mobile - scroll with the page instead */
  body.auth-page { background-attachment: scroll, scroll; }
}
@media (max-width: 420px) {
  body.auth-page { padding: 60px 12px 20px; }
  .auth-card { padding: 26px 20px 22px; }
  .auth-title { font-size: 19px; }
  .language-wrap { top: 12px; right: 12px; }
}

/* Thai text sits a touch smaller at the same size - nudge headings */
body.lang-thai .auth-title { font-size: 20px; }
