/* =====================================================================
   หน้าเข้าสู่ระบบ — สายการผลิตมีชีวิต (docs/DESIGN.md 7.90)
   คลาสขึ้นต้น lx- ทั้งหมด (ไม่ชนกับ app.css) · โหมดมืดตามธีมล่าสุดบนเครื่อง (html[data-mode="dark"] จาก prefs.js)
   ===================================================================== */
body.lx { --lx-bg1: #eef2fb; --lx-bg2: #f8faff; --lx-ink: #0f172a; --lx-mut: #5b6782; --lx-line: rgba(30,41,82,.12); --lx-glass: rgba(255,255,255,.74);
          --lx-acc: #4f8cff; --lx-acc2: #8b5cf6; --lx-ok: #22c55e; --lx-warn: #f59e0b;
          margin: 0; min-height: 100vh; overflow-x: hidden; color: var(--lx-ink); font-family: "IBM Plex Sans Thai", system-ui, sans-serif;
          background: radial-gradient(1200px 700px at 20% 10%, color-mix(in srgb, var(--lx-acc) 18%, transparent), transparent 60%),
                      radial-gradient(900px 600px at 90% 90%, color-mix(in srgb, var(--lx-acc2) 16%, transparent), transparent 60%), linear-gradient(160deg, var(--lx-bg1), var(--lx-bg2)); }
html[data-mode="dark"] body.lx { --lx-bg1: #0b1020; --lx-bg2: #111a33; --lx-ink: #e8ecf7; --lx-mut: #93a0bd; --lx-line: rgba(148,163,209,.18); --lx-glass: rgba(17,25,51,.62); }
.lx-aurora { position: fixed; inset: -20%; z-index: 0; filter: blur(70px); opacity: .35; pointer-events: none; }
html[data-mode="dark"] .lx-aurora { opacity: .55; }
.lx-aurora i { position: absolute; width: 42vmax; height: 42vmax; border-radius: 50%; animation: lx-drift 22s ease-in-out infinite alternate; }
html[data-mode="dark"] .lx-aurora i { mix-blend-mode: screen; }
.lx-aurora i:nth-child(1) { background: #3b82f6; left: 5%; top: 10%; }
.lx-aurora i:nth-child(2) { background: #8b5cf6; right: 5%; top: 30%; animation-duration: 28s; animation-delay: -6s; }
.lx-aurora i:nth-child(3) { background: #06b6d4; left: 30%; bottom: 0; animation-duration: 32s; animation-delay: -12s; }
@keyframes lx-drift { to { transform: translate(8vmax, -6vmax) scale(1.15); } }
.lx-floor { position: fixed; left: -20%; right: -20%; bottom: -10%; height: 55%; z-index: 0; transform: perspective(700px) rotateX(62deg); transform-origin: bottom; pointer-events: none;
            background-image: linear-gradient(var(--lx-line) 1px, transparent 1px), linear-gradient(90deg, var(--lx-line) 1px, transparent 1px); background-size: 60px 60px;
            animation: lx-floor 6s linear infinite; -webkit-mask-image: linear-gradient(to top, #000 30%, transparent); mask-image: linear-gradient(to top, #000 30%, transparent); }
@keyframes lx-floor { to { background-position: 0 60px; } }
.lx-wrap { position: relative; z-index: 1; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(380px, .9fr); }
@media (max-width: 960px) { .lx-wrap { grid-template-columns: 1fr; } .lx-hero { display: none; } }
.lx-hero { padding: 44px 32px 28px 64px; display: flex; flex-direction: column; min-width: 0; }
.lx-eyebrow { display: inline-flex; gap: 8px; align-items: center; font-size: 12px; font-weight: 600; color: var(--lx-acc); letter-spacing: .04em; }
.lx-eyebrow::before { content: ""; width: 26px; height: 2px; background: currentColor; border-radius: 2px; }
.lx-hero h2 { margin: 12px 0 8px; font-size: clamp(26px, 2.6vw, 40px); line-height: 1.2; }
.lx-grad { background: linear-gradient(90deg, var(--lx-acc), var(--lx-acc2), #06b6d4, var(--lx-acc)); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: lx-shine 8s linear infinite; }
@keyframes lx-shine { to { background-position: 300% 0; } }
.lx-hero p { margin: 0; color: var(--lx-mut); max-width: 560px; }
.lx-stage { position: relative; flex: 1; min-height: 360px; display: grid; place-items: center; perspective: 1200px; }
.lx-scene { width: min(100%, 860px); transform-style: preserve-3d; transition: transform .25s ease-out; color: var(--lx-mut); }
.lx-scene svg { width: 100%; height: auto; overflow: visible; display: block; }
.lx-cap { font-size: 12px; fill: currentColor; }
.lx-float { position: absolute; z-index: 2; padding: 10px 14px; border-radius: 14px; background: var(--lx-glass); border: 1px solid var(--lx-line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
            font-size: 12px; color: var(--lx-mut); box-shadow: 0 18px 40px -18px rgba(0,0,0,.45); animation: lx-bob 6s ease-in-out infinite; }
.lx-float b { display: block; color: var(--lx-ink); font-size: 13px; }
.lx-f1 { top: 6%; left: 2%; } .lx-f2 { top: 2%; right: 4%; animation-delay: -2s; } .lx-f3 { bottom: 12%; right: 0; animation-delay: -4s; }
@keyframes lx-bob { 50% { transform: translateY(-8px); } }
.lx-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--lx-ok); margin-right: 6px; animation: lx-ping 1.8s infinite; }
.lx-dot.lx-amber { background: var(--lx-warn); animation: none; }
@keyframes lx-ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--lx-ok) 70%, transparent); } 70%, 100% { box-shadow: 0 0 0 8px transparent; } }
.lx-spark { display: block; margin-top: 4px; } .lx-spark polyline { stroke-dasharray: 300; stroke-dashoffset: 300; animation: lx-draw 2.4s ease-out forwards .6s; }
@keyframes lx-draw { to { stroke-dashoffset: 0; } }
.lx-steps { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.lx-steps span { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 999px; font-size: 12px; color: var(--lx-mut); border: 1px solid var(--lx-line); background: color-mix(in srgb, var(--lx-glass) 70%, transparent); transition: all .35s; }
.lx-steps i { font-style: normal; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 700; background: var(--lx-line); color: var(--lx-ink); transition: all .35s; }
.lx-steps .on { color: var(--lx-ink); border-color: color-mix(in srgb, var(--lx-acc) 60%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lx-acc) 18%, transparent), 0 10px 24px -12px var(--lx-acc); transform: translateY(-2px); }
.lx-steps .on i { background: linear-gradient(135deg, var(--lx-acc), var(--lx-acc2)); color: #fff; }
.lx-steps .done i { background: color-mix(in srgb, var(--lx-ok) 85%, transparent); color: #fff; }
/* ภาพเคลื่อนไหวในฉาก */
.lx-pellet { animation: lx-fall 1.6s linear infinite; }
@keyframes lx-fall { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(70px); opacity: 0; } }
.lx-screw { animation: lx-screw 1.2s linear infinite; } @keyframes lx-screw { to { stroke-dashoffset: -24; } }
.lx-melt { transform-box: fill-box; transform-origin: left center; animation: lx-melt 3.6s ease-in-out infinite; }
@keyframes lx-melt { 0%, 15% { transform: scaleX(0); } 45%, 100% { transform: scaleX(1); } }
.lx-heat { animation: lx-heat 1.4s ease-in-out infinite alternate; } @keyframes lx-heat { to { opacity: .35; } }
.lx-clampL { animation: lx-clampL 3.6s ease-in-out infinite; } .lx-clampR { animation: lx-clampR 3.6s ease-in-out infinite; }
@keyframes lx-clampL { 0%, 10% { transform: translateX(-18px); } 25%, 60% { transform: translateX(0); } 75%, 100% { transform: translateX(-18px); } }
@keyframes lx-clampR { 0%, 10% { transform: translateX(18px); } 25%, 60% { transform: translateX(0); } 75%, 100% { transform: translateX(18px); } }
.lx-belt { animation: lx-belt .8s linear infinite; } @keyframes lx-belt { to { stroke-dashoffset: -20; } }
.lx-flow { stroke-dasharray: 2 10; animation: lx-flow 1.4s linear infinite; } @keyframes lx-flow { to { stroke-dashoffset: -24; } }
.lx-hub { transform-box: fill-box; transform-origin: center; animation: lx-hub 2.4s ease-in-out infinite; } @keyframes lx-hub { 50% { transform: scale(1.08); } }
.lx-truck { animation: lx-truck 7.2s ease-in-out infinite; } @keyframes lx-truck { 0%, 20% { transform: translateX(0); opacity: 1; } 55%, 100% { transform: translateX(140px); opacity: 0; } }
.lx-lamp { animation: lx-lamp 1s steps(2) infinite; } @keyframes lx-lamp { 50% { fill: var(--lx-warn); } }
/* การ์ดเข้าสู่ระบบ */
.lx-side { display: grid; place-items: center; padding: 24px; }
.lx-card { position: relative; width: min(420px, 100%); padding: 34px 32px 26px; border-radius: 24px; background: var(--lx-glass); border: 1px solid var(--lx-line);
           backdrop-filter: blur(22px) saturate(140%); -webkit-backdrop-filter: blur(22px) saturate(140%); box-shadow: 0 30px 80px -30px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.06);
           animation: lx-cardIn .9s cubic-bezier(.2,.8,.2,1) both .1s; overflow: hidden; color: var(--lx-ink); }
@keyframes lx-cardIn { from { opacity: 0; transform: translateY(24px) scale(.97); } }
@property --lx-a { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.lx-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none; opacity: .8;
                   background: conic-gradient(from var(--lx-a), transparent 0 70%, var(--lx-acc) 80%, var(--lx-acc2) 90%, transparent);
                   -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: lx-spin 6s linear infinite; }
@keyframes lx-spin { to { --lx-a: 360deg; } }
.lx-brand { display: flex; gap: 10px; align-items: center; justify-content: center; font-weight: 700; }
.lx-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-size: 13px; background: linear-gradient(135deg, var(--lx-acc), var(--lx-acc2)); box-shadow: 0 10px 24px -10px var(--lx-acc); animation: lx-mark 3.2s ease-in-out infinite; }
@keyframes lx-mark { 50% { transform: rotate(-6deg) scale(1.06); } }
.lx-card h1 { text-align: center; margin: 18px 0 4px; font-size: 22px; }
.lx-sub { text-align: center; color: var(--lx-mut); font-size: 13px; margin: 0 0 20px; }
.lx-err { margin-bottom: 14px; padding: 10px 12px; border-radius: 12px; font-size: 13px; color: #b91c1c; background: rgba(220,38,38,.12); border: 1px solid rgba(220,38,38,.35); }
html[data-mode="dark"] .lx-err { color: #fecaca; }
.lx-card .lx-fl { position: relative; margin: 0 0 16px; display: block; }
.lx-fl input { width: 100%; height: 54px; padding: 20px 46px 6px 44px; border-radius: 14px; border: 1px solid var(--lx-line); background: color-mix(in srgb, var(--lx-bg2) 55%, transparent);
               color: var(--lx-ink); font: inherit; font-size: 15px; outline: none; transition: border-color .2s, box-shadow .2s; }
.lx-fl input:focus { border-color: var(--lx-acc); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lx-acc) 22%, transparent); }
.lx-fl label { position: absolute; left: 44px; top: 17px; color: var(--lx-mut); font-size: 14px; pointer-events: none; transition: all .18s; margin: 0; }
.lx-fl input:focus + label, .lx-fl input:not(:placeholder-shown) + label { top: 7px; font-size: 11px; color: var(--lx-acc); }
.lx-fl .lx-ic { position: absolute; left: 14px; top: 16px; width: 20px; height: 20px; color: var(--lx-mut); pointer-events: none; }
.lx-fl input:focus ~ .lx-ic { color: var(--lx-acc); }
.lx-fl .lx-eye { position: absolute; right: 8px; top: 9px; width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--lx-mut); cursor: pointer; display: grid; place-items: center; }
.lx-fl .lx-eye:hover { background: var(--lx-line); } .lx-fl .lx-eye .icon { width: 18px; height: 18px; }
.lx-fl.invalid input { border-color: #dc2626; }
.lx-fl .field-error { display: block; margin: 6px 4px 0; font-size: 12px; color: #dc2626; }
.lx-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--lx-mut); margin: 2px 2px 20px; }
.lx-row label { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.lx-row-tight { margin-bottom: 8px; }
.lx-stay { flex-direction: column; align-items: flex-start; gap: 2px; }
.lx-stay small { font-size: 11.5px; opacity: .8; padding-left: 24px; }
.lx-caps { font-size: 12px; } .lx-caps.on { color: var(--lx-warn); font-weight: 600; }
.lx-go { position: relative; width: 100%; height: 52px; border: 0; border-radius: 14px; color: #fff; font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; overflow: hidden;
         background: linear-gradient(135deg, var(--lx-acc), var(--lx-acc2)); box-shadow: 0 14px 30px -12px var(--lx-acc); transition: transform .15s, box-shadow .2s; }
.lx-go:hover { transform: translateY(-1px); box-shadow: 0 18px 36px -12px var(--lx-acc); }
.lx-go:disabled { cursor: progress; opacity: .9; }
.lx-go::after { content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent); transform: skewX(-20deg); animation: lx-sweep 3.6s ease-in-out infinite 1s; }
@keyframes lx-sweep { 0%, 60% { left: -60%; } 100% { left: 130%; } }
.lx-go .lx-gear { display: none; width: 20px; height: 20px; vertical-align: -4px; margin-right: 8px; animation: lx-rot 1s linear infinite; }
.lx-go.busy .lx-gear { display: inline-block; }
@keyframes lx-rot { to { transform: rotate(360deg); } }
.lx-foot { text-align: center; font-size: 12px; color: var(--lx-mut); margin: 18px 0 0; line-height: 1.6; }
/* ปุ่มล้างข้อมูลการเข้าระบบบนเครื่องนี้ (7.117) — ลิงก์เล็ก ไม่แย่งปุ่มเข้าสู่ระบบ */
.lx-clear { text-align: center; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--lx-line); }
.lx-clear button { border: 0; background: transparent; color: #dc2626; font: inherit; font-size: 12.5px; cursor: pointer; padding: 4px 8px; border-radius: 8px; display: inline-flex; align-items: center; gap: 6px; }
.lx-clear button:hover { background: rgba(220,38,38,.1); text-decoration: underline; }
.lx-clear button:disabled { cursor: progress; opacity: .6; }
.lx-clear .icon { width: 14px; height: 14px; }
html[data-mode="dark"] .lx-clear button { color: #fca5a5; }
.lx-okmsg { margin-bottom: 14px; padding: 10px 12px; border-radius: 12px; font-size: 13px; color: #15803d; background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.35); }
html[data-mode="dark"] .lx-okmsg { color: #bbf7d0; }
.lx-card.lx-shake { animation: lx-shake .45s; }
@keyframes lx-shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.lx-okfx { position: absolute; inset: 0; display: grid; place-items: center; background: var(--lx-glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); opacity: 0; pointer-events: none; transition: opacity .3s; border-radius: inherit; }
.lx-card.lx-ok .lx-okfx { opacity: 1; pointer-events: auto; }
.lx-okfx svg { width: 96px; height: 96px; }
.lx-okfx circle { stroke-dasharray: 280; stroke-dashoffset: 280; } .lx-okfx path { stroke-dasharray: 80; stroke-dashoffset: 80; }
.lx-card.lx-ok .lx-okfx circle { animation: lx-draw .6s forwards; } .lx-card.lx-ok .lx-okfx path { animation: lx-draw .4s .5s forwards; }
.lx-okfx p { position: absolute; margin: 120px 0 0; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { body.lx *, body.lx *::before, body.lx *::after { animation: none !important; transition: none !important; } .lx-spark polyline { stroke-dashoffset: 0; } }
