/* เข้าสู่ระบบ / สมัครสมาชิก: การ์ดสองฝั่งแบบ ref (ภาพตัวละครซ้าย · ฟอร์มขวา) — store/js/store.js gameAuthTabs() */
.za-wrap {
  /* เต็มจอ: ปิดทับ topbar/footer ของร้าน — หน้า SPA เปลี่ยนเมื่อ route ใหม่ mount (การ์ดหายไปเอง) */
  position: fixed;
  inset: 0;
  z-index: 800;
  overflow-y: auto;
  background: #060a13;
}

body:has(.za-wrap) {
  overflow: hidden;
}

.za-card {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: #0a0f1a;
  text-align: left;
}

/* ---- ภาพซ้าย */
.za-art {
  position: relative;
  overflow: hidden;
  background: radial-gradient(120% 90% at 30% 15%, #14356a 0%, #0a1528 55%, #060a13 100%);
}

.za-art::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('/assets/images/hero-bg.jpg') center / cover no-repeat;
  filter: grayscale(1) sepia(0.45) hue-rotate(175deg) saturate(1.6) brightness(0.6);
  opacity: 0.45;
}

.za-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, rgba(5, 9, 18, 0.95) 0%, rgba(5, 9, 18, 0.25) 38%, transparent 60%),
    linear-gradient(90deg, transparent 70%, rgba(10, 15, 26, 0.85) 100%);
  pointer-events: none;
}

.za-art-man {
  position: absolute;
  right: 6%;
  bottom: 0;
  height: 94%;
  max-width: 92%;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 30px rgba(14, 165, 255, 0.25));
}

.za-hello {
  position: absolute;
  left: clamp(2rem, 5vw, 4.5rem);
  bottom: clamp(2rem, 7vh, 4.5rem);
  z-index: 2;
  max-width: 70%;
}

.za-hello h2 {
  margin: 0;
  font-family: var(--font-display, 'Outfit', 'Kanit', sans-serif);
  font-size: clamp(2.6rem, 4.5vw, 4rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
}

.za-hello p {
  margin: 0.55rem 0 0;
  font-size: clamp(1.05rem, 1.4vw, 1.3rem);
  color: #cfe8ff;
}

/* ---- ฟอร์มขวา */
.za-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  padding: 4.5rem clamp(1.5rem, 6vw, 6rem) 3rem;
  background: linear-gradient(180deg, #0f1726 0%, #0a0f1a 100%);
}

.za-side > * {
  width: 100%;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.za-back {
  position: absolute;
  top: 1.4rem;
  left: 1.6rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  width: auto !important;
  height: 42px;
  padding: 0 1.1rem 0 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(92, 200, 255, 0.28);
  background: rgba(14, 24, 40, 0.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  font-size: 0.9rem;
  font-weight: 600;
  color: #e6f4ff;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.za-back-ic {
  position: relative;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22b8ff 0%, #2563eb 100%);
  box-shadow: 0 0 14px rgba(14, 165, 255, 0.45);
  transition: transform 0.2s ease;
}

/* ลูกศรซ้าย: หัวลูกศร (กรอบหมุน 45°) + ก้าน */
.za-back-ic::before,
.za-back-ic::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
}

.za-back-ic::before {
  width: 8px;
  height: 8px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: translate(-60%, -50%) rotate(45deg);
}

.za-back-ic::after {
  width: 12px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transform: translate(-50%, -50%);
}

.za-back:hover {
  border-color: rgba(92, 200, 255, 0.6);
  background: rgba(18, 34, 58, 0.9);
  box-shadow: 0 8px 24px rgba(14, 165, 255, 0.25);
  color: #fff;
}

.za-back:hover .za-back-ic {
  transform: translateX(-3px);
}

.za-back:focus-visible {
  outline: 2px solid #5cc8ff;
  outline-offset: 3px;
}

.za-side > .za-error {
  margin-bottom: 0.8rem;
}

.za-logo {
  align-self: center;
  width: 190px;
  height: auto;
  filter: drop-shadow(0 0 18px rgba(14, 165, 255, 0.35));
}

.za-kicker {
  margin-top: 0.6rem;
  margin-bottom: 0;
  text-align: center;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: #7fc4ff;
}

.za-title {
  margin-top: 0.35rem;
  margin-bottom: 1.4rem;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}

.za-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.za-form[hidden] {
  display: none;
}

.za-field {
  display: block;
}

.za-field[hidden] {
  display: none;
}

.za-field > span {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: #b9c7da;
}

.za-card .za-input {
  width: 100%;
  height: 46px;
  padding: 0 0.95rem;
  border-radius: 9px;
  border: 1px solid #22314a;
  background: #121b2b;
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.za-card .za-input::placeholder {
  color: #5f6f86;
}

.za-card .za-input:focus {
  outline: none;
  border-color: #0ea5ff;
  background: #142036;
  box-shadow: 0 0 0 3px rgba(14, 165, 255, 0.2);
}

.za-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.za-check {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  font-size: 0.84rem;
  color: #9fb0c6;
}

.za-check input {
  flex: none;
  margin-top: 0.2rem;
  accent-color: #0ea5ff;
}

.za-check a {
  color: #fff;
  text-decoration: underline;
}

.za-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.za-error {
  margin: 0;
}

.za-submit {
  height: 48px;
  margin-top: 0.35rem;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(135deg, #22b8ff 0%, #0ea5ff 40%, #2563eb 100%);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(14, 165, 255, 0.35);
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.za-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(14, 165, 255, 0.5);
}

.za-submit:disabled {
  filter: grayscale(0.4) brightness(0.8);
  cursor: progress;
  transform: none;
}

.za-submit:focus-visible,
.za-link:focus-visible {
  outline: 2px solid #5cc8ff;
  outline-offset: 3px;
}

.za-switch {
  margin-top: 1.4rem;
  margin-bottom: 0;
  text-align: center;
  font-size: 0.9rem;
  color: #9fb0c6;
}

.za-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  color: #38b6ff;
  cursor: pointer;
}

.za-link:hover {
  color: #8bd8ff;
  text-decoration: underline;
}

/* ---- มือถือ: ภาพเป็นแถบด้านบน ฟอร์มด้านล่าง */
@media (max-width: 820px) {
  .za-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .za-art {
    height: 230px;
  }

  .za-art-man {
    height: 112%;
    bottom: -14%;
    right: 4%;
  }

  .za-hello {
    left: 1.25rem;
    bottom: 1.1rem;
  }

  .za-hello h2 {
    font-size: 2rem;
  }

  .za-hello p {
    font-size: 0.92rem;
  }

  .za-back {
    top: -216px;
    left: 0.9rem;
    height: 38px;
    font-size: 0.84rem;
  }

  .za-back-ic {
    width: 28px;
    height: 28px;
  }

  .za-side {
    justify-content: flex-start;
    padding: 1.8rem 1.25rem 2rem;
  }

  .za-logo {
    width: 160px;
  }
}

@media (max-width: 420px) {
  .za-row2 {
    grid-template-columns: 1fr;
  }
}

/* ปุ่มรูปตา แสดง/ซ่อนรหัสผ่าน */
.za-pass { position: relative; display: block; }
.za-card .za-pass .za-input { padding-right: 2.9rem; }
.za-eye {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: #7f8fa6;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.za-eye:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.za-eye[aria-pressed='true'] { color: #38b6ff; }
.za-eye:focus-visible { outline: 2px solid #5cc8ff; outline-offset: 1px; }

/* "ยังไม่มีบัญชี? สมัครสมาชิก / ลืมรหัสผ่าน?" */
.za-forgot-wrap[hidden] { display: none; }
.za-sep { margin: 0 0.55rem; color: #4b5a70; }
.za-forgot { text-decoration: none; }
