:root {
  --bg: #07111f;
  --panel: rgba(10, 20, 38, 0.72);
  --panel-strong: rgba(12, 24, 45, 0.9);
  --line: rgba(255,255,255,.1);
  --text: #eef4ff;
  --muted: rgba(222,232,255,.7);
  --accent: #6ea8fe;
  --accent-2: #6cf0c2;
  --danger: #ff8d8d;
  --warning: #f7d87b;
  --shadow: 0 20px 80px rgba(0, 0, 0, .42);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(110,168,254,.18), transparent 30%),
    radial-gradient(circle at 90% 20%, rgba(108,240,194,.12), transparent 25%),
    linear-gradient(135deg, #050b14 0%, #0a1324 40%, #070d18 100%);
  overflow-x: hidden;
}
.ambient { position: fixed; inset: auto; border-radius: 50%; filter: blur(40px); pointer-events: none; z-index: 0; }
.ambient-a { width: 320px; height: 320px; background: rgba(110,168,254,.2); top: 6%; left: 4%; }
.ambient-b { width: 380px; height: 380px; background: rgba(108,240,194,.12); right: 5%; bottom: 10%; }
.grid-overlay {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at center, black 40%, transparent 82%);
}
.shell {
  position: relative; z-index: 1; min-height: 100vh; max-width: 1280px; margin: 0 auto;
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 32px; align-items: center; padding: 36px;
}
.hero-panel, .glass-card {
  background: var(--panel); backdrop-filter: blur(18px); border: 1px solid var(--line);
  border-radius: 28px; box-shadow: var(--shadow);
}
.hero-panel { padding: 40px; position: relative; overflow: hidden; }
.hero-badge, .eyebrow {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px; background: rgba(255,255,255,.04); color: var(--muted); font-size: 13px;
}
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 14px var(--accent-2); }
.hero-panel h1 { margin: 22px 0 12px; font-size: clamp(38px, 6vw, 68px); line-height: 0.98; }
.hero-copy { max-width: 700px; color: var(--muted); font-size: 16px; line-height: 1.7; }
.feature-list { display: grid; gap: 16px; margin-top: 28px; }
.feature-list article, .status-strip > div, .meta-box, .security-note, .inline-alert, .onboard-box {
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07); border-radius: 18px;
}
.feature-list article { display: flex; gap: 16px; padding: 18px; align-items: center; }
.feature-list i { font-size: 18px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: rgba(110,168,254,.14); color: #aecdff; }
.feature-list strong { display: block; margin-bottom: 4px; }
.feature-list span { color: var(--muted); font-size: 14px; }
.status-strip { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-top: 28px; }
.status-strip > div { padding: 16px; }
.status-strip span { display:block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.status-strip strong { font-size: 15px; }
.login-panel { display: flex; justify-content: center; }
.glass-card { width: min(100%, 480px); padding: 28px; position: relative; overflow: hidden; }
.card-topline { position: absolute; inset: 0 auto auto 0; width: 100%; height: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2), transparent); }
.brand-row { display: flex; gap: 16px; align-items: center; }
.brand-icon, .modal-icon { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; font-size: 22px; background: linear-gradient(145deg, rgba(110,168,254,.18), rgba(108,240,194,.14)); border: 1px solid rgba(255,255,255,.1); }
.glass-card h2, .modal-card h3 { margin: 8px 0 0; font-size: 28px; }
.login-subtext, .modal-head p, .onboard-copy { color: var(--muted); line-height: 1.7; }
.login-form { display: grid; gap: 14px; margin-top: 22px; }
.field-label { font-size: 14px; color: rgba(236,243,255,.82); }
.input-shell {
  display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 12px;
  padding: 0 16px; min-height: 58px; border-radius: 18px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
}
.input-shell input, .secret-wrap input { width: 100%; background: transparent; border: 0; outline: none; color: var(--text); font-size: 15px; }
.input-shell i:first-child { color: rgba(221,234,255,.62); }
.ghost-btn, .meta-copy, .modal-close, .secret-wrap button {
  border: 0; outline: none; cursor: pointer; color: var(--text); background: rgba(255,255,255,.06);
}
.ghost-btn { width: 38px; height: 38px; border-radius: 12px; }
.meta-grid { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: stretch; }
.meta-box { padding: 14px 16px; }
.meta-box span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.meta-copy { border-radius: 16px; padding: 0 16px; font-weight: 600; }
.primary-btn {
  margin-top: 6px; min-height: 58px; border-radius: 18px; border: 0; cursor: pointer; width: 100%;
  font-size: 15px; font-weight: 700; color: #081120;
  background: linear-gradient(135deg, #86b6ff, #74f0c5);
  box-shadow: 0 14px 30px rgba(110,168,254,.22);
}
.primary-btn .btn-loading, .loading .btn-idle { display: none; }
.loading .btn-loading { display: inline-flex; gap: 8px; align-items: center; }
.security-note, .inline-alert { margin-top: 18px; padding: 14px 16px; display:flex; gap:12px; align-items:flex-start; color: var(--muted); }
.inline-alert.warning { color: #fff3cb; border-color: rgba(247,216,123,.2); }
.toast-root { position: fixed; top: 22px; right: 22px; z-index: 60; display: grid; gap: 10px; }
.toast { min-width: 280px; max-width: 360px; padding: 14px 16px; border-radius: 16px; border: 1px solid rgba(255,255,255,.08); background: rgba(8,14,26,.92); box-shadow: var(--shadow); }
.toast.success { border-color: rgba(108,240,194,.28); }
.toast.error { border-color: rgba(255,141,141,.22); }
.toast.info { border-color: rgba(110,168,254,.28); }
.modal-backdrop { position: fixed; inset: 0; background: rgba(2,8,18,.7); backdrop-filter: blur(10px); z-index: 80; display: grid; place-items: center; padding: 18px; }
.modal-backdrop.hidden { display: none; }
.modal-card { width: min(100%, 480px); background: var(--panel-strong); border: 1px solid var(--line); border-radius: 28px; padding: 24px; box-shadow: var(--shadow); position: relative; }
.modal-close { position: absolute; right: 18px; top: 18px; width: 40px; height: 40px; border-radius: 12px; }
.modal-head { display:flex; gap:16px; margin-bottom: 18px; }
.onboard-box { padding: 16px; margin-bottom: 18px; }
.onboard-box.hidden { display:none; }
.onboard-title { font-weight: 700; margin-bottom: 6px; }
.qr-box { display:flex; justify-content:center; margin: 14px 0; }
#qrBox{
    display:flex;
    justify-content:center;
    align-items:center;
    background:#ffffff;
    padding:18px;
    border-radius:18px;
    width:max-content;
    margin:12px auto 16px;
    box-shadow:0 10px 30px rgba(0,0,0,.18);
}

#qrBox canvas,
#qrBox img{
    display:block;
    background:#ffffff;
    padding:12px;              /* ขอบขาวเพิ่ม */
    border-radius:12px;
    image-rendering: pixelated;
}
.secret-wrap { display:grid; grid-template-columns: 1fr 46px; gap: 10px; margin-top: 12px; }
.secret-wrap input { min-height: 48px; padding: 0 14px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); }
.secret-wrap button { border-radius: 14px; }
.otp-grid { display:grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 18px; }
.otp-input { width:100%; min-height:56px; border-radius:16px; border:1px solid rgba(255,255,255,.1); background:rgba(255,255,255,.04); color:var(--text); text-align:center; font-size:24px; font-weight:800; outline:none; }
.wide { width: 100%; }
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; padding: 18px; }
  .hero-panel { order: 2; }
  .login-panel { order: 1; }
}
@media (max-width: 640px) {
  .hero-panel, .glass-card, .modal-card { padding: 20px; border-radius: 22px; }
  .status-strip { grid-template-columns: 1fr; }
  .meta-grid { grid-template-columns: 1fr; }
}
