/* ── Hero wrap ── */
.hero-wrap {
  position: relative;
  width: 100%;
  background:
    linear-gradient(180deg, rgba(240, 240, 240, 0.92), rgba(240, 240, 240, 0.92)),
    #f0f0f0 url("../assets/images/banner-bg.png") repeat-x center top / auto 100%;
  overflow: hidden;
}

.hero-side-bg {
  display: none;
}

/* ── Hero stack: Banner → Login ── */
.hero-row {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  margin: 0;
  gap: 0;
  background: transparent;
}

.hero-row .banner-slider {
  width: 100%;
  max-width: none;
  margin: 0;
  flex: none;
}

/* ── Login panel ── */
.login-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 18px 16px 20px;
  background:
    linear-gradient(180deg, #faf8ff 0%, #f0ebfa 40%, #ebe4f7 100%);
  border-top: 1px solid rgba(124, 58, 237, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 -6px 28px rgba(91, 33, 182, 0.05);
}

.login-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(124, 58, 237, 0.35) 20%,
    rgba(251, 191, 36, 0.7) 50%,
    rgba(124, 58, 237, 0.35) 80%,
    transparent 100%
  );
  border-radius: 0 0 2px 2px;
}

.login-form {
  position: relative;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 20px 18px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    0 10px 40px rgba(91, 33, 182, 0.1),
    0 2px 8px rgba(91, 33, 182, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}

.login-form__title {
  margin: 0 0 4px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  font-size: var(--fs-2xl);
  font-weight: var(--fw-extrabold);
  text-align: center;
  letter-spacing: var(--tracking-thai);
  line-height: var(--lh-tight);
  word-break: keep-all;
  background: linear-gradient(135deg, #4c1d95 0%, #7c3aed 55%, #9333ea 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-form__title-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  color: #7c3aed;
  stroke: #7c3aed;
  -webkit-text-fill-color: initial;
}

.login-form__title::after {
  content: "";
  display: block;
  flex-basis: 100%;
  width: 52px;
  height: 3px;
  margin: 2px auto 0;
  border-radius: 3px;
  background: linear-gradient(90deg, #7c3aed, #fbbf24);
}

/* ── Input fields ── */
.login-field {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.login-field__icon {
  position: absolute;
  left: 10px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(145deg, rgba(124, 58, 237, 0.14), rgba(168, 85, 247, 0.07));
  color: #7c3aed;
  pointer-events: none;
}

.login-field__icon svg {
  width: 16px;
  height: 16px;
}

.login-field__input {
  width: 100%;
  height: 50px;
  padding: 0 44px 0 50px;
  border: 1.5px solid rgba(124, 58, 237, 0.1);
  border-radius: 13px;
  background: linear-gradient(180deg, #fff 0%, #faf9ff 100%);
  font-family: inherit;
  font-size: var(--fs-md);
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-thai);
  color: #1e1b4b;
  box-shadow:
    0 2px 6px rgba(91, 33, 182, 0.05),
    inset 0 1px 2px rgba(255, 255, 255, 0.8);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.login-field__input::placeholder {
  color: #a1a1aa;
  font-weight: var(--fw-regular);
}

.login-field__input:hover {
  border-color: rgba(124, 58, 237, 0.22);
}

.login-field__input:focus {
  border-color: rgba(124, 58, 237, 0.5);
  background: #fff;
  box-shadow:
    0 0 0 3px rgba(124, 58, 237, 0.1),
    0 4px 12px rgba(91, 33, 182, 0.08);
}

.login-field__toggle {
  position: absolute;
  right: 8px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: #71717a;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.login-field__toggle:hover {
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.08);
}

.login-field__toggle svg {
  width: 17px;
  height: 17px;
}

.login-field__toggle .ico-eye-off {
  display: none;
}

.login-field__toggle.is-visible .ico-eye {
  display: none;
}

.login-field__toggle.is-visible .ico-eye-off {
  display: block;
}

/* ── Login button ── */
.login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 50px;
  margin-top: 4px;
  border: none;
  border-radius: 13px;
  background: linear-gradient(135deg, #6d28d9 0%, #9333ea 40%, #db2777 100%);
  color: #fff;
  font-family: inherit;
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-thai);
  cursor: pointer;
  box-shadow: none;
  transition: transform 0.15s, filter 0.15s;
}

.login-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: none;
}

.login-btn:active {
  transform: translateY(1px);
  filter: brightness(0.97);
}

.login-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ── Forgot password ── */
.login-forgot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  align-self: center;
  padding: 6px 12px;
  border-radius: 999px;
  color: #52525b;
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-thai);
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.login-forgot:hover {
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.06);
}

.login-forgot svg {
  width: 17px;
  height: 17px;
  opacity: 0.75;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  height: auto;
  margin: 6px 0 2px;
  border: none;
  background: none;
  color: #a1a1aa;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-thai);
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124, 58, 237, 0.18), transparent);
}

/* ── Register button ── */
.login-register {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 50px;
  border-radius: 13px;
  background: #fff;
  color: #6d28d9;
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-thai);
  box-shadow: 0 3px 12px rgba(91, 33, 182, 0.08);
  transition: transform 0.15s, box-shadow 0.15s, color 0.15s;
  white-space: nowrap;
}

.login-register::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 2px;
  border-radius: 13px;
  background: linear-gradient(135deg, #818cf8, #a78bfa, #f472b6, #fbbf24);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.login-register:hover {
  transform: translateY(-1px);
  color: #5b21b6;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.14);
}

.login-register:active {
  transform: translateY(1px);
}

.login-register svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ── Mobile: แสดงแค่ 2 ปุ่ม กดเข้าสู่ระบบแล้วขยายฟอร์มเต็ม ── */
.login-form__compact {
  display: none;
}

@media (max-width: 767px) {
  .game-lobby__right .login-panel {
    padding: 0;
  }

  .game-lobby__right .login-form {
    gap: 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .login-form__compact {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    max-height: 56px;
    opacity: 1;
    overflow: hidden;
    transition:
      max-height 0.32s ease,
      opacity 0.24s ease,
      margin 0.32s ease;
  }

  .login-panel.is-expanded .login-form__compact {
    max-height: 0;
    opacity: 0;
    margin: 0;
    pointer-events: none;
  }

  .login-form__compact .login-btn,
  .login-form__compact .login-register {
    flex: 1 1 0;
    min-width: 0;
    height: 46px;
    margin-top: 0;
    font-size: var(--fs-base);
    border-radius: 12px;
  }

  .login-form__compact .login-btn svg,
  .login-form__compact .login-register svg {
    width: 16px;
    height: 16px;
  }

  .login-form__details {
    display: flex;
    flex-direction: column;
    gap: 11px;
    width: 100%;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0 14px;
    margin: 0;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid transparent;
    box-shadow: none;
    transform: translateY(-8px);
    transition:
      max-height 0.42s cubic-bezier(0.22, 1, 0.36, 1),
      opacity 0.32s ease 0.06s,
      transform 0.36s cubic-bezier(0.22, 1, 0.36, 1),
      padding 0.36s ease,
      border-color 0.32s ease,
      box-shadow 0.36s ease;
  }

  .login-panel.is-expanded .login-form__details {
    max-height: 560px;
    opacity: 1;
    padding: 14px 14px 16px;
    transform: translateY(0);
    border-color: rgba(255, 255, 255, 0.95);
    box-shadow:
      0 10px 40px rgba(91, 33, 182, 0.1),
      0 2px 8px rgba(91, 33, 182, 0.04),
      inset 0 1px 0 rgba(255, 255, 255, 1);
  }
}

@media (min-width: 768px) {
  .login-form__compact {
    display: none !important;
  }

  .login-form__details {
    display: contents;
    max-height: none;
    opacity: 1;
    overflow: visible;
    padding: 0;
    margin: 0;
    transform: none;
    border: none;
    box-shadow: none;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition: none;
  }
}

/* ── Login ใน game lobby (เหนือรูปหมวดเกม) ── */
.game-lobby__right .login-panel {
  width: 100%;
  padding: 0 0 4px;
  background: transparent;
  border-top: none;
  box-shadow: none;
}

.game-lobby__right .login-panel::before {
  display: none;
}

.game-lobby__right .login-form {
  max-width: none;
}

@media (min-width: 768px) {
  .game-lobby__right .login-panel {
    padding: 0 0 6px;
  }
}

@media (min-width: 992px) {
  .game-lobby__right .login-panel {
    padding: 0;
  }
}
@media (min-width: 768px) {
  .login-panel {
    padding: 16px 12px 18px;
  }

  .login-form {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    box-sizing: border-box;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px 14px;
    padding: 14px 22px;
    border-radius: 16px;
  }

  .login-form__title {
    margin: 0;
    width: auto;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    font-size: var(--fs-lg);
    white-space: nowrap;
    text-align: left;
    justify-content: flex-start;
    background: none;
    -webkit-text-fill-color: #5b21b6;
    color: #5b21b6;
    padding-right: 6px;
    border-right: 2px solid rgba(124, 58, 237, 0.15);
    margin-right: 2px;
    padding-bottom: 0;
  }

  .login-form__title-icon {
    width: 24px;
    height: 24px;
    stroke: #7c3aed;
  }

  .login-form__title::after {
    display: none;
    content: none;
  }

  .login-field {
    flex: 1 1 180px;
    min-width: 0;
    max-width: 100%;
  }

  .login-field__input,
  .login-btn,
  .login-register {
    height: 46px;
    border-radius: 11px;
  }

  .login-field__input {
    padding-left: 48px;
  }

  .login-btn {
    width: auto;
    min-width: 148px;
    margin-top: 0;
    flex: 0 0 auto;
    padding: 0 22px;
    font-size: var(--fs-md);
    border-radius: 11px;
  }

  .login-forgot {
    align-self: center;
    padding: 6px 10px;
  }

  .login-divider {
    display: none;
  }

  .login-register {
    width: auto;
    min-width: 0;
    max-width: 100%;
    flex: 0 0 auto;
    padding: 0 20px;
    height: 46px;
    border-radius: 11px;
    box-sizing: border-box;
  }

  .login-register::before {
    border-radius: 11px;
  }
}

@media (min-width: 992px) {
  .login-panel {
    padding: 20px clamp(16px, 2vw, 36px) 24px;
  }

  .login-form {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    box-sizing: border-box;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 12px 16px;
    padding: 16px clamp(20px, 2.2vw, 32px);
    border-radius: 18px;
  }

  .login-form__title {
    margin: 0;
    width: auto;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    font-size: clamp(1.15rem, 1.4vw, 1.4rem);
    white-space: nowrap;
    text-align: left;
    justify-content: flex-start;
    background: none;
    -webkit-text-fill-color: #5b21b6;
    color: #5b21b6;
    padding-right: 14px;
    border-right: 2px solid rgba(124, 58, 237, 0.15);
    margin-right: 2px;
    padding-bottom: 0;
  }

  .login-form__title-icon {
    width: 28px;
    height: 28px;
    stroke: #7c3aed;
  }

  .login-form__title::after {
    display: none;
    content: none;
  }

  .login-field {
    flex: 2 1 200px;
    min-width: 0;
    max-width: 100%;
  }

  .login-field__icon {
    left: 12px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .login-field__icon svg {
    width: 18px;
    height: 18px;
  }

  .login-field__input,
  .login-btn,
  .login-register {
    height: 54px;
    border-radius: 13px;
  }

  .login-field__input {
    padding: 0 48px 0 54px;
    font-size: var(--fs-md);
  }

  .login-field__toggle {
    width: 38px;
    height: 38px;
    right: 10px;
  }

  .login-field__toggle svg {
    width: 18px;
    height: 18px;
  }

  .login-btn {
    width: auto;
    min-width: 168px;
    margin-top: 0;
    flex: 0 0 auto;
    padding: 0 28px;
    font-size: var(--fs-lg);
    border-radius: 13px;
  }

  .login-btn svg {
    width: 20px;
    height: 20px;
  }

  .login-forgot {
    align-self: center;
    padding: 8px 12px;
    font-size: var(--fs-md);
    flex: 0 1 auto;
    margin-left: auto;
  }

  .login-forgot svg {
    width: 18px;
    height: 18px;
  }

  .login-divider {
    display: none;
  }

  .login-register {
    width: auto;
    min-width: 0;
    max-width: 100%;
    flex: 0 0 auto;
    padding: 0 22px;
    height: 54px;
    font-size: var(--fs-lg);
    border-radius: 13px;
    box-sizing: border-box;
  }

  .login-register::before {
    border-radius: 13px;
  }

  .login-register svg {
    width: 20px;
    height: 20px;
  }
}

@media (min-width: 992px) and (max-width: 1279px) {
  .login-form {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .login-field {
    flex: 1 1 200px;
    min-width: 0;
  }

  .login-btn,
  .login-register {
    flex: 0 0 auto;
  }
}

@media (min-width: 1280px) {
  .login-form {
    flex-wrap: nowrap;
    gap: 10px 12px;
    padding: 16px 20px;
  }

  .login-form__title {
    flex: 0 0 auto;
    font-size: var(--fs-xl);
    padding-right: 14px;
    margin-right: 2px;
  }

  .login-field {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
  }

  .login-btn {
    min-width: 132px;
    padding: 0 18px;
    flex: 0 0 auto;
  }

  .login-forgot {
    margin-left: 0;
    padding: 8px 10px;
    flex: 0 0 auto;
  }

  .login-register {
    min-width: 0;
    padding: 0 18px;
    flex: 0 0 auto;
  }
}

@media (min-width: 1400px) {
  .login-form {
    gap: 14px 18px;
    padding: 16px clamp(22px, 2.5vw, 36px);
  }

  .login-field {
    flex: 2 1 0;
    min-width: 0;
  }

  .login-btn {
    min-width: 168px;
    padding: 0 28px;
  }

  .login-register {
    padding: 0 26px;
  }
}
