/* Login / Register — game_tgn_0038 SPLIT-FLAP TERMINAL */

.g38-auth-page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px 48px;
  min-height: 60vh;
}

.g38-auth-card {
  width: 100%;
  max-width: 420px;
  padding: 24px 22px 26px;
  background: var(--g38-flap);
  color: var(--g38-ink);
  border: 1px solid var(--g38-line);
  border-radius: 2px;
  box-shadow:
    0 0 0 1px rgba(10, 10, 11, 0.35),
    0 18px 48px rgba(0, 0, 0, 0.45);
}

.g38-auth-kicker {
  margin: 0 0 6px;
  font-family: var(--g38-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--g38-metal);
}

.g38-auth-head {
  margin: 0 0 18px;
  font-family: var(--g38-sans);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--g38-ink);
}

.g38-auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(18, 18, 18, 0.14);
}

.g38-auth-tab {
  flex: 1;
  padding: 10px 12px;
  font: inherit;
  font-family: var(--g38-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7278;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.g38-auth-tab:hover {
  color: var(--g38-ink);
}

.g38-auth-tab.active {
  color: var(--g38-ink);
  border-bottom-color: var(--g38-led);
  background: rgba(240, 162, 2, 0.1);
}

.g38-auth-panel { display: none; }
.g38-auth-panel.active { display: block; }

.g38-auth-alert {
  display: none;
  padding: 10px 12px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  border: 1px solid transparent;
  border-radius: 2px;
}

.g38-auth-alert.show { display: block; }
.g38-auth-alert.success {
  color: #14532d;
  background: #ecfdf3;
  border-color: #86efac;
}
.g38-auth-alert.error {
  color: #7f1d1d;
  background: #fef2f2;
  border-color: #fca5a5;
}

.g38-form-group {
  margin-bottom: 1rem;
}

.g38-form-group label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--g38-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--g38-metal);
}

.g38-form-input-wrap {
  position: relative;
}

.g38-form-input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--g38-ink);
  background: #f4f1e8;
  border: 1px solid rgba(61, 90, 91, 0.45);
  border-radius: 2px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.g38-form-input:focus {
  border-color: var(--g38-led);
  box-shadow: 0 0 0 2px rgba(240, 162, 2, 0.22);
}

.g38-form-group.has-error .g38-form-input {
  border-color: #dc2626;
  box-shadow: none;
}

.g38-form-error {
  display: none;
  margin-top: 4px;
  font-size: 0.8125rem;
  color: #b91c1c;
}

.g38-form-group.has-error .g38-form-error { display: block; }

.g38-pwd-toggle {
  position: absolute;
  right: 0;
  top: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--g38-metal);
  cursor: pointer;
}

.g38-pwd-toggle:hover {
  color: var(--g38-ink);
}

.g38-pwd-icon {
  display: block;
  width: 18px;
  height: 12px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  position: relative;
}

.g38-pwd-icon::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  background: currentColor;
}

.g38-form-input.has-toggle {
  padding-right: 44px;
}

.g38-btn-auth {
  width: 100%;
  height: 48px;
  margin-top: 0.5rem;
  padding: 0 14px;
  font: inherit;
  font-family: var(--g38-mono);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--g38-ink);
  background: var(--g38-led);
  border: 1px solid var(--g38-led);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  transition: filter 0.18s ease, transform 0.18s ease;
}

.g38-btn-auth:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.g38-btn-auth:active {
  transform: translateY(0);
}

.g38-btn-auth.loading {
  pointer-events: none;
  opacity: 0.75;
}

.g38-btn-auth.loading .g38-btn-auth-text { visibility: hidden; }

.g38-btn-auth.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(18, 18, 18, 0.25);
  border-top-color: var(--g38-ink);
  border-radius: 50%;
  animation: g38-auth-spin 0.7s linear infinite;
}

@keyframes g38-auth-spin {
  to { transform: rotate(360deg); }
}

.g38-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 1.35rem 0;
  font-family: var(--g38-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--g38-metal);
}

.g38-auth-divider::before,
.g38-auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(18, 18, 18, 0.14);
}

.g38-social-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.g38-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 42px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  border: none;
  border-radius: 2px;
  cursor: pointer;
}

.g38-social-btn--fb { background: #1877f2; }
.g38-social-btn--google { background: #ea4335; }
.g38-social-btn--twitter { background: #1da1f2; }
.g38-social-btn--steam { background: #171a21; }

@media (max-width: 480px) {
  .g38-auth-card {
    padding: 18px 16px 20px;
  }

  .g38-auth-head {
    font-size: 1.28rem;
  }
}

/* Login modal — boarding-pass overlay */
.g38-login-modal {
  position: fixed;
  inset: 0;
  z-index: 25000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.g38-login-modal.is-open {
  display: flex;
}

.g38-login-modal[hidden] {
  display: none !important;
}

.g38-login-modal.is-open[hidden] {
  display: flex !important;
}

.g38-login-modal__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(18, 19, 20, 0.55) 0%, rgba(10, 10, 11, 0.82) 100%);
  backdrop-filter: blur(2px);
}

.g38-login-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  animation: g38-modal-in 0.22s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .g38-login-modal__panel { animation: none; }
}

@keyframes g38-modal-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.g38-login-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--g38-ink);
  background: #f4f1e8;
  border: 1px solid rgba(61, 90, 91, 0.45);
  border-radius: 2px;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.g38-login-modal__close:hover {
  color: var(--g38-ink);
  background: var(--g38-led);
  border-color: var(--g38-led);
}

.g38-auth-card--modal {
  margin: 0;
  max-width: none;
  padding-top: 28px;
}

body.g38-login-open {
  overflow: hidden;
}

body.g38-login-open .back-to-top.g38-back-top,
body.g38-login-open .g38-back-top {
  visibility: hidden !important;
  pointer-events: none;
}
