/* ============ LOGIN — Aurora gradient experience ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Prompt', 'Noto Sans Thai', 'Segoe UI', Tahoma, sans-serif;
  color: #16213e;
  background: #12102e;
  overflow: hidden;
}

/* --------- Animated aurora background --------- */
.aurora { position: fixed; inset: 0; overflow: hidden; z-index: 0;
  background: linear-gradient(135deg, #171643 0%, #251a5e 45%, #3b1670 100%); }
.aurora .blob {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55;
  mix-blend-mode: screen; will-change: transform;
}
.b1 { width: 620px; height: 620px; background: radial-gradient(circle, #6366f1, transparent 65%); top: -180px; left: -120px; animation: drift1 16s ease-in-out infinite; }
.b2 { width: 540px; height: 540px; background: radial-gradient(circle, #d946ef, transparent 65%); bottom: -200px; right: -100px; animation: drift2 19s ease-in-out infinite; }
.b3 { width: 430px; height: 430px; background: radial-gradient(circle, #0ea5e9, transparent 65%); top: 32%; left: 56%; animation: drift3 22s ease-in-out infinite; }
.b4 { width: 330px; height: 330px; background: radial-gradient(circle, #a855f7, transparent 62%); top: 58%; left: 6%; animation: drift2 24s ease-in-out infinite reverse; }
@keyframes drift1 { 50% { transform: translate(90px, 60px) scale(1.12); } }
@keyframes drift2 { 50% { transform: translate(-70px, -50px) scale(1.16); } }
@keyframes drift3 { 33% { transform: translate(-90px, 40px) scale(.92); } 66% { transform: translate(50px, -60px) scale(1.08); } }

/* grid overlay */
.aurora::after {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.16) 1px, transparent 1.4px);
  background-size: 34px 34px;
  mask-image: radial-gradient(ellipse 90% 75% at 50% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 75% at 50% 40%, #000 20%, transparent 75%);
}

/* particles */
.spark { position: absolute; width: 5px; height: 5px; border-radius: 50%;
  background: #fff; opacity: 0; animation: rise linear infinite; }
@keyframes rise {
  0% { opacity: 0; transform: translateY(30px) scale(.6); }
  12% { opacity: .75; }
  85% { opacity: .25; }
  100% { opacity: 0; transform: translateY(-88vh) scale(1.15); }
}

/* --------- Stage --------- */
.stage {
  position: relative; z-index: 2; height: 100%;
  display: flex; align-items: center; justify-content: center; padding: 22px;
}
.panel {
  width: 100%; max-width: 1010px;
  display: grid; grid-template-columns: 1.06fr 1fr;
  border-radius: 26px; overflow: hidden;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .14);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 40px 90px -22px rgba(8, 6, 40, .8), inset 0 1px 0 rgba(255,255,255,.12);
  animation: panelIn .8s cubic-bezier(.22, .9, .32, 1.1) both;
}
@keyframes panelIn { from { opacity: 0; transform: translateY(46px) scale(.97); } }

/* --------- Left showcase --------- */
.showcase {
  position: relative; padding: 46px 44px;
  color: #eef0ff; display: flex; flex-direction: column;
  background: linear-gradient(160deg, rgba(99, 102, 241, .28), rgba(168, 85, 247, .16) 55%, rgba(217, 70, 239, .2));
  overflow: hidden;
}
.logo-row { display: flex; align-items: center; gap: 13px; }
.logo-badge {
  width: 50px; height: 50px; border-radius: 15px;
  background: linear-gradient(135deg, #6366f1, #a855f7 70%, #d946ef);
  display: grid; place-items: center; color: #fff; font-size: 25px; font-weight: 700;
  box-shadow: 0 10px 26px -6px rgba(168, 85, 247, .75), inset 0 1.5px 0 rgba(255,255,255,.4);
}
.logo-name { font-size: 27px; font-weight: 700; letter-spacing: .4px;
  background: linear-gradient(90deg, #fff, #d8ddff 55%, #f3d8ff);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-sub { font-size: 11.5px; color: #aab2ea; letter-spacing: 2.2px; text-transform: uppercase; margin-top: -2px; }

.show-heading { margin-top: 44px; font-size: 27px; font-weight: 600; line-height: 1.4; }
.show-heading .hl {
  background: linear-gradient(90deg, #a5b4fc, #e879f9);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.show-desc { margin-top: 12px; font-size: 13.2px; color: #b6bdf0; line-height: 1.8; max-width: 380px; }

.feature-list { margin-top: 28px; display: flex; flex-direction: column; gap: 13px; }
.feat { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #cdd3fa;
  opacity: 0; animation: featIn .6s ease both; }
.feat:nth-child(1) { animation-delay: .45s; } .feat:nth-child(2) { animation-delay: .6s; }
.feat:nth-child(3) { animation-delay: .75s; } .feat:nth-child(4) { animation-delay: .9s; }
@keyframes featIn { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; } }
.feat .f-ico {
  width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, rgba(99,102,241,.9), rgba(217,70,239,.8));
  box-shadow: 0 6px 14px -4px rgba(139, 92, 246, .6);
}

.show-stats { margin-top: auto; display: flex; gap: 12px; padding-top: 30px; }
.ss {
  flex: 1; border-radius: 15px; padding: 13px 15px;
  background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.15);
  backdrop-filter: blur(8px);
}
.ss b { font-size: 21px; font-weight: 700; display: block;
  background: linear-gradient(90deg, #fff, #c7d2fe); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ss span { font-size: 10.8px; color: #a9b1e8; }

/* decorative ring */
.ring {
  position: absolute; border: 1.5px solid rgba(255,255,255,.12); border-radius: 50%;
  pointer-events: none;
}
.ring1 { width: 340px; height: 340px; right: -140px; top: -120px; animation: spin 40s linear infinite; border-style: dashed; }
.ring2 { width: 220px; height: 220px; right: -70px; top: -50px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --------- Right form --------- */
.form-pane {
  background: #fff; padding: 46px 46px 38px;
  display: flex; flex-direction: column; justify-content: center;
}
.fp-title { font-size: 23px; font-weight: 700; }
.fp-sub { font-size: 13px; color: #7c88a8; margin-top: 5px; }

.lfield { margin-top: 20px; opacity: 0; animation: featIn .55s ease both; }
.lfield:nth-of-type(1) { animation-delay: .35s; }
.lfield:nth-of-type(2) { animation-delay: .5s; }
.lfield label { font-size: 12.6px; font-weight: 500; color: #3b4468; display: block; margin-bottom: 7px; }
.lctrl { position: relative; }
.lctrl .lic { position: absolute; left: 14px; top: 13px; color: #98a2c5; pointer-events: none; }
.lctrl input {
  width: 100%; height: 47px; border-radius: 13px;
  border: 1.5px solid #e3e7f5; background: #f8f9fe;
  padding: 0 44px; font-family: inherit; font-size: 14px; color: #16213e;
  transition: all .22s;
}
.lctrl input:focus {
  outline: none; background: #fff; border-color: #8b5cf6;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, .16);
}
.eye-btn {
  position: absolute; right: 8px; top: 7px; width: 33px; height: 33px;
  border: 0; border-radius: 9px; background: none; color: #98a2c5; cursor: pointer;
  display: grid; place-items: center;
}
.eye-btn:hover { background: #f1f0ff; color: #6366f1; }

.row-opts { display: flex; align-items: center; margin-top: 15px; font-size: 12.6px; }
.row-opts label { display: flex; gap: 8px; align-items: center; color: #5a6488; cursor: pointer; }
.row-opts input { accent-color: #8b5cf6; width: 15px; height: 15px; }
.row-opts a { margin-left: auto; color: #8b5cf6; text-decoration: none; }

.login-btn {
  margin-top: 22px; width: 100%; height: 49px; border: 0; border-radius: 14px;
  background: linear-gradient(120deg, #6366f1, #8b5cf6 45%, #c026d3 110%);
  background-size: 170% 100%;
  color: #fff; font-family: inherit; font-size: 15px; font-weight: 600; letter-spacing: .3px;
  cursor: pointer; transition: all .3s;
  box-shadow: 0 14px 30px -8px rgba(139, 92, 246, .65), inset 0 1.5px 0 rgba(255,255,255,.3);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  position: relative; overflow: hidden;
}
.login-btn::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%);
  transform: translateX(-110%);
}
.login-btn:hover { background-position: 90% 0; transform: translateY(-2px); box-shadow: 0 18px 36px -8px rgba(168, 85, 247, .75); }
.login-btn:hover::after { transform: translateX(110%); transition: transform .7s; }
.login-btn:active { transform: scale(.98); }
.login-btn.loading { pointer-events: none; opacity: .85; }
.login-btn .spin {
  width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite; display: none;
}
.login-btn.loading .spin { display: block; }

.err-box {
  margin-top: 18px; border-radius: 12px; background: #ffe9ed; color: #c81e35;
  border: 1px solid #ffd0d9; padding: 12px 15px; font-size: 12.8px;
  display: flex; gap: 9px; align-items: center;
  animation: shake .5s;
}
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.demo-zone { margin-top: 26px; padding-top: 20px; border-top: 1px dashed #e3e7f5; }
.demo-zone p { font-size: 11.6px; color: #98a2c5; margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.demo-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.demo-chip {
  border: 1px solid #e3e7f5; background: #f8f9fe; border-radius: 20px;
  padding: 6px 13px; font-family: inherit; font-size: 11.8px; color: #5a6488;
  cursor: pointer; transition: all .18s; display: flex; align-items: center; gap: 6px;
}
.demo-chip b { color: #6366f1; font-weight: 600; }
.demo-chip:hover { border-color: #8b5cf6; background: #f3f0ff; transform: translateY(-1.5px); box-shadow: 0 6px 14px -6px rgba(139,92,246,.4); }

.copyright { margin-top: 26px; text-align: center; font-size: 11px; color: #b3bad6; }

@media (max-width: 900px) {
  body { overflow: auto; }
  .panel { grid-template-columns: 1fr; max-width: 480px; }
  .showcase { display: none; }
  .stage { align-items: flex-start; padding-top: 7vh; }
}
