/* login-modal.css — การ์ดล็อกอิน/สมัครสมาชิก แบบเด้งขึ้นมาบนหน้าเดิม (ไม่เปลี่ยนหน้า)
   ทุกคลาสขึ้นต้นด้วย .lm- เพื่อไม่ไปชนกับ style.css ของหน้าหลัก */
.lm-overlay{
  position:fixed; inset:0; z-index:100000;
  display:flex; align-items:center; justify-content:center;
  padding:16px; padding-top:max(16px, env(safe-area-inset-top)); padding-bottom:max(16px, env(safe-area-inset-bottom));
  background:rgba(0,0,0,.66);
  -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px);
  opacity:0; visibility:hidden; pointer-events:none;
  transition:opacity .22s ease, visibility 0s linear .22s;
  font-family:'Noto Sans Lao','Prompt','Rajdhani',sans-serif;
}
.lm-overlay.is-open{ opacity:1; visibility:visible; pointer-events:auto; transition:opacity .22s ease; }
.lm-card{
  position:relative; width:100%; max-width:400px;
  max-height:calc(100dvh - 32px); overflow-y:auto; overscroll-behavior:contain;
  background:#0a0a0a; color:#fff;
  border:1px solid #1e1e1e; border-radius:22px;
  padding:26px 22px 22px;
  box-shadow:0 24px 70px rgba(0,0,0,.65), 0 0 0 1px rgba(255,0,1,.08);
  transform:translateY(26px) scale(.9); opacity:0;
  transition:transform .34s cubic-bezier(.34,1.56,.64,1), opacity .22s ease;
}
.lm-overlay.is-open .lm-card{ transform:none; opacity:1; }
.lm-card *{ box-sizing:border-box; }
.lm-close{
  position:absolute; top:12px; right:12px; width:34px; height:34px;
  display:grid; place-items:center; border:0; border-radius:50%;
  background:#161616; color:#999; cursor:pointer; transition:background .15s,color .15s;
}
.lm-close:hover{ background:#222; color:#fff; }
.lm-close svg{ width:16px; height:16px; }
.lm-logo{ width:64px; height:64px; margin:0 auto 8px; display:flex; align-items:center; justify-content:center; }
.lm-logo img{ width:100%; height:100%; object-fit:contain; }
.lm-eyebrow{ text-align:center; color:#ff1a1a; font-size:14px; font-weight:600; line-height:20px; }
.lm-title{ text-align:center; font-size:21px; font-weight:800; margin:4px 0 6px; }
.lm-sub{ text-align:center; color:#999; font-size:13px; line-height:1.6; margin-bottom:4px; }
.lm-tabs{ display:flex; justify-content:center; gap:40px; margin:16px 0 18px; border-bottom:1px solid #232325; }
.lm-tab{
  position:relative; padding:0 0 10px; background:none; border:0; cursor:pointer;
  font:inherit; font-size:16px; line-height:24px; font-weight:500; color:#80808a; transition:color .2s;
}
.lm-tab:hover{ color:#fff; }
.lm-tab[aria-selected="true"]{ color:#fff; font-weight:600; }
.lm-tab[aria-selected="true"]::after{ content:""; position:absolute; left:0; right:0; bottom:-1px; height:2px; border-radius:2px; background:#ff0001; }
.lm-form[hidden]{ display:none; }
.lm-form{ animation:lm-fade .25s ease; }
@keyframes lm-fade{ from{ opacity:0; transform:translateY(6px); } to{ opacity:1; transform:none; } }
.lm-field{ margin-bottom:13px; }
.lm-field label{ display:block; font-size:12.5px; font-weight:700; color:#999; margin-bottom:7px; }
.lm-input{
  display:flex; align-items:center; gap:10px;
  background:#0a0a0a; border:1.5px solid #1e1e1e; border-radius:12px; padding:12px 14px;
  transition:border-color .15s, box-shadow .15s;
}
.lm-input:focus-within{ border-color:#ff0001; box-shadow:0 0 0 3px rgba(255,0,1,.15); }
.lm-input svg{ width:17px; height:17px; color:#777; flex-shrink:0; }
.lm-input input{
  flex:1; min-width:0; background:transparent; border:0; outline:0; color:#fff;
  font:inherit; font-size:16px; /* 16px กัน iOS ซูมเข้าตอนแตะช่อง */
}
.lm-input input::placeholder{ color:#777; }
.lm-eye{ background:none; border:0; color:#777; cursor:pointer; display:flex; padding:2px; }
.lm-eye.is-visible{ color:#ff1a1a; }
.lm-field.has-error .lm-input{ border-color:#ff3b3b; }
.lm-err{ min-height:0; color:#ff5a5a; font-size:12px; margin-top:5px; }
.lm-err:empty{ display:none; }
.lm-row{ display:flex; align-items:center; justify-content:space-between; font-size:13px; color:#999; margin:2px 0 16px; gap:10px; }
.lm-row label{ display:flex; align-items:center; gap:8px; cursor:pointer; }
.lm-row a{ color:#999; }
.lm-btn{
  width:100%; height:48px; border:0; border-radius:12px; cursor:pointer;
  font:inherit; font-size:15px; font-weight:700; color:#fff;
  display:flex; align-items:center; justify-content:center; gap:10px;
  transition:transform .15s, filter .15s, opacity .15s;
}
.lm-btn:active{ transform:scale(.98); }
.lm-btn[disabled]{ opacity:.6; cursor:default; }
.lm-submit{ background:linear-gradient(180deg,#ff1a1a,#d10001); box-shadow:0 8px 22px rgba(255,0,1,.28); }
.lm-divider{ display:flex; align-items:center; gap:12px; color:#666; font-size:12.5px; margin:16px 0; }
.lm-divider::before,.lm-divider::after{ content:""; flex:1; height:1px; background:#232325; }
.lm-social{ margin-bottom:10px; background:#141414; border:1px solid #232325; }
.lm-social:last-child{ margin-bottom:0; }
.lm-discord{ background:#5865f2; border-color:#5865f2; }
.lm-social svg{ width:20px; height:20px; }
.lm-toast{
  position:fixed; left:50%; bottom:calc(24px + env(safe-area-inset-bottom)); z-index:100001;
  transform:translate(-50%,20px); opacity:0; pointer-events:none;
  background:#111; color:#fff; border:1px solid #333; border-radius:12px;
  padding:11px 16px; font-size:13.5px; max-width:90vw; text-align:center;
  transition:opacity .2s, transform .25s; font-family:'Noto Sans Lao','Prompt',sans-serif;
}
.lm-toast.show{ opacity:1; transform:translate(-50%,0); }
.lm-toast.error{ border-color:rgba(255,0,1,.55); }
.lm-open{ overflow:hidden !important; }
@media (prefers-reduced-motion:reduce){
  .lm-overlay,.lm-card,.lm-form{ transition:none !important; animation:none !important; }
}

/* ---------- ปุ่มลงชื่อ (ชิปหัวเว็บ) ขยายเป็นการ์ด — ใช้เฉพาะตอน JS ใส่ .lm-morph ---------- */
.lm-overlay.lm-morph{
  opacity:1; background:rgba(0,0,0,0);
  -webkit-backdrop-filter:blur(0px); backdrop-filter:blur(0px);
  transition:background-color .4s ease, -webkit-backdrop-filter .4s ease, backdrop-filter .4s ease, visibility 0s;
}
.lm-overlay.lm-morph.is-open{
  background:rgba(0,0,0,.66);
  -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px);
}
.lm-overlay.lm-morph.lm-morph-out{ visibility:visible; pointer-events:none; transition-duration:.34s; }
.lm-overlay.lm-morph .lm-card{ transition:none; transform:none; opacity:1; }
.lm-shape{
  position:fixed; margin:0; box-sizing:border-box; pointer-events:none;
  border:1px solid transparent;
}
.lm-ghost{
  position:fixed; margin:0; box-sizing:border-box; pointer-events:none;
  display:flex; align-items:center; justify-content:center; white-space:nowrap; overflow:hidden;
}
.lm-ghost svg{ flex-shrink:0; }
