/* ===== หน้าเข้าสู่ระบบ / สมัครสมาชิก (ตาม template ระบบเดิม: assets/app.css) ===== */

.auth-body {
  --brand: #0f4c81;
  --brand-dark: #0b3a63;
  --accent: #c9a24b;
  --auth-bg: #f4f6f8;
  --auth-card: #fff;
  --auth-border: #e2e5e9;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  font-family: "IBM Plex Sans Thai", "Sarabun", "Noto Sans Thai", "Segoe UI", sans-serif;
  background:
    radial-gradient(1200px 400px at 50% -120px, rgba(15, 76, 129, .10), transparent 70%),
    var(--auth-bg);
  color: #1f2937;
}

/* ---------- ส่วนหัว (แถบไล่สีแบบเดิม) ---------- */
.auth-header {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  padding: 18px 24px;
  box-shadow: 0 2px 10px rgba(11, 58, 99, .25);
  position: relative;
}
.auth-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), rgba(201, 162, 75, 0));
}
.auth-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}
.auth-header h1 { font-size: 1.2rem; margin: 0; font-weight: 600; line-height: 1.4; }
.auth-header .sub { font-size: .82rem; opacity: .85; }
.auth-logo {
  height: 46px;
  width: auto;
  padding: 3px 8px;
  border-radius: 10px;
  background: #fff;
}
.auth-card-logo {
  text-align: center;
  margin: -4px 0 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--auth-border);
}
.auth-card-logo img {
  max-width: 100%;
  height: 84px;
  width: auto;
}
.auth-emblem {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 1.3rem;
  background: rgba(255, 255, 255, .14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
}

/* ---------- กล่องฟอร์ม ---------- */
.auth-wrap {
  flex: 1;
  width: 100%;
  max-width: 440px;
  margin: 56px auto 32px;
  padding: 0 16px;
}
.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: var(--auth-card);
  border: 1px solid var(--auth-border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.auth-tabs a {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: 10px;
  font-size: .92rem;
  font-weight: 500;
  color: #6b7280;
  text-decoration: none;
  border-radius: 9px;
  transition: background-color .15s ease, color .15s ease;
}
.auth-tabs a:hover { color: var(--brand); background: rgba(15, 76, 129, .06); }
.auth-tabs a.active {
  color: #fff;
  background: var(--brand);
  box-shadow: 0 2px 6px rgba(15, 76, 129, .3);
}
.auth-card {
  padding: 26px 24px 22px;
  background: var(--auth-card);
  border: 1px solid var(--auth-border);
  border-radius: 14px;
  box-shadow: 0 10px 30px -12px rgba(15, 23, 42, .18), 0 1px 3px rgba(15, 23, 42, .06);
}
.auth-form .form-label { font-size: .85rem; font-weight: 600; color: #374151; margin-bottom: .35rem; }
.auth-form .form-control,
.auth-form .form-select { padding-top: .55rem; padding-bottom: .55rem; border-color: #d6dbe1; }
.auth-form .input-group-text { background: #f8fafc; color: #6b7280; border-color: #d6dbe1; }
.auth-form .form-control:focus,
.auth-form .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 .2rem rgba(15, 76, 129, .15);
}
.auth-form .input-group:focus-within .input-group-text { border-color: var(--brand); color: var(--brand); }
.auth-form .form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.auth-form .form-check-label { font-size: .88rem; color: #4b5563; }
.btn-auth {
  margin-top: 4px;
  padding: .65rem 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  border: 0;
  border-radius: 10px;
}
.btn-auth:hover,
.btn-auth:focus-visible { color: #fff; background: var(--brand-dark); }
.auth-note {
  display: flex;
  gap: .6rem;
  margin: 4px 0 16px;
  padding: .7rem .85rem;
  font-size: .82rem;
  line-height: 1.6;
  color: #6b5a24;
  border-radius: 10px;
  background: rgba(201, 162, 75, .12);
  border: 1px solid rgba(201, 162, 75, .3);
}
.auth-note .bi { color: var(--accent); margin-top: .1rem; }
.auth-alt { margin: 16px 0 0; text-align: center; font-size: .88rem; color: #6b7280; }
.auth-alt a { color: var(--brand); font-weight: 600; text-decoration: none; }
.auth-alt a:hover { text-decoration: underline; }
.auth-wrap .alert { border-radius: 12px; font-size: .88rem; }

.auth-footer { text-align: center; padding: 20px; color: #6b7280; font-size: .78rem; }

@media (max-width: 575.98px) {
  .auth-header { padding: 14px 16px; }
  .auth-header h1 { font-size: 1rem; }
  .auth-logo { height: 38px; }
  .auth-wrap { margin-top: 28px; }
  .auth-card { padding: 20px 16px; }
}
.auth-footer a { color: inherit; }
.auth-footer a:hover { color: var(--brand); }

/* ---------- หน้าเข้าสู่ระบบแบบ 2 ส่วน: ฟอร์ม (ซ้าย) + แดชบอร์ดย่อ (ขวา) ---------- */
.auth-wrap-split {
  max-width: 1040px;
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 860px) {
  .auth-wrap-split { grid-template-columns: 1fr; max-width: 520px; }
}
.auth-aside { min-width: 0; }
/* เว้นระยะให้แนวบนตรงกับการ์ดฟอร์ม (ใต้แท็บ) */
@media (min-width: 861px) {
  .auth-aside { padding-top: 66px; }
}

/* สีระดับคำสั่ง (ชุดเดียวกับแดชบอร์ด) */
.auth-body .lvl-policy { --lvl: #4f46e5; }
.auth-body .lvl-drive  { --lvl: #0d9488; }
.auth-body .lvl-ops    { --lvl: #d97706; }
.auth-body .lvl-none   { --lvl: #94a3b8; }

.auth-dash-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.auth-dash-head > div:first-child { flex: 1; min-width: 0; }
.auth-dash-kicker { font-size: .78rem; font-weight: 600; color: var(--brand); }
.auth-dash-title { font-size: 1.1rem; font-weight: 700; margin: 2px 0 2px; }
.auth-dash-sub { font-size: .78rem; color: #6b7280; }
.auth-dash-total {
  flex: none;
  min-width: 88px;
  padding: 8px 12px;
  text-align: center;
  border-radius: 12px;
  background: rgba(15, 76, 129, .07);
}
.auth-dash-total b { display: block; font-size: 1.6rem; line-height: 1.1; color: var(--brand); font-variant-numeric: tabular-nums; }
.auth-dash-total span { font-size: .75rem; color: #6b7280; }

.auth-stack { display: flex; gap: 2px; height: 12px; margin-bottom: 14px; }
.auth-stack > span { display: block; min-width: 4px; background: var(--lvl); }
.auth-stack > span:first-child { border-radius: 4px 0 0 4px; }
.auth-stack > span:last-child { border-radius: 0 4px 4px 0; }

.auth-dash-table { font-size: .9rem; --bs-table-bg: transparent; font-variant-numeric: tabular-nums; }
.auth-dash-table thead th { font-size: .78rem; font-weight: 600; color: #6b7280; }
.auth-dash-table tfoot th { border-top: 2px solid #d6dbe1; border-bottom: 0; }
.lvl-chip {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  padding: .15rem .6rem;
  font-size: .8rem;
  font-weight: 600;
  border-radius: 999px;
  color: var(--lvl);
  background: color-mix(in srgb, var(--lvl) 12%, transparent);
}
.lvl-chip::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--lvl); }
.auth-dash-note { margin: 12px 0 0; font-size: .8rem; color: #6b7280; }

/* ---------- แดชบอร์ดย่อ: การตรวจสอบยืนยันข้อมูล ---------- */
.auth-body { --cf-ok: #0ca30c; --cf-partial: #fab219; --cf-none: #d03b3b; --cf-empty: #94a3b8; }
.auth-dash-h { font-size: .88rem; font-weight: 700; margin: 4px 0 8px; color: #374151; }
.auth-cf-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.auth-cf-kpis > div { padding: 8px 10px; border-radius: 10px; background: #f8fafc; border: 1px solid var(--auth-border); }
.auth-cf-kpis span { display: block; font-size: .75rem; color: #6b7280; }
.auth-cf-kpis b { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.auth-cf-bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: #eef1f4; }
.auth-cf-bar-lg { height: 12px; }
.auth-cf-bar > span { display: block; }
.auth-cf-bar > span + span { box-shadow: -2px 0 0 #fff; }
.auth-cf-bar > .cf-ok { background: var(--cf-ok); }
.auth-cf-bar > .cf-partial { background: var(--cf-partial); }
.auth-cf-bar > .cf-none { background: var(--cf-none); }
.auth-cf-bar > .cf-empty { background: var(--cf-empty); }
.cf-c-ok { color: var(--cf-ok); }
.cf-c-partial { color: color-mix(in srgb, var(--cf-partial) 70%, #000); }
.cf-c-none { color: var(--cf-none); }
.cf-c-empty { color: var(--cf-empty); }
.auth-cf-th { font-size: .72rem; }
@media (max-width: 560px) { .auth-cf-th { display: none; } }
@media (forced-colors: active) { .auth-cf-bar { border: 1px solid CanvasText; } }
