@import url('./user-theme-base.css');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body.login-user-page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0)),
    url('/img/auth/bg.jpg');
  background-size: cover;
  background-position: center;
  position: relative;
}

.login-user-container {
  width: 100%;
  max-width: 520px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding-top: 52vh;
  padding-left: 22px;
  padding-right: 22px;
  padding-bottom: 40px;
  position: relative;
  z-index: 5;
}

.login-user-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  z-index: 10;
}

.login-user-flash {
  width: 100%;
  padding: 14px 18px;
  border-radius: 18px;
  font-size: clamp(14px, 2vw, 18px);
  font-weight: 600;
  text-align: center;
}

.login-user-flash-success {
  color: #9fffd0;
  background: rgba(0, 180, 90, 0.18);
  border: 1px solid rgba(0, 255, 140, 0.25);
}

.login-user-flash-error {
  color: #ffb3c7;
  background: rgba(255, 0, 80, 0.16);
  border: 1px solid rgba(255, 80, 120, 0.28);
}

.input-box {
  position: relative;
  width: 100%;
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(
    90deg,
    #35ecff 0%,
    #00a2ff 20%,
    #004cff 40%,
    #6700ff 62%,
    #ff00c8 82%,
    #ff66f2 100%
  );
  padding: 2px;
  box-shadow:
    0 0 10px rgba(0, 255, 255, 0.35),
    0 0 24px rgba(0, 102, 255, 0.28),
    0 0 40px rgba(255, 0, 170, 0.18);
}

.input-box::before {
  content: '';
  position: absolute;
  top: -60%;
  left: -45%;
  width: 35%;
  height: 220%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent);
  transform: rotate(20deg);
  filter: blur(16px);
  animation: user-lightRun 3s linear infinite;
  z-index: 2;
  pointer-events: none;
}

.input-box::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 30px;
  background: linear-gradient(90deg, #00eaff, #005dff, #8b00ff, #ff00c8, #00eaff);
  background-size: 300% 300%;
  animation: user-borderMove 4s linear infinite;
  filter: blur(12px);
  opacity: 0.9;
  z-index: 0;
}

.input-box input {
  width: 100%;
  height: clamp(68px, 9vw, 84px);
  border: none;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(4, 6, 25, 0.82), rgba(0, 0, 0, 0.94));
  color: #fff;
  font-size: clamp(20px, 2.6vw, 34px);
  padding-left: clamp(62px, 8vw, 88px);
  padding-right: clamp(62px, 8vw, 88px);
  outline: none;
  position: relative;
  z-index: 3;
  box-shadow:
    inset 0 0 18px rgba(0, 0, 0, 0.9),
    inset 0 0 30px rgba(0, 119, 255, 0.1);
}

.input-box input::placeholder {
  color: rgba(255, 255, 255, 0.88);
}

.icon-img {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  object-fit: contain;
  z-index: 5;
  pointer-events: none;
}

.eye-img {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  object-fit: contain;
  cursor: pointer;
  z-index: 5;
}

a.login-btn {
  text-decoration: none;
}

.login-btn {
  position: relative;
  width: 100%;
  height: clamp(78px, 10vw, 96px);
  border: none;
  border-radius: 28px;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 900;
  color: #fff;
  font-family: 'Noto Sans Thai', sans-serif;
  background: linear-gradient(90deg, #00cfff 0%, #0072ff 22%, #4d32ff 45%, #a000ff 70%, #ff00b7 100%);
  box-shadow:
    0 0 12px rgba(0, 255, 255, 0.55),
    0 0 24px rgba(0, 102, 255, 0.45),
    0 0 42px rgba(255, 0, 170, 0.35);
  isolation: isolate;
  transition: 0.25s;
}

.login-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 28px;
  padding: 2px;
  background: linear-gradient(90deg, #35ecff, #0077ff, #7300ff, #ff00cc, #35ecff);
  background-size: 300% 300%;
  animation: user-borderMove 4s linear infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  z-index: 2;
  pointer-events: none;
}

.login-btn::after {
  content: '';
  position: absolute;
  top: -60%;
  left: -40%;
  width: 35%;
  height: 220%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
  transform: rotate(20deg);
  filter: blur(16px);
  animation: user-lightRun 3s linear infinite;
  z-index: 1;
  pointer-events: none;
}

.login-btn:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow:
    0 0 16px rgba(0, 255, 255, 0.75),
    0 0 34px rgba(0, 102, 255, 0.55),
    0 0 58px rgba(255, 0, 170, 0.48);
}

.btn-icon {
  width: clamp(28px, 3vw, 42px);
  height: clamp(28px, 3vw, 42px);
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.7));
}

.login-btn span {
  position: relative;
  z-index: 5;
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.25),
    0 0 18px rgba(255, 255, 255, 0.18);
}

.bottom-menu {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-top: 4px;
}

.bottom-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  white-space: nowrap;
  font-weight: 800;
  font-size: clamp(16px, 2vw, 26px);
  transition: 0.25s;
}

.bottom-menu a:hover {
  transform: translateY(-2px);
}

.menu-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.forgot {
  color: #4ddcff;
  text-shadow: 0 0 12px rgba(0, 200, 255, 0.35);
}

.register {
  color: #ff4be7;
  text-shadow: 0 0 12px rgba(255, 0, 170, 0.35);
}

.divider {
  width: 2px;
  height: 24px;
  background: rgba(255, 255, 255, 0.22);
}

@keyframes borderMove {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

@keyframes lightRun {
  0% { left: -45%; }
  100% { left: 140%; }
}

/* ปุ่มลัดทดสอบ Unity WebGL (ชั่วคราว) */
.dev-play-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 8px;
  padding: 14px 20px;
  border-radius: 22px;
  border: 2px dashed rgba(255, 220, 80, 0.65);
  background: rgba(255, 180, 0, 0.12);
  color: #ffe566;
  font-size: clamp(15px, 2.2vw, 22px);
  font-weight: 800;
  text-decoration: none;
  text-align: center;
  box-shadow: 0 0 16px rgba(255, 200, 0, 0.2);
  transition: 0.25s;
}

.dev-play-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 180, 0, 0.22);
  border-color: rgba(255, 230, 100, 0.9);
  box-shadow: 0 0 24px rgba(255, 200, 0, 0.35);
}

@media (max-width: 768px) {
  .login-user-container {
    padding-top: 50vh;
  }
}
