/* ============ Auth pages (login / register / 2fa) ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', 'Noto Sans Thai', -apple-system, 'Segoe UI', sans-serif;
  color: #0f172a;
  background:
    radial-gradient(1200px 700px at 20% 10%, rgba(99,102,241,0.10), transparent 55%),
    radial-gradient(1000px 600px at 90% 90%, rgba(37,99,235,0.08), transparent 55%),
    linear-gradient(180deg, #f6f7fb 0%, #eceff5 100%);
  min-height: 100%;
  display: grid; place-items: center;
  padding: 32px 16px;
  -webkit-font-smoothing: antialiased;
}

.auth-card {
  width: 100%; max-width: 400px;
  background: #ffffff;
  border: 1px solid #e4e7ee;
  border-radius: 16px;
  box-shadow: 0 24px 48px -12px rgba(15,23,42,0.15), 0 4px 12px -4px rgba(15,23,42,0.06);
  overflow: hidden;
}
.auth-card__head {
  padding: 28px 28px 6px;
  text-align: center;
}
.auth-mark {
  width: 44px; height: 44px;
  border-radius: 11px;
  background: linear-gradient(135deg, #6366f1 0%, #2563eb 100%);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 4px 12px -2px rgba(37,99,235,0.5);
}
.auth-title {
  font-size: 20px; font-weight: 700;
  letter-spacing: -0.01em;
  color: #0f172a;
  margin-bottom: 4px;
}
.auth-sub {
  font-size: 13px; color: #64748b;
  font-weight: 500;
  line-height: 1.55;
}

.auth-card__body {
  padding: 20px 28px 12px;
  display: flex; flex-direction: column; gap: 14px;
}
.field {
  display: flex; flex-direction: column; gap: 6px;
}
.field > label, .field > .label {
  font-size: 12px; font-weight: 600;
  color: #475569;
  letter-spacing: 0.02em;
}
.field input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 14px;
  color: #0f172a;
  background: #ffffff;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.field input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.field__hint {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
  margin-top: 2px;
}

.err {
  padding: 10px 12px;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  color: #991b1b;
  font-size: 12.5px;
  font-weight: 500;
}
.ok {
  padding: 10px 12px;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 8px;
  color: #166534;
  font-size: 12.5px;
  font-weight: 500;
}

.auth-card__foot {
  padding: 12px 28px 24px;
  display: flex; flex-direction: column; gap: 12px;
}
.btn {
  height: 42px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 13.5px; font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .12s, transform .1s, box-shadow .12s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:active { transform: scale(0.98); }
.btn--primary {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  border-color: #1d4ed8;
  box-shadow: 0 2px 6px -2px rgba(37,99,235,0.55);
}
.btn--primary:hover { background: linear-gradient(180deg, #2563eb 0%, #1e40af 100%); }
.btn--primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn--ghost {
  background: transparent;
  color: #475569;
}
.btn--ghost:hover { color: #0f172a; background: #f1f5f9; }

.divider {
  text-align: center;
  font-size: 11.5px;
  color: #94a3b8;
  font-weight: 500;
}
.divider a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 700;
  margin-left: 4px;
}
.divider a:hover { color: #1d4ed8; text-decoration: underline; }

/* 2FA specific */
.qr-wrap {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}
.qr-wrap img {
  width: 180px; height: 180px;
  border-radius: 6px;
  background: #fff;
}
.qr-secret {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 6px 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  color: #334155;
  letter-spacing: 0.05em;
  user-select: all;
  cursor: pointer;
  word-break: break-all;
  max-width: 100%;
  text-align: center;
}
.qr-note {
  font-size: 12px;
  color: #64748b;
  text-align: center;
  line-height: 1.55;
}

.code-input {
  width: 100%;
  height: 56px;
  padding: 0 16px;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 26px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.5em;
  text-align: center;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.code-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37,99,235,0.12);
}

.step-list {
  list-style: none;
  padding: 0;
  display: flex; flex-direction: column; gap: 10px;
  font-size: 12.5px;
  color: #334155;
}
.step-list li {
  display: flex; gap: 10px; align-items: flex-start;
  line-height: 1.55;
}
.step-list__num {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #dbeafe; color: #1d4ed8;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}
