/* Login / Register / Modal — game_tgn_0053 Reading Ledge */

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

.g53-auth-card {
  width: 100%;
  max-width: 420px;
  padding: 28px 24px;
  background: var(--g53-panel, #fffdf8);
  border: 1px solid var(--g53-line, rgba(28, 40, 51, 0.12));
  border-left: 4px solid var(--g53-cord, #8b3a3a);
  box-shadow: 0 16px 36px rgba(28, 40, 51, 0.18);
  color: var(--g53-ink, #1c2833);
  box-sizing: border-box;
}

.g53-auth-card--modal {
  margin: 0;
  max-width: none;
}

.g53-auth-kicker {
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--g53-sage, #5f7a61);
}

.g53-auth-head {
  margin: 0 0 16px;
  font-family: var(--g53-font, system-ui, sans-serif);
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--g53-ink, #1c2833);
  line-height: 1.25;
}

.g53-auth-tabs {
  display: flex;
  margin-bottom: 14px;
  border: 1px solid var(--g53-line, rgba(28, 40, 51, 0.12));
}

.g53-auth-tab {
  flex: 1;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--g53-muted, #6b7280);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.g53-auth-tab.active {
  background: var(--g53-spine, #2c3e50);
  color: var(--g53-edge-ink, #f0ebe3);
}

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

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

.g53-auth-alert.show { display: block; }
.g53-auth-alert.success {
  color: #1e5631;
  background: #e8f5e9;
  border-color: #27ae60;
}
.g53-auth-alert.error {
  color: #7b1e1e;
  background: #fdecea;
  border-color: var(--g53-cord, #8b3a3a);
}

.g53-form-group { margin-bottom: 12px; }

.g53-form-group label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--g53-muted, #6b7280);
}

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

.g53-form-input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  font: inherit;
  font-size: 0.95rem;
  color: var(--g53-ink, #1c2833);
  background: #fff;
  border: 1px solid var(--g53-line, rgba(28, 40, 51, 0.12));
  outline: none;
  box-sizing: border-box;
}

.g53-form-input:focus {
  border-color: var(--g53-cord, #8b3a3a);
  box-shadow: 0 0 0 3px rgba(139, 58, 58, 0.12);
}

.g53-form-group.has-error .g53-form-input {
  border-color: #e74c3c;
}

.g53-form-error {
  display: none;
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--g53-cord, #8b3a3a);
}

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

.g53-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(--g53-muted, #6b7280);
  cursor: pointer;
}

.g53-pwd-icon::before {
  content: "👁";
  font-size: 0.85rem;
  opacity: 0.55;
}

.g53-pwd-toggle[aria-pressed="true"] .g53-pwd-icon::before,
.g53-pwd-toggle.is-shown .g53-pwd-icon::before {
  opacity: 1;
}

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

.g53-auth-forgot {
  margin: 0 0 10px;
  font-size: 0.85rem;
}

.g53-auth-forgot a { color: var(--g53-cord, #8b3a3a); font-weight: 700; }

.g53-btn-auth {
  width: 100%;
  min-height: 46px;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff !important;
  background: var(--g53-cord, #8b3a3a) !important;
  border: 0 !important;
  cursor: pointer;
  position: relative;
  box-shadow: 0 3px 0 rgba(92, 38, 38, 0.45);
}

.g53-btn-auth:hover {
  filter: brightness(1.06);
  color: #fff !important;
}

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

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

.g53-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: g53-auth-spin 0.7s linear infinite;
}

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

.g53-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 1.25rem 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--g53-muted, #6b7280);
}

.g53-auth-divider::before,
.g53-auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--g53-line, rgba(28, 40, 51, 0.12));
}

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

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

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

@media (max-width: 480px) {
  .g53-auth-card { padding: 20px 16px; }
  .g53-auth-head { font-size: 1.25rem; }
}

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

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

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

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

.g53-login-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 36, 48, 0.62);
  border: 0;
}

.g53-login-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.g53-login-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 36px;
  height: 36px;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--g53-ink, #1c2833);
  background: #fff;
  border: 1px solid var(--g53-line, rgba(28, 40, 51, 0.12));
  cursor: pointer;
}

.g53-login-modal__close:hover {
  color: #fff;
  background: var(--g53-cord, #8b3a3a);
  border-color: var(--g53-cord, #8b3a3a);
}

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