/* หน้าเข้าสู่ระบบและหน้าลงทะเบียนของ TGIX Linkage Sandbox
   จัดวางแบบคอลัมน์เดียวกลางจอ ตามรูปแบบที่ระบบราชการไทยใช้กันทั่วไป
   ฟอนต์อยู่ในไฟล์ fonts.css ของธีมเดียวกัน */

:root {
  --brand: #ee5020;
  --brand-dark: #d8431a;
  --brand-tint: rgba(238, 80, 32, .12);
  --ink: #1d2939;
  --muted: #667085;
  --faint: #98a2b3;
  --line: #e4e7ec;
  --field: #f2f4f7;
  --surface: #fff;
  --danger: #d92d20;
  --warn: #b54708;
  --ok: #027a48;
}

*, *::before, *::after { box-sizing: border-box; }

body.tgix-body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.25rem;
  background: var(--surface);
  font-family: 'Prompt', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
}

.tgix-page {
  width: 100%;
  max-width: 35rem;
}

/* ------------------------------------------------------------ หัวเรื่อง */

.tgix-head { text-align: center; margin-bottom: 2.25rem; }

.tgix-title {
  margin: 0;
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--ink);
}

.tgix-subtitle {
  margin: .5rem 0 0;
  font-size: 1rem;
  color: var(--muted);
}

/* ------------------------------------------------------ ช่องกรอกข้อมูล */

.tgix-form { display: grid; gap: 1.25rem; }

.tgix-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }

.tgix-field { display: grid; gap: .5rem; }

.tgix-field label {
  font-size: .9375rem;
  font-weight: 500;
  color: var(--ink);
}

.tgix-control {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--field);
  border: 1.5px solid transparent;
  border-radius: 10px;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.tgix-control:focus-within {
  background: var(--surface);
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-tint);
}

.tgix-icon {
  position: absolute;
  left: 1.05rem;
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: var(--faint);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.tgix-control:focus-within .tgix-icon { stroke: var(--brand-dark); }

.tgix-control input {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 3.5rem;
  padding: 0 1.05rem;
  border: 0;
  background: transparent;
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
}
.tgix-control:has(.tgix-icon) input { padding-left: 3.15rem; }
.tgix-control input:focus { outline: none; }
.tgix-control input::placeholder { color: var(--faint); }

.tgix-eye {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.5rem;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.tgix-eye svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: var(--faint); stroke-width: 1.8; }
.tgix-eye:hover svg, .tgix-eye.is-on svg { stroke: var(--brand-dark); }

.tgix-error { margin: 0; font-size: .875rem; color: var(--danger); }

/* ------------------------------------------------------- แถวตัวเลือก */

.tgix-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  font-size: .9375rem;
}
.tgix-row:has(.tgix-check) { justify-content: space-between; }

.tgix-check { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); cursor: pointer; }
.tgix-check input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: var(--brand);
  cursor: pointer;
}

.tgix-row a { color: var(--ink); text-decoration: none; }
.tgix-row a:hover { color: var(--brand-dark); text-decoration: underline; }

/* ------------------------------------------------------------- ปุ่ม */

.tgix-submit {
  width: 100%;
  height: 3.5rem;
  margin-top: .5rem;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-family: inherit;
  font-size: 1.0625rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease, transform .1s ease;
}
.tgix-submit:hover { background: var(--brand-dark); }
.tgix-submit:active { transform: translateY(1px); }
.tgix-submit:disabled { opacity: .55; cursor: default; }

/* ปุ่มรอง เช่น ไปหน้าลงทะเบียน */
.tgix-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 3.5rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease;
}
.tgix-secondary:hover { border-color: var(--brand); background: #fff8f5; color: var(--brand-dark); }

/* ------------------------------------------------------------ เส้นคั่น */

.tgix-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.75rem 0 1.25rem;
  color: var(--faint);
  font-size: .9375rem;
}
.tgix-divider::before, .tgix-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ------------------------------------------------------ ข้อความแจ้งเตือน */

.tgix-note {
  margin: 0 0 1.5rem;
  padding: .85rem 1.05rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: .9375rem;
  line-height: 1.7;
}
.tgix-note-error   { background: #fef3f2; border-color: #fecdca; color: var(--danger); }
.tgix-note-warning { background: #fffaeb; border-color: #fedf89; color: var(--warn); }
.tgix-note-success { background: #ecfdf3; border-color: #a6f4c5; color: var(--ok); }
.tgix-note-info    { background: #f9fafb; border-color: var(--line); color: var(--muted); }

/* --------------------------------------------------------- ส่วนท้าย */

.tgix-foot {
  margin-top: 2.5rem;
  text-align: center;
  font-size: .875rem;
  line-height: 1.9;
  color: var(--muted);
}
.tgix-foot p { margin: 0; }
.tgix-foot p + p { margin-top: .5rem; font-size: .8125rem; color: var(--faint); }

/* ------------------------------------------------------------ จอเล็ก */

@media (max-width: 30rem) {
  body.tgix-body { padding: 2rem 1rem; align-items: flex-start; }
  .tgix-title { font-size: 1.6rem; }
  .tgix-subtitle { font-size: .9375rem; }
  .tgix-grid-2 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .001ms !important; }
}
