/* ============================================================
   EDL Stock — หน้าเข้าสู่ระบบ (แบบ authentication-login ของ MatDash)
   ฝั่งฟอร์มพื้นขาว · ฝั่งแบรนด์พื้นกรมท่า + สีหลักของธีม
   ============================================================ */
body.edl-login { background: var(--edl-surface); color: var(--edl-text-2); }
.lg-wrap { min-height: 100vh; display: flex; flex-wrap: wrap; background: var(--edl-surface); }
.lg-brand {
    flex: 1; min-width: 300px; box-sizing: border-box; position: relative; overflow: hidden; order: 2;
    background: #0a2540; padding: 24px 22px 28px; display: flex; flex-direction: column; color: #fff;
}
/* จัดกลางด้วย margin:auto — ฟอร์มสูงกว่าจอแล้วยังเลื่อนเห็นส่วนบนได้ (justify-content:center จะตัดส่วนบนทิ้ง) */
.lg-form { flex: 1.15; min-width: 320px; box-sizing: border-box; order: 1; padding: 28px 18px 32px; display: flex; flex-direction: column; align-items: center; }
.lg-form-in { width: 100%; max-width: 400px; margin: auto 0; }

/* ฉากหลังฝั่งแบรนด์: วงกลมสีหลักแบบหน้า login ของธีม */
.lg-mesh { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.lg-mesh span { position: absolute; border-radius: 50%; will-change: transform; }
.lg-mesh .m1 { width: 520px; height: 520px; right: -180px; bottom: -200px; background: radial-gradient(circle at 30% 30%, rgba(99, 91, 255, .85), rgba(99, 91, 255, .15) 70%); animation: meshA 18s ease-in-out infinite; }
.lg-mesh .m2 { width: 300px; height: 300px; left: -120px; top: -110px; border: 46px solid rgba(255, 255, 255, .05); animation: meshB 22s ease-in-out infinite; }
.lg-mesh .m3 { width: 220px; height: 220px; right: 18%; top: 12%; background: radial-gradient(circle, rgba(70, 202, 235, .35), rgba(70, 202, 235, 0) 70%); animation: meshC 26s ease-in-out infinite; }
.lg-mesh .wire { inset: 0; border-radius: 0; 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; }
@keyframes meshA { 0%, 100% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(-30px, -20px, 0) scale(1.08); } }
@keyframes meshB { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(24px, 18px, 0); } }
@keyframes meshC { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(-20px, 26px, 0); } }

.lg-brand > *:not(.lg-mesh) { position: relative; z-index: 1; }
.lg-logo { display: flex; align-items: center; gap: 11px; margin-bottom: 28px; }
.lg-logo .mk { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(140deg, #8a84ff, #635bff); color: #fff; font-size: 19px; font-weight: 700; }
.lg-logo img { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; background: var(--edl-surface); padding: 3px; }
.lg-logo b { font-size: 1.05rem; font-weight: 700; }
.lg-title { font-size: 1.35rem; font-weight: 700; line-height: 1.5; max-width: 400px; }
.lg-desc { color: rgba(255, 255, 255, .62); font-size: .9rem; line-height: 1.8; margin-top: 14px; max-width: 380px; }
.lg-feats { margin-top: 24px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 440px; }
.lg-feat { border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; padding: 12px; background: rgba(255, 255, 255, .05); }
.lg-feat i { font-size: 1.15rem; }
.lg-feat b { display: block; font-size: .86rem; font-weight: 600; margin-top: 7px; }
.lg-feat span { display: block; color: rgba(255, 255, 255, .55); font-size: .76rem; margin-top: 2px; }
.lg-stats { margin-top: 22px; display: flex; gap: 28px; flex-wrap: wrap; }
.lg-stats b { display: block; font-size: 1.45rem; font-weight: 700; }
.lg-stats span { display: block; color: rgba(255, 255, 255, .55); font-size: .78rem; }
.lg-glass {
    margin-top: 24px; max-width: 440px; position: relative; overflow: hidden; border-radius: 16px; border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .07); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 18px 44px rgba(0, 0, 0, .25); padding: 18px;
}
.lg-glass .gh { display: flex; align-items: center; gap: 12px; }
.lg-glass .gi { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: #635bff; font-size: 22px; color: #fff; }
.lg-glass .gv { font-size: 1.75rem; font-weight: 700; line-height: 1.1; }
.lg-glass .gl { font-size: .78rem; color: rgba(255, 255, 255, .6); }
.lg-glass .gbar { margin-top: 16px; }
.lg-glass .gbar .row1 { display: flex; justify-content: space-between; font-size: .78rem; color: rgba(255, 255, 255, .65); margin-bottom: 6px; }
.lg-glass .gbar .track { height: 7px; border-radius: 999px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.lg-glass .gbar .track span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #8a84ff, #46caeb); }
.lg-glass .gmini { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 16px; border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 14px; text-align: center; }
.lg-glass .gmini div + div { border-left: 1px solid rgba(255, 255, 255, .1); }
.lg-glass .gmini b { display: block; font-size: 1.15rem; font-weight: 700; }
.lg-glass .gmini span { font-size: .72rem; color: rgba(255, 255, 255, .55); }
.lg-pills { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 14px; }
.lg-pills span { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 10px; font-size: .74rem; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); color: rgba(255, 255, 255, .85); }
.lg-live { width: 8px; height: 8px; border-radius: 50%; background: #5fd894; position: relative; }
.lg-live:after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: #5fd894; animation: ping 1.6s cubic-bezier(0, 0, .2, 1) infinite; }
@keyframes ping { 75%, 100% { transform: scale(2.2); opacity: 0; } }
.lg-marquee { margin-top: 14px; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.lg-marquee .track { display: flex; gap: 16px; width: max-content; animation: marquee 26s linear infinite; }
.lg-marquee .track span { display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; color: rgba(255, 255, 255, .72); white-space: nowrap; }
.lg-marquee .track i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.lg-steps { margin-top: auto; padding-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.lg-step { flex: 1; min-width: 230px; display: flex; align-items: flex-start; gap: 10px; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .06); backdrop-filter: blur(10px); border-radius: 14px; padding: 14px; }
.lg-step .av { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; font-size: 17px; flex: none; }
.lg-step b { display: block; font-size: .86rem; font-weight: 700; }
.lg-step small { display: block; color: rgba(255, 255, 255, .55); font-size: .76rem; }
.lg-step p { color: rgba(255, 255, 255, .8); font-size: .78rem; margin: 5px 0 0; line-height: 1.55; }
.lg-foot { position: relative; margin-top: auto; padding-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lg-foot > span { color: rgba(255, 255, 255, .4); font-size: .8rem; }
.lg-seal { width: 96px; height: 96px; position: relative; flex: none; }
.lg-seal svg { width: 100%; height: 100%; animation: spin 18s linear infinite; }
.lg-seal .core { position: absolute; inset: 26px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(from 0deg, #635bff, #8a84ff, #46caeb, #635bff); color: #fff; font-size: 20px; box-shadow: 0 0 0 4px rgba(10, 37, 64, .7); }
.lg-wide-only { display: none; }

/* ฝั่งฟอร์ม */
.lg-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.lg-head .mk { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(140deg, #8a84ff, #635bff); color: #fff; font-size: 20px; font-weight: 700; flex: none; box-shadow: 0 8px 16px -6px rgba(99, 91, 255, .55); }
.lg-head img { width: 44px; height: 44px; border-radius: 12px; object-fit: contain; border: 1px solid var(--edl-line-2); padding: 3px; flex: none; }
.lg-head b { display: block; font-size: 1.05rem; font-weight: 700; color: var(--edl-text); line-height: 1.2; }
.lg-head small { display: block; font-size: .78rem; color: var(--edl-muted); }
.lg-tabs { display: flex; gap: 4px; background: var(--edl-soft); border-radius: 12px; padding: 5px; margin-bottom: 22px; }
.lg-tabs button { flex: 1; text-align: center; border-radius: 9px; padding: 10px; font-size: .9rem; font-weight: 600; cursor: pointer; border: 0; background: transparent; color: var(--edl-text-2); transition: background .18s, color .18s, box-shadow .18s; }
.lg-tabs button:hover { color: var(--bs-primary); }
.lg-tabs button.on { background: var(--bs-primary); color: #fff; box-shadow: 0 8px 16px -6px rgba(99, 91, 255, .55); }
.lg-h { font-size: 1.4rem; font-weight: 700; color: var(--edl-text); }
.lg-hint { font-size: .88rem; color: var(--edl-muted); margin: 4px 0 20px; }
.lg-stack { display: flex; flex-direction: column; gap: 14px; }

.pin-wrap { position: relative; }
.pin-cells { display: flex; gap: 8px; }
.pin-cells span { flex: 1; display: grid; place-items: center; height: 48px; border: 1px solid var(--edl-line); border-radius: 8px; font-size: 20px; color: var(--edl-text); transition: border-color .15s, transform .15s, box-shadow .15s; background: var(--edl-surface); }
.pin-cells span.cur { border-color: var(--bs-primary); box-shadow: 0 0 0 3px rgba(99, 91, 255, .12); }
.pin-cells span.fill { transform: scale(1.02); }
.pin-cells.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.pin-wrap input.pin-input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; font-size: 16px; color: transparent; caret-color: transparent; cursor: pointer; -webkit-text-security: disc; }
.pin-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pin-keys button { display: grid; place-items: center; height: 48px; border: 1px solid var(--edl-line); border-radius: 10px; font-size: 1.1rem; font-weight: 600; cursor: pointer; color: var(--edl-text); background: var(--edl-surface); transition: background .12s, border-color .12s, color .12s; }
.pin-keys button:hover { border-color: var(--edl-primary-line); color: var(--bs-primary); }
.pin-keys button:active { background: var(--edl-primary-soft); }
.pin-keys button.fn { color: var(--edl-muted); font-size: .9rem; font-weight: 500; }
.lg-pwd { display: flex; align-items: center; border: 1px solid var(--edl-line); border-radius: 8px; padding: 0 13px; background: var(--edl-surface); }
.lg-pwd:focus-within { border-color: var(--bs-primary); box-shadow: 0 0 0 3px rgba(99, 91, 255, .12); }
.lg-pwd input { flex: 1; min-width: 0; border: 0 !important; box-shadow: none !important; padding: 12px 0 !important; }
.lg-eye { display: grid; place-items: center; width: 28px; height: 28px; color: var(--edl-muted); cursor: pointer; flex: none; border: 0; background: none; }
.lg-check { display: flex; align-items: center; gap: 9px; font-size: .88rem; color: var(--edl-text-2); cursor: pointer; user-select: none; }
.lg-check input { display: none; }
.lg-check .bx { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; border: 1px solid #c5cfdb; color: #fff; transition: background .15s, border-color .15s; }
.lg-check input:checked + .bx { background: var(--bs-primary); border-color: var(--bs-primary); }
.lg-check .bx i { font-size: 15px; opacity: 0; }
.lg-check input:checked + .bx i { opacity: 1; }
.lg-code { border-color: var(--edl-line) !important; }
.lg-note { margin-top: 22px; border-top: 1px solid var(--edl-line-2); padding-top: 14px; font-size: .84rem; color: var(--edl-muted); line-height: 1.7; }
.lg-alert { background: #ffeaf0; color: #c8305a; border-radius: 10px; padding: 10px 13px; font-size: .86rem; display: flex; gap: 8px; align-items: flex-start; margin-bottom: 14px; }
.lg-alert.info { background: var(--edl-primary-soft); color: #4b43e0; }

@media (min-width: 1100px) {
    .lg-brand { padding: 40px 36px; min-height: 100vh; }
    .lg-form { padding: 40px 32px; }
    .lg-title { font-size: 1.7rem; }
    .lg-wide-only { display: block; }
    .lg-wrap { height: 100vh; overflow: hidden; }
    .lg-brand, .lg-form { overflow-y: auto; }
    .lg-form { flex: 0 0 min(560px, 42%); }
}
@media (max-width: 1099.98px) {
    .lg-feats, .lg-stats { display: none; }
}
@media (min-width: 1100px) and (max-height: 859px) {
    .lg-feats, .lg-stats { display: none; }
}
