:root{
  --bg:#0b1119;
  --card:rgba(17,24,38,.90);
  --card-2:rgba(15,23,34,.90);
  --text:#dbe6ff;
  --muted:#8ea3c7;
  --input:#0f172a;
  --primary:#3b82f6;
  --primary-2:#2563eb;
  --radius:12px;
  --line:rgba(255,255,255,.14);
  --line-2:rgba(255,255,255,.10);

  /* ฟอร์มโทนสว่าง */
  --field-bg:#eef3ff;
  --field-border:#cdd9f0;
  --field-text:#0b1119;
  --field-muted:#6b7a99;
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font:16px/1.7 "Segoe UI",Roboto,Ubuntu,"Helvetica Neue","Noto Sans",Arial,sans-serif;
}

.screen{
  min-height:100vh;
  display:grid;
  place-items:center;
  background-position:center;
  background-size:cover;
  background-repeat:no-repeat;
  padding:24px;
}

/* ✅ background สำหรับหน้า register */
.bg-hero { background-image:url('/image/background.jpeg'); }

.card{
  width:min(460px,94vw);
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:none; /* ❌ no shadow */
  padding:28px 26px 22px;
  backdrop-filter:blur(6px);
}

.brand{
  display:flex;align-items:center;justify-content:center;margin-bottom:8px
}
/* โลโก้เป็นวงกลม */
.brand img{
  width:56px;height:56px; border-radius:9999px;
  border:2px solid rgba(255,255,255,.55); object-fit:cover;
}

h1{
  font-size:22px;
  font-weight:700;
  margin:4px 0 0;
  text-align:center;
}
.subtitle{
  font-size:13.5px;
  margin:6px 0 16px;
  text-align:center;
  color:var(--muted);
}

.form-group{margin:14px 0}

label{
  display:block;
  margin:0 0 6px;
  color:#c9d4ec;
  font-weight:600;
  font-size:14px;
}

/* ------- ช่องกรอกแบบอ่อน + ไอคอนในช่อง ------- */
input[type=text],input[type=password]{
  width:100%;
  height:50px;
  border-radius:10px;
  border:1px solid var(--field-border);
  background:var(--field-bg);
  color:var(--field-text);
  padding:0 16px;
  font-size:16px;
  outline:none;
  transition:border .2s,outline .2s;
  box-shadow:none;
}
input::placeholder{ color:var(--field-muted); opacity:1; }

input:focus{
  border-color:rgba(37,99,235,.85);
  outline:2px solid rgba(37,99,235,.25);
  outline-offset:0;
  box-shadow:none;
}

/* ไอคอนสำหรับช่องผู้ใช้และรหัสผ่าน (ไม่ต้องแก้ HTML) */
#user{
  padding-left:44px;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7a99' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/><circle cx='12' cy='7' r='4'/></svg>");
  background-repeat:no-repeat; background-size:20px 20px; background-position:12px center;
}
#pass{
  padding-left:44px;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7a99' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='11' width='18' height='11' rx='2'/><path d='M7 11V7a5 5 0 0 1 10 0v4'/><circle cx='12' cy='16' r='1.75'/></svg>");
  background-repeat:no-repeat; background-size:20px 20px; background-position:12px center;
}

#pwMeter{
  height:6px;
  background:#dfe7fb;
  border-radius:999px;
  margin:8px 0 0;
  position:relative;
  overflow:hidden;
}
#pwMeter span{
  position:absolute;
  left:0;top:0;bottom:0;
  width:0%;
  background:linear-gradient(90deg,#f87171,#f59e0b,#22c55e);
  transition:width .25s ease;
}

.captcha-box{display:flex;align-items:center;gap:10px}
.captcha-box img{
  height:50px;
  border-radius:10px;
  border:1px solid var(--field-border);
  background:#fff;
  box-shadow:none;
}

.btn{
  width:100%;
  height:50px;
  border-radius:10px;
  margin-top:10px;
  background:var(--primary);
  border:1px solid rgba(37,99,235,.65);
  color:#fff;
  font-weight:700;
  font-size:16px;
  letter-spacing:.2px;
  cursor:pointer;
  box-shadow:none;
  transition:background .15s ease, border-color .15s ease, transform .08s ease;
}
.btn:hover:not(:disabled){
  background:var(--primary-2);
  border-color:rgba(37,99,235,.85);
  transform:translateY(-1px);
}
.btn:disabled{opacity:.6;cursor:not-allowed}

.btn-ghost{
  height:50px;
  padding:0 14px;
  border-radius:10px;
  border:1px solid var(--line-2);
  background:#0f1a2a;
  color:#cbd5e1;
  cursor:pointer;
  font-size:14.5px;
  box-shadow:none;
  transition:background .2s;
}
.btn-ghost:hover{background:#152033}

.error{
  display:none;
  padding:12px 14px;
  margin:10px 0 12px;
  border-radius:10px;
  background:rgba(239,68,68,.10);
  border:1px solid rgba(239,68,68,.35);
  color:#b91c1c;
  font-size:14px;
  box-shadow:none;
}
.error:not([hidden]){display:block}

.footer{
  text-align:center;
  margin-top:16px;
  color:var(--muted);
  font-size:13px;
}
.footer a{color:#3fa2ff;text-decoration:none}
.footer a:hover{text-decoration:underline}
.copy{margin-top:6px;opacity:.75}

/* ===== Password show/hide button (SVG inline, ไม่ใช้ไฟล์รูป) ===== */
.pw-box{position:relative;display:flex;align-items:center}
.pw-box input{flex:1;padding-right:44px}

.pw-toggle{
  position:absolute;
  right:10px;
  width:30px;height:30px;
  border:0;
  background:none;                /* ❌ ไม่ใช้ภาพไฟล์ */
  cursor:pointer;
  border-radius:6px;
  box-shadow:none;
  opacity:.85;
  display:flex;align-items:center;justify-content:center;
  transition:opacity .2s;
}
.pw-toggle:hover{opacity:1;}

.pw-toggle::before{
  content:"";
  display:block;
  width:22px;height:22px;
  background-repeat:no-repeat;
  background-position:center;
  background-size:contain;
  /* eye */
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%236b7a99' stroke-width='2' viewBox='0 0 24 24'><path d='M1 12s4-7 11-7 11 7 11 7-4 7-11 7S1 12 1 12z'/><circle cx='12' cy='12' r='3'/></svg>");
}

/* เมื่อกำลัง “แสดงรหัสผ่าน” → eye-off */
.pw-toggle.showing::before{
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%236b7a99' stroke-width='2' viewBox='0 0 24 24'><path d='M17.94 17.94A10.97 10.97 0 0 1 12 20c-7 0-11-8-11-8a21.73 21.73 0 0 1 5.06-6.94'/><path d='M9.9 4.24A10.97 10.97 0 0 1 12 4c7 0 11 8 11 8a21.73 21.73 0 0 1-4.07 5.38'/><path d='M1 1l22 22'/></svg>");
}

/* ปรับธีม autofill ของ Chrome ให้เข้าชุด */
input:-webkit-autofill,
input:-webkit-autofill:focus{
  -webkit-box-shadow: 0 0 0 30px var(--field-bg) inset !important;
  -webkit-text-fill-color: var(--field-text) !important;
  caret-color: var(--field-text);
}

/* ลดแอนิเมชันสำหรับผู้ใช้ที่ไม่ชอบ motion */
@media (prefers-reduced-motion: reduce){
  *{transition:none !important}
}
