/* auth.css — หน้าเข้าสู่ระบบ / ความยินยอม / ผู้ดูแลระบบ
   ใช้โทเคนสีและฟอนต์จาก app.css ไม่นิยามสีเองเพื่อให้เปลี่ยนธีมที่เดียวจบ
   และได้ dark mode ตามที่ app.css ตั้งไว้แล้วโดยอัตโนมัติ */

body.auth {
  margin: 0;
  min-height: 100vh;
  background: var(--plane);
  color: var(--ink);
  font-family: 'Anuphan', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}
body.auth.wide { justify-content: flex-start; }

.card {
  width: 100%;
  max-width: 420px;
  background: var(--raised);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 32px;
  box-sizing: border-box;
}
.card.lg   { max-width: 760px; }
.card.xl   { max-width: 1100px; }

.au-brand { text-align: center; margin-bottom: 24px; }
.au-brand h1 { font-size: 20px; font-weight: 600; margin: 0 0 4px; letter-spacing: -.01em; }
.au-brand p  { font-size: 14px; color: var(--ink-3); margin: 0; }

h2.section { font-size: 17px; font-weight: 600; margin: 28px 0 10px; }
h2.section:first-of-type { margin-top: 0; }

label { display: block; font-size: 14px; font-weight: 500; margin: 14px 0 6px; }
input[type=text], input[type=password], select {
  width: 100%;
  padding: 11px 13px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 9px;
  box-sizing: border-box;
}
input:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

button {
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  color: #fff;
  background: var(--accent-text);
  border: 0;
  border-radius: 9px;
  padding: 12px 18px;
  cursor: pointer;
  width: 100%;
  margin-top: 20px;
}
button:hover:not(:disabled) { filter: brightness(1.1); }
button:disabled { opacity: .55; cursor: not-allowed; }
button.secondary {
  background: transparent;
  color: var(--accent-text);
  border: 1px solid var(--rule);
}
button.inline { width: auto; margin: 0; padding: 6px 12px; font-size: 13px; }

.msg {
  margin-top: 16px;
  padding: 11px 14px;
  border-radius: 9px;
  font-size: 14px;
  display: none;
}
.msg.show  { display: block; }
.msg.error { background: rgba(208,59,59,.10); color: var(--ink); border: 1px solid rgba(208,59,59,.35); }
.msg.ok    { background: rgba(12,163,12,.10);  color: var(--ink); border: 1px solid rgba(12,163,12,.35); }

.note {
  font-size: 13px;
  color: var(--ink-3);
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
}

/* --- หน้าความยินยอม --- */
.consent-body {
  max-height: 46vh;
  overflow-y: auto;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 20px 22px;
  background: var(--surface);
  font-size: 14.5px;
}
.consent-body h3 { font-size: 15px; font-weight: 600; margin: 20px 0 6px; }
.consent-body h3:first-child { margin-top: 0; }
.consent-body ul { margin: 6px 0; padding-left: 20px; }
.consent-body li { margin: 4px 0; }
.consent-body strong { font-weight: 600; }

.callout {
  border-left: 3px solid var(--warning);
  background: rgba(250,178,25,.08);
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  margin: 12px 0;
}

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 20px;
  font-size: 14.5px;
  cursor: pointer;
}
.check input { margin-top: 4px; width: 17px; height: 17px; flex: none; cursor: pointer; }

/* --- ตาราง --- */
table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 12px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--hairline); }
th { font-weight: 600; color: var(--ink-2); font-size: 13px; white-space: nowrap; }
td.mono, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.scroll { overflow-x: auto; }

.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--rule);
  color: var(--ink-2);
}
.pill.off { color: var(--critical); border-color: rgba(208,59,59,.45); }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--hairline); margin-bottom: 20px; }
.tab {
  padding: 10px 16px; cursor: pointer; font-size: 15px; font-weight: 500;
  color: var(--ink-3); border-bottom: 2px solid transparent; background: none; border-top: 0;
  border-left: 0; border-right: 0; width: auto; margin: 0; border-radius: 0;
}
.tab.active { color: var(--accent-text); border-bottom-color: var(--accent-text); }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > div { flex: 1 1 180px; }
.au-topbar {
  width: 100%; max-width: 1100px; display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 18px; font-size: 14px;
}
.au-topbar a { color: var(--accent-text); text-decoration: none; }
.au-topbar a:hover { text-decoration: underline; }

/* แถบบนของหน้าเข้าสู่ระบบ — ลิงก์กลับหน้าหลักและปุ่มสลับธีม
   ใช้ position:fixed เพราะ body.auth จัดกึ่งกลางแนวตั้ง การ์ดจึงลอยอยู่กลางจอ
   ถ้าวางแถบนี้ไว้ในสายการจัดวางปกติ การ์ดจะถูกดันลงจนไม่อยู่กึ่งกลางอีก */
.au-toprow{position:fixed;top:16px;left:0;right:0;z-index:5;
  display:flex;align-items:center;justify-content:space-between;
  padding:0 20px;pointer-events:none}
.au-toprow > *{pointer-events:auto}
.au-back{display:inline-flex;align-items:center;gap:7px;font-size:14px;font-weight:600;
  text-decoration:none;color:var(--ink-2);padding:8px 14px 8px 10px;
  border:1px solid var(--rule);border-radius:999px;background:var(--raised)}
.au-back:hover{color:var(--accent-text);border-color:var(--accent-text)}
.au-back svg{width:17px;height:17px}
@media (max-width:480px){.au-back span{display:none}}
