/* ============================================================
   หน้าเข้าสู่ระบบ — ห้องเรียนวิทยาศาสตร์
   ทั้งหน้าเป็นแผงเดียว (Login Panel) ขนาด 681 × 439 px อยู่กลางจอ
   ตำแหน่งทุกชิ้นเป็นพิกเซลจริงของแผง
   ต้องการขยายทั้งแผง: เปลี่ยน --lg-zoom (1 = 681×439, 1.2 = 817×527)
   ============================================================ */
.lg-body{
    --lg-zoom:1;
    --ink:#13306b; --muted:#2f4668; --line:#c3d4e6; --focus:#2f8fe6;
    margin:0;min-height:100vh;min-height:100dvh;
    font-family:'Sarabun',sans-serif;color:#1d3553;background:#d5e7fd;
}
.lg-stage{min-height:100vh;min-height:100dvh;display:flex;align-items:center;justify-content:center;padding:16px}

/* ---------- แผงหลัก ---------- */
.lg-panel{zoom:var(--lg-zoom);position:relative;flex:none;width:681px;height:439px;overflow:hidden;border-radius:12px;
    background:
        radial-gradient(ellipse 34% 40% at 50% 16%,#e9fdff 0%,rgba(233,253,255,0) 100%),
        radial-gradient(ellipse 40% 55% at 104% -6%,#023f80 0%,#0b5fa8 38%,rgba(20,120,200,0) 100%),
        radial-gradient(ellipse 30% 45% at 92% 48%,#1fb7d6 0%,rgba(31,183,214,0) 100%),
        radial-gradient(ellipse 36% 46% at 4% 62%,#7de0f5 0%,rgba(125,224,245,0) 100%),
        linear-gradient(118deg,#6db9ea 0%,#9fdaf5 26%,#c8f1fb 46%,#86d9f2 64%,#3aaee2 82%,#1677c4 100%);
    box-shadow:0 18px 40px -12px rgba(20,70,140,.35),0 2px 6px rgba(20,70,140,.1)}
.lg-scene{position:absolute;inset:0;width:100%;height:100%;display:block}
.lg-scene .lg-hexgrid path{fill:none;stroke:#fff;stroke-width:1.6}
.lg-scene .lg-hexgrid .dots{fill:#fff}
.lg-scene .lg-hex .hx{fill:rgba(255,255,255,.16);stroke:#fff;stroke-width:2.8;stroke-linejoin:round}
.lg-scene .lg-hex .ic{fill:none;stroke:#fff;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.lg-scene .lg-hex .lf{fill:rgba(255,255,255,.28)}
.lg-scene .lg-hex .lq{fill:rgba(255,255,255,.65);stroke:none}
.lg-scene .lg-plant-l{opacity:.8;filter:blur(1.2px)}
.lg-book-text{font-family:'Sarabun',sans-serif;font-weight:800;font-size:17px;fill:#fff;letter-spacing:.4px}

/* ลอยขึ้นลงเบา ๆ */
@keyframes lgFloat{0%,100%{transform:translateY(0)}50%{transform:translateY(-4px)}}
.lg-scene .fl{animation:lgFloat 7s ease-in-out infinite}
.lg-scene .fl-2{animation-duration:9s;animation-delay:-3s}
.lg-scene .fl-3{animation-duration:8s;animation-delay:-5s}
@media (prefers-reduced-motion:reduce){.lg-scene .fl{animation:none}}

/* ---------- โลโก้ หัวเรื่อง คำบรรยาย ---------- */
.lg-logo{position:absolute;left:50%;top:5px;width:86px;height:auto;transform:translateX(-50%);
    filter:drop-shadow(0 4px 8px rgba(10,60,150,.3))}
.lg-title{position:absolute;left:50%;top:50px;transform:translateX(-50%);margin:0;padding:0 .05em;white-space:nowrap;
    font-family:'Sarabun',sans-serif;font-weight:800;font-size:37px;line-height:1.3}
.lg-title-text{position:relative;z-index:1;display:inline-block;
    background:linear-gradient(180deg,#1d4f9e 0%,#13306b 60%,#0d2558 100%);
    -webkit-background-clip:text;background-clip:text;color:transparent;
    filter:drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff) drop-shadow(0 2px 0 rgba(255,255,255,.95)) drop-shadow(0 4px 8px rgba(10,50,120,.22))}
.lg-swoosh{position:absolute;left:43%;width:36%;bottom:1px;height:7px;z-index:0}
.lg-sub{position:absolute;left:0;right:0;top:113px;margin:0;display:flex;align-items:center;justify-content:center;gap:9px;
    font-size:10.5px;font-weight:600;line-height:18px;color:#173065;white-space:nowrap}
.lg-sub::before,.lg-sub::after{content:"";width:40px;height:1.2px;border-radius:1px}
.lg-sub::before{background:linear-gradient(90deg,rgba(23,48,101,0),#2a5ea8)}
.lg-sub::after{background:linear-gradient(90deg,#2a5ea8,rgba(23,48,101,0))}

/* ---------- การ์ดเข้าสู่ระบบ 326 × 218 ---------- */
.lg-card{position:absolute;left:calc(50% - 163px);top:146px;width:326px;height:218px;padding:8px 28px 0;
    background:linear-gradient(180deg,rgba(255,255,255,.9),rgba(238,247,255,.84));
    -webkit-backdrop-filter:blur(10px) saturate(140%);backdrop-filter:blur(10px) saturate(140%);
    border:1.5px solid rgba(255,255,255,.95);border-radius:14px;
    box-shadow:0 16px 32px -10px rgba(10,70,140,.4),0 2px 6px rgba(10,70,140,.1),inset 0 1px 0 #fff}
.lg-card-head{height:43px;display:flex;align-items:center;justify-content:center;gap:12px}
.lg-badge{flex:none;width:43px;height:43px;border-radius:50%;display:grid;place-items:center;color:#fff;font-size:21px;
    background:linear-gradient(135deg,#25c9b5 0%,#14a9b8 55%,#1488c9 100%);
    box-shadow:0 5px 12px rgba(20,150,180,.35),inset 0 2px 0 rgba(255,255,255,.3)}
.lg-card h2{margin:0;font-family:'Sarabun',sans-serif;font-weight:800;font-size:21px;line-height:1.2;color:var(--ink)}
.lg-card-sub{height:15px;margin:3px 0 11px;text-align:center;font-size:10.5px;font-weight:600;line-height:15px;color:#1f3557;white-space:nowrap}
.lg-error{width:fit-content;max-width:100%;margin-left:auto;margin-right:auto;padding:0 9px;border-radius:999px;font-size:9.5px;
    background:#ffecef;border:1px solid #f5c2c7;color:#a12a36;overflow:hidden;text-overflow:ellipsis}

.lg-field{position:relative;display:flex;align-items:center;margin-bottom:9px}
.lg-field>i{position:absolute;left:11px;font-size:15px;color:#2a3d55;pointer-events:none}
.lg-field input{width:100%;height:32px;padding:0 32px 0 36px;border:1px solid var(--line);border-radius:9px;
    background:rgba(255,255,255,.88);font:inherit;font-size:12px;color:#1b2e45;outline:none;
    transition:border-color .15s,box-shadow .15s,background-color .15s}
.lg-field input::placeholder{color:#2a3f5f;font-weight:600;opacity:1}
.lg-field input:focus{border-color:var(--focus);background:#fff;box-shadow:0 0 0 3px rgba(47,143,230,.16)}
.lg-field input::-ms-reveal{display:none}
/* Chrome เติมรหัสอัตโนมัติ: คงพื้นขาวไม่ให้เป็นสีฟ้า */
.lg-field input:-webkit-autofill{-webkit-text-fill-color:#1b2e45;caret-color:#1b2e45;box-shadow:inset 0 0 0 40px #fff;transition:background-color 99999s}
.lg-field input:-webkit-autofill:focus{box-shadow:inset 0 0 0 40px #fff,0 0 0 3px rgba(47,143,230,.16)}
.lg-eye{position:absolute;right:4px;width:26px;height:26px;padding:0;border:0;border-radius:7px;background:transparent;
    color:#2a3d55;font-size:14px;display:grid;place-items:center;cursor:pointer}
.lg-eye:hover{background:rgba(47,143,230,.1);color:var(--focus)}
.lg-eye:focus-visible{outline:2px solid var(--focus);outline-offset:1px}

.lg-btn{width:100%;height:35px;margin-top:3px;border:0;border-radius:14px;color:#fff;cursor:pointer;
    display:flex;align-items:center;justify-content:center;gap:9px;
    font-family:'Sarabun',sans-serif;font-weight:700;font-size:14.5px;
    background:linear-gradient(90deg,#03c4ce 0%,#0fa6dc 45%,#1281e6 75%,#1d6ee0 100%);
    box-shadow:0 8px 16px -6px rgba(18,110,220,.55),inset 0 1px 0 rgba(255,255,255,.3);
    transition:transform .15s,box-shadow .15s,filter .15s}
.lg-btn i{font-size:16px}
.lg-btn:hover{filter:brightness(1.07);transform:translateY(-1px)}
.lg-btn:active{transform:translateY(0)}
.lg-btn:focus-visible{outline:2px solid rgba(47,143,230,.5);outline-offset:2px}
.lg-btn:disabled{cursor:wait;filter:none;transform:none;opacity:.9}
.lg-btn .spinner-border-sm{width:13px;height:13px;border-width:2px}

.app-toasts{top:0;right:0;z-index:1090}
.app-toasts .toast{font-family:inherit;font-size:1rem;box-shadow:0 6px 20px rgba(0,0,0,.18)}

/* ---------- จอแคบกว่าแผง (มือถือ): เรียงลงมา ขยายตัวอักษรให้อ่านง่าย ---------- */
@media (max-width:719.98px){
    .lg-stage{padding:12px}
    .lg-panel{zoom:1;width:100%;max-width:440px;height:auto;padding:12px 16px 90px;display:flex;flex-direction:column;align-items:center}
    .lg-logo,.lg-title,.lg-sub,.lg-card{position:relative;left:auto;top:auto;transform:none}
    .lg-logo{width:96px}
    .lg-title{font-size:min(9vw,38px)}
    .lg-sub{font-size:12px;white-space:normal;text-align:center;margin-top:4px}
    .lg-sub::before,.lg-sub::after{display:none}
    .lg-card{width:100%;height:auto;margin-top:16px;padding:14px 18px 16px;zoom:1.2}
    .lg-card-sub{height:auto;white-space:normal}
}
