/* Login / Register — game_tgn_0039 FILM SPOOL / Darkroom */

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

.g39-auth-card {
  width: 100%;
  max-width: 420px;
  padding: 28px 24px 30px;
  background: #1a1814;
  color: #f3efe6;
  border: 2px solid #c5c0b8;
  border-radius: 0;
  box-shadow:
    inset 0 1px 0 rgba(243, 239, 230, 0.06),
    0 0 0 1px rgba(12, 11, 10, 0.5),
    0 22px 56px rgba(0, 0, 0, 0.55);
  position: relative;
}

.g39-auth-card::before {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--g39-safelight, #e8a317), transparent);
  opacity: 0.85;
  pointer-events: none;
}

.g39-auth-kicker {
  margin: 0 0 6px;
  font-family: var(--g39-mono, ui-monospace, Menlo, Consolas, monospace);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--g39-safelight, #e8a317);
}

.g39-auth-head {
  margin: 0 0 18px;
  font-family: var(--g39-font, system-ui, sans-serif);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-align: left;
  color: var(--g39-paper, #f3efe6);
}

.g39-auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--g39-line, rgba(197, 192, 184, 0.35));
}

.g39-auth-tab {
  flex: 1;
  padding: 10px 12px;
  font: inherit;
  font-family: var(--g39-mono, ui-monospace, Menlo, Consolas, monospace);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--g39-muted, #8a847a);
  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;
}

.g39-auth-tab:hover {
  color: var(--g39-paper, #f3efe6);
}

.g39-auth-tab.active {
  color: var(--g39-paper, #f3efe6);
  border-bottom-color: var(--g39-safelight, #e8a317);
  background: var(--g39-safelight-soft, rgba(232, 163, 23, 0.12));
}

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

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

.g39-auth-alert.show { display: block; }
.g39-auth-alert.success {
  color: #d1fae5;
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(52, 211, 153, 0.55);
}
.g39-auth-alert.error {
  color: #fecaca;
  background: rgba(220, 38, 38, 0.16);
  border-color: rgba(248, 113, 113, 0.55);
}

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

.g39-form-group label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--g39-mono, ui-monospace, Menlo, Consolas, monospace);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--g39-silver, #c5c0b8);
}

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

.g39-form-input {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  font: inherit;
  font-size: 0.9375rem;
  color: #f3efe6;
  background: #2a2722;
  border: 2px solid #c5c0b8;
  border-radius: 0;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.g39-form-input::placeholder {
  color: var(--g39-muted, #8a847a);
}

.g39-form-input:focus {
  border-color: var(--g39-safelight, #e8a317);
  box-shadow: 0 0 0 2px rgba(232, 163, 23, 0.22);
}

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

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

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

.g39-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(--g39-muted, #8a847a);
  cursor: pointer;
}

.g39-pwd-toggle:hover {
  color: var(--g39-safelight, #e8a317);
}

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

.g39-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;
}

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

.g39-auth-forgot {
  margin: -4px 0 12px;
  text-align: right;
  font-size: 0.8rem;
}

.g39-auth-forgot a {
  color: var(--g39-silver, #c5c0b8);
  text-decoration: none;
}

.g39-auth-forgot a:hover {
  color: var(--g39-safelight, #e8a317);
}

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

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

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

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

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

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

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

.g39-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 1.35rem 0;
  font-family: var(--g39-mono, ui-monospace, Menlo, Consolas, monospace);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--g39-muted, #8a847a);
}

.g39-auth-divider::before,
.g39-auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--g39-line, rgba(197, 192, 184, 0.35));
}

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

.g39-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: 0;
  cursor: pointer;
}

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

@media (max-width: 480px) {
  .g39-auth-card {
    padding: 22px 16px 24px;
  }

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

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

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

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

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

.g39-login-modal__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(26, 24, 20, 0.55) 0%, rgba(12, 11, 10, 0.88) 100%);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

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

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

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

.g39-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;
  padding: 0;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--g39-paper, #f3efe6);
  background: var(--g39-darkroom, #0c0b0a);
  border: 2px solid var(--g39-silver, #c5c0b8);
  border-radius: 0;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.g39-login-modal__close:hover {
  color: var(--g39-ink, #141210);
  background: var(--g39-safelight, #e8a317);
  border-color: var(--g39-safelight, #e8a317);
}

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

.g39-auth-card--modal .g39-auth-head {
  padding-right: 28px;
}

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

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