/* ===== AUTH MODAL ===== */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2,4,8,0.88);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.auth-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.auth-modal-outer {
  position: relative;
  width: min(460px, 95vw);
  padding-top: 360px;
  transition: padding-top 0.3s ease;
}
.auth-modal-outer.reg-tab { padding-top: 315px; }
@media (max-width: 480px) {
  .auth-modal-outer         { padding-top: 360px; }
  .auth-modal-outer.reg-tab { padding-top: 315px; }
}

.auth-mascot {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 268px;
  height: 457px;
  background-image: url('/samurai-sprite.png');
  background-repeat: no-repeat;
  background-size: 1072px 457px;
  background-position: -804px 0px;
  pointer-events: none;
  z-index: 1;
  image-rendering: pixelated;
}

.auth-modal {
  width: 100%;
  background: #0a1525;
  border: 1px solid rgba(0,180,255,0.22);
  box-shadow: 0 0 60px rgba(0,180,255,0.12), 0 40px 80px rgba(0,0,0,0.7);
  position: relative;
  z-index: 10;
  transform: scale(0.94) translateY(14px);
  transition: transform 0.38s cubic-bezier(0.16,1,0.3,1);
  overflow: hidden;
}
.auth-overlay.open .auth-modal {
  transform: scale(1) translateY(0);
}
/* Corner brackets */
.auth-corner { position: absolute; width: 14px; height: 14px; pointer-events: none; }
.auth-corner.tl { top: 0; left: 0;  border-top: 1.5px solid #00b4ff; border-left:  1.5px solid #00b4ff; }
.auth-corner.tr { top: 0; right: 0; border-top: 1.5px solid #00b4ff; border-right: 1.5px solid #00b4ff; }
.auth-corner.bl { bottom: 0; left: 0;  border-bottom: 1.5px solid #00b4ff; border-left:  1.5px solid #00b4ff; }
.auth-corner.br { bottom: 0; right: 0; border-bottom: 1.5px solid #00b4ff; border-right: 1.5px solid #00b4ff; }

/* Scan-line top bar */
.auth-modal::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #00b4ff, transparent);
  opacity: 0.6;
}

.auth-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid rgba(0,180,255,0.15);
  background: rgba(5,11,20,0.6);
}
.auth-modal-logo {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  background: linear-gradient(90deg, #00b4ff, #9e06da);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-modal-close {
  background: none;
  border: 1px solid rgba(0,180,255,0.2);
  color: #5a7a9a;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; line-height: 1;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.auth-modal-close:hover { color: #00b4ff; border-color: #00b4ff; }

.auth-tabs {
  display: flex;
  border-bottom: 1px solid rgba(0,180,255,0.15);
}
.auth-tab {
  flex: 1;
  padding: 0.85rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #5a7a9a;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.auth-tab.active {
  color: #00b4ff;
  border-bottom-color: #00b4ff;
  background: rgba(0,180,255,0.05);
}
.auth-tab:hover:not(.active) { color: #e8f4ff; }

.auth-body { padding: 1.8rem 1.6rem 1.4rem; }
.auth-panel { display: none; }
.auth-panel.active { display: block; }

.auth-field { margin-bottom: 1rem; }
.auth-label {
  display: block;
  font-family: 'Courier New', 'Consolas', monospace;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #bdc8d2;
  margin-bottom: 0.38rem;
}
.auth-input-wrap { position: relative; }
.auth-input-icon {
  position: absolute;
  left: 11px; top: 50%; transform: translateY(-50%);
  color: #5a7a9a;
  pointer-events: none;
  display: flex; align-items: center;
}
.auth-input {
  width: 100%;
  background: #050b14;
  border: 1px solid rgba(62,72,81,0.55);
  color: #e8f4ff;
  font-family: 'Courier New', 'Consolas', monospace;
  font-size: 0.82rem;
  padding: 0.68rem 0.9rem 0.68rem 2.4rem;
  outline: none;
  border-radius: 0;
  -webkit-appearance: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-input:focus {
  border-color: #00b4ff;
  box-shadow: 0 0 10px rgba(0,180,255,0.18);
}
.auth-input::placeholder { color: rgba(189,200,210,0.28); }
.auth-input.pr { padding-right: 2.4rem; }
.auth-eye {
  position: absolute;
  right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none;
  color: #5a7a9a; cursor: pointer; padding: 3px;
  transition: color 0.2s;
  display: flex; align-items: center;
}
.auth-eye:hover { color: #00b4ff; }

.auth-error {
  padding: 0.55rem 0.8rem;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.3);
  font-family: 'Courier New', monospace;
  font-size: 0.68rem;
  color: #f87171;
  margin-bottom: 0.9rem;
  display: none;
}
.auth-error.show { display: block; }

.auth-success {
  padding: 1.8rem 1rem;
  background: rgba(16,185,129,0.07);
  border: 1px solid rgba(16,185,129,0.25);
  text-align: center;
  font-family: 'Courier New', monospace;
  display: none;
}
.auth-success.show { display: block; }
.auth-success-icon { font-size: 2.2rem; margin-bottom: 0.5rem; }
.auth-success-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #34d399;
  margin-bottom: 0.3rem;
}
.auth-success-sub { font-size: 0.68rem; color: #5a7a9a; }

.auth-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%;
  padding: 0.9rem;
  background: #00b4ff;
  color: #001e2f;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid #00b4ff;
  cursor: pointer;
  transition: box-shadow 0.22s;
  margin-top: 0.5rem;
  position: relative;
  overflow: hidden;
}
.auth-btn:hover { box-shadow: 0 0 26px rgba(0,180,255,0.5); }
.auth-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.auth-btn .btn-shine {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transform: translateX(-100%);
  transition: transform 0.42s ease;
}
.auth-btn:hover .btn-shine { transform: translateX(100%); }

.auth-footer-link {
  text-align: center;
  margin-top: 1rem;
}
.auth-footer-link a {
  font-family: 'Courier New', monospace;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: #5a7a9a;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s;
}
.auth-footer-link a:hover { color: #00b4ff; }

.auth-checkbox-wrap {
  display: flex; align-items: flex-start; gap: 0.7rem;
  margin-bottom: 1rem;
}
.auth-checkbox { display: none; }
.auth-checkbox-custom {
  width: 16px; height: 16px; flex-shrink: 0;
  border: 1px solid rgba(62,72,81,0.7);
  background: #050b14;
  margin-top: 2px;
  cursor: pointer;
  position: relative;
  border-radius: 3px;
  display: block;
  transition: border-color 0.2s, background 0.2s;
}
.auth-checkbox:checked + .auth-checkbox-custom {
  background: #00b4ff;
  border-color: #00b4ff;
  box-shadow: 0 0 8px rgba(0,180,255,0.4);
}
.auth-checkbox:checked + .auth-checkbox-custom::after {
  content: '✓';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}
.auth-checkbox-label {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 0.7rem;
  color: #5a7a9a;
  line-height: 1.55;
}

@keyframes auth-spin { to { transform: rotate(360deg); } }
.auth-spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(0,30,47,0.5);
  border-top-color: #001e2f;
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
}
