/* Login / Register — game_tgn_0004 */

.g04-auth-page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px 48px;
}

.g04-auth-card {
  width: 100%;
  max-width: 420px;
  padding: 2rem 2rem 2.25rem;
  background: var(--bg-card);
  border: 2px solid rgba(0, 242, 234, 0.25);
  border-radius: 12px;
  box-shadow: 0 0 32px rgba(255, 42, 109, 0.15);
  color: var(--text-light);
}

.g04-auth-head {
  margin: 0 0 1.25rem;
  padding-right: 2.5rem;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
  color: var(--primary-color);
  text-shadow: 0 0 12px rgba(5, 217, 232, 0.35);
  letter-spacing: 0.02em;
}

.g04-auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(0, 242, 234, 0.25);
}

.g04-auth-tab {
  flex: 1;
  padding: 12px 12px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.g04-auth-tab:hover {
  color: var(--text-light);
}

.g04-auth-tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--secondary-color);
  background: rgba(255, 42, 109, 0.06);
}

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

.g04-auth-alert {
  display: none;
  padding: 10px 12px;
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  line-height: 1.4;
}

.g04-auth-alert.show { display: block; }
.g04-auth-alert.success {
  color: #b8f5c8;
  background: rgba(39, 174, 96, 0.15);
  border-color: rgba(39, 174, 96, 0.45);
}
.g04-auth-alert.error {
  color: #ffb3c7;
  background: rgba(255, 42, 109, 0.12);
  border-color: rgba(255, 42, 109, 0.45);
}

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

.g04-form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.04em;
  color: var(--text-light);
  opacity: 0.85;
}

.g04-form-input::placeholder {
  color: var(--text-muted);
  opacity: 0.75;
}

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

.g04-form-input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--text-light);
  background: var(--bg-dark);
  border: 1px solid rgba(0, 242, 234, 0.25);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.g04-form-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(5, 217, 232, 0.2);
}

.g04-form-group.has-error .g04-form-input {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 2px rgba(255, 42, 109, 0.15);
}

.g04-form-error {
  display: none;
  margin-top: 4px;
  font-size: 0.8125rem;
  color: var(--secondary-color);
}

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

.g04-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(--text-muted);
  cursor: pointer;
  border-radius: 0 10px 10px 0;
  transition: color 0.18s ease;
}

.g04-pwd-toggle:hover {
  color: var(--primary-color);
}

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

.g04-btn-auth {
  width: 100%;
  height: 48px;
  margin-top: 0.75rem;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border: none;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  transition: opacity 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.g04-btn-auth:hover {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(255, 42, 109, 0.45);
}

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

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

.g04-btn-auth.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: g04-auth-spin 0.7s linear infinite;
}

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

.g04-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 1.5rem 0;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.g04-auth-divider::before,
.g04-auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(5, 217, 232, 0.15);
}

.g04-social-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

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

@media (max-width: 480px) {
  .g04-auth-card {
    padding: 1.5rem 1.25rem 1.75rem;
  }

  .g04-auth-head {
    font-size: 1.35rem;
    padding-right: 2rem;
  }

  .g04-auth-tab {
    padding: 10px 8px;
    font-size: 0.8125rem;
  }
}

@media (max-width: 767px) {
  .g04-auth-page {
    padding-bottom: calc(48px + var(--g04-mob-h, 56px));
  }
}

/* Login modal */
.g04-login-modal {
  position: fixed;
  inset: 0;
  z-index: 25000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px));
}

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

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

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

.g04-login-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 2, 33, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.g04-login-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.g04-login-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.375rem;
  line-height: 1;
  color: var(--text-muted);
  background: var(--bg-dark);
  border: 1px solid rgba(0, 242, 234, 0.25);
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.g04-login-modal__close:hover {
  color: #fff;
  background: var(--secondary-color);
  border-color: var(--secondary-color);
  box-shadow: 0 0 12px rgba(255, 42, 109, 0.45);
}

.g04-auth-card--modal {
  margin: 0;
  max-width: none;
  padding-top: 2.75rem;
  border-top: 3px solid var(--secondary-color);
  box-shadow:
    0 0 0 1px rgba(0, 242, 234, 0.25),
    0 12px 40px rgba(0, 0, 0, 0.55),
    0 0 32px rgba(255, 42, 109, 0.18);
}

.g04-auth-card--modal .g04-auth-head {
  padding-right: 0;
  margin-bottom: 1rem;
}

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