/* ═══════════════════════════════════════════════════════
   Profile Nav Button — injected by auth.js after unlock
   ═══════════════════════════════════════════════════════ */

#profileNavBtn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  color: #4db8d9;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem 0.25rem 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(77, 184, 217, 0.25);
  background: rgba(77, 184, 217, 0.08);
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
  cursor: pointer;
}

#profileNavBtn:hover {
  background: rgba(77, 184, 217, 0.18);
  border-color: rgba(77, 184, 217, 0.5);
  color: #7dd4ec;
}

.profile-nav-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #4db8d9;
  color: #0d1626;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
  line-height: 1;
  overflow: hidden;
  padding: 0;
}

.profile-nav-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.profile-nav-label {
  display: inline;
}

/* Floating variant — for pages that don't have #headerMeta */
#profileNavBtn.profile-nav-floating {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9000;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

/* ═══════════════════════════════════════════════════════
   Auth Gate — Full-screen overlay (non-bypassable)
   ═══════════════════════════════════════════════════════ */

#authGate {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #0d1626;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #c8daf0;
}

#authGate .auth-card {
  background: rgba(16, 26, 52, 0.95);
  border: 1px solid rgba(77, 184, 217, 0.18);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 0 40px rgba(77, 184, 217, 0.08);
  text-align: center;
}

#authGate .auth-logo {
  width: 120px;
  margin-bottom: 1rem;
}

#authGate h2 {
  font-size: 1.3rem;
  margin-bottom: 0.3rem;
  color: #4db8d9;
}

#authGate .auth-subtitle {
  font-size: 0.85rem;
  color: #6b84a8;
  margin-bottom: 1.5rem;
}

#authGate .auth-field {
  width: 100%;
  margin-bottom: 1rem;
}

#authGate .auth-field label {
  display: block;
  font-size: 0.78rem;
  color: #6b84a8;
  margin-bottom: 0.3rem;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#authGate .auth-field input,
#authGate .auth-field textarea {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(77, 184, 217, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #c8daf0;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

#authGate .auth-field textarea {
  min-height: 82px;
  resize: vertical;
  line-height: 1.45;
}

#authGate .auth-field input:focus,
#authGate .auth-field textarea:focus {
  border-color: #4db8d9;
  box-shadow: 0 0 8px rgba(77, 184, 217, 0.15);
}

#authGate .auth-field-hint,
.req-access-form .auth-field-hint {
  margin: 0.35rem 0 0;
  color: #6b84a8;
  font-size: 0.72rem;
  line-height: 1.4;
  text-align: left;
}

#authGate .auth-btn {
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #4db8d9, #7c65c4);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: opacity 0.2s, transform 0.1s;
}

#authGate .auth-btn:hover {
  opacity: 0.9;
}

#authGate .auth-btn:active {
  transform: scale(0.98);
}

#authGate .auth-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#authGate .auth-error {
  color: #e05470;
  font-size: 0.82rem;
  margin-top: 0.75rem;
  min-height: 1.2em;
}

#authGate .auth-footer {
  margin-top: 1.5rem;
  font-size: 0.72rem;
  color: #3a506e;
}

#authGate .auth-tabs {
  display: flex;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(77, 184, 217, 0.15);
  border-radius: 10px;
  padding: 0.25rem;
  margin-bottom: 1.25rem;
}

#authGate .auth-tab {
  flex: 1;
  border: none;
  border-radius: 8px;
  padding: 0.55rem 0.5rem;
  background: transparent;
  color: #6b84a8;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

#authGate .auth-tab.active {
  background: rgba(77, 184, 217, 0.14);
  color: #4db8d9;
}

#authGate .auth-panel { display: none; text-align: left; }
#authGate .auth-panel.active { display: block; }

#authGate .auth-btn-secondary {
  width: 100%;
  padding: 0.65rem;
  border: 1px solid rgba(77, 184, 217, 0.25);
  border-radius: 8px;
  background: transparent;
  color: #4db8d9;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
}

#authGate .auth-verify-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  margin-bottom: 0.75rem;
}

#authGate .auth-verify-row .auth-field { flex: 1; margin-bottom: 0; }

#authGate .auth-candidate-preview {
  display: none;
  background: rgba(62, 207, 142, 0.08);
  border: 1px solid rgba(62, 207, 142, 0.25);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.85rem;
  font-size: 0.82rem;
  color: #8ee4b0;
}

#authGate .auth-candidate-preview.visible { display: block; }

#authGate .auth-success {
  color: #3ecf8e;
  font-size: 0.85rem;
  margin-top: 0.75rem;
  line-height: 1.45;
}

#authGate .auth-pay-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(77, 184, 217, 0.15);
  border-radius: 10px;
  padding: 0.85rem;
  margin: 0.85rem 0;
  font-size: 0.78rem;
}

#authGate .auth-pay-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: #c8daf0;
  margin-bottom: 0.5rem;
}

#authGate .auth-pay-badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(77, 184, 217, 0.12);
  color: #4db8d9;
}

#authGate .auth-pay-badge.required {
  background: rgba(232, 166, 39, 0.15);
  color: #f5c842;
}

#authGate .auth-pay-price { margin: 0 0 0.35rem; color: #94a8c4; }
#authGate .auth-pay-usd { font-weight: 400; font-size: 0.88em; opacity: 0.9; }
#authGate .auth-pay-min { margin: 0 0 0.45rem; font-size: 0.72rem; color: #6b84a8; }
#authGate .auth-pay-note { margin: 0 0 0.65rem; color: #6b84a8; line-height: 1.4; }

#authGate .auth-pay-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  color: #94a8c4;
}

#authGate .auth-pay-val {
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  color: #e2ecf8;
  cursor: pointer;
}

#authGate .auth-pay-ref {
  margin: 0.55rem 0 0.65rem;
  font-size: 0.72rem;
  color: #6b84a8;
}

#authGate .auth-pay-ref strong,
.req-access-form .auth-pay-ref strong {
  color: #94a8c4;
}

#authGate .auth-pay-ref-help,
.req-access-form .auth-pay-ref-help {
  margin: -0.35rem 0 0.65rem;
  font-size: 0.71rem;
  color: #7f93b0;
  line-height: 1.4;
}

#authGate .auth-pay-ref code {
  background: rgba(77, 184, 217, 0.1);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

#authGate .auth-pay-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: #94a8c4;
  margin-bottom: 0.5rem;
  cursor: pointer;
}

#authGate .auth-pay-input-label,
.req-access-form .auth-pay-input-label {
  display: block;
  margin: 0.45rem 0 0.25rem;
  font-size: 0.68rem;
  color: #6b84a8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
}

#authGate .auth-pay-ref-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(77, 184, 217, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #c8daf0;
  font-size: 0.82rem;
}

#authGate .auth-link-row {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.78rem;
}

#authGate .auth-link-row a {
  color: #4db8d9;
  text-decoration: none;
}

#authGate .auth-link-row a:hover { text-decoration: underline; }

/* Hide page content until authenticated */
body.auth-locked > *:not(#authGate):not(#authVerifying):not(script):not(link):not(style) {
  display: none !important;
}

/* Session verification spinner */
#authVerifying {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #0d1626;
  display: flex;
  align-items: center;
  justify-content: center;
}

#authVerifying .auth-verifying-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: #6b84a8;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 0.85rem;
}

.auth-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(77, 184, 217, 0.15);
  border-top-color: #4db8d9;
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
}

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

/* ═══════════════════════════════════════════════════════
   Background Theme Picker — floating bottom-right button
   ═══════════════════════════════════════════════════════ */

#bgPickerWrap {
  position: fixed;
  bottom: 22px;
  left: 22px;
  z-index: 8900;
}

#bgPickerToggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(77, 184, 217, 0.22);
  background: rgba(13, 22, 38, 0.88);
  color: #6b84a8;
  font-size: 1.05rem;
  cursor: pointer;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  line-height: 1;
  padding: 0;
}
#bgPickerToggle:hover {
  border-color: rgba(77, 184, 217, 0.55);
  color: #4db8d9;
  box-shadow: 0 0 0 1px rgba(77, 184, 217, 0.3), 0 4px 20px rgba(0, 0, 0, 0.5);
}

#bgPickerPanel {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  background: rgba(13, 22, 44, 0.95);
  border: 1px solid rgba(77, 184, 217, 0.15);
  border-radius: 14px;
  padding: 14px 13px;
  min-width: 210px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.7);
  transform-origin: bottom left;
  transform: scale(0.9);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease;
}
#bgPickerPanel.open {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}

.bp-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  color: #6b84a8;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-bottom: 10px;
}

.bp-swatches {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 7px;
}

.bp-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 7px 5px 6px;
  border: 1px solid rgba(77, 184, 217, 0.1);
  border-radius: 9px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: rgba(255, 255, 255, 0.02);
  user-select: none;
}
.bp-swatch:hover {
  border-color: rgba(77, 184, 217, 0.4);
  background: rgba(77, 184, 217, 0.06);
}
.bp-swatch.active {
  border-color: rgba(77, 184, 217, 0.65);
  background: rgba(77, 184, 217, 0.09);
}

.bp-swatch-preview {
  width: 100%;
  height: 30px;
  border-radius: 5px;
  overflow: hidden;
  flex-shrink: 0;
}

.bp-swatch-name {
  font-size: 0.67rem;
  color: #6b84a8;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
}
.bp-swatch.active .bp-swatch-name {
  color: #4db8d9;
}

/* ═══════════════════════════════════════════════════════
   Standalone request-access page (matches auth gate form)
   ═══════════════════════════════════════════════════════ */

.req-access-form .auth-field { width: 100%; margin-bottom: 1rem; }
.req-access-form .auth-field label {
  display: block; font-size: 0.78rem; color: #6b84a8; margin-bottom: 0.3rem;
  text-align: left; text-transform: uppercase; letter-spacing: 0.5px;
}
.req-access-form .auth-field input,
.req-access-form .auth-field textarea {
  width: 100%; padding: 0.7rem 1rem;
  border: 1px solid rgba(77, 184, 217, 0.2); border-radius: 8px;
  background: rgba(255, 255, 255, 0.04); color: #c8daf0; font-size: 1rem;
  outline: none; transition: border-color 0.2s;
}
.req-access-form .auth-field textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.45;
}
.req-access-form .auth-field input:focus,
.req-access-form .auth-field textarea:focus {
  border-color: #4db8d9; box-shadow: 0 0 8px rgba(77, 184, 217, 0.15);
}
.req-access-form .auth-btn {
  width: 100%; padding: 0.75rem; border: none; border-radius: 8px;
  background: linear-gradient(135deg, #4db8d9, #7c65c4); color: #fff;
  font-size: 1rem; font-weight: 600; cursor: pointer; margin-top: 0.5rem;
  transition: opacity 0.2s, transform 0.1s;
}
.req-access-form .auth-btn:hover { opacity: 0.9; }
.req-access-form .auth-btn:active { transform: scale(0.98); }
.req-access-form .auth-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.req-access-form .auth-error { color: #e05470; font-size: 0.82rem; margin-top: 0.75rem; min-height: 1.2em; }
.req-access-form .auth-success { color: #3ecf8e; font-size: 0.85rem; margin-top: 0.75rem; line-height: 1.45; }
.req-access-form .auth-footer { margin-top: 1.25rem; font-size: 0.78rem; color: #3a506e; text-align: center; }
.req-access-form .auth-footer a { color: #4db8d9; text-decoration: none; }
.req-access-form .auth-footer a:hover { text-decoration: underline; }
.req-access-form .auth-candidate-preview {
  display: none; background: rgba(62, 207, 142, 0.08);
  border: 1px solid rgba(62, 207, 142, 0.25); border-radius: 8px;
  padding: 0.65rem 0.85rem; margin-bottom: 0.85rem; font-size: 0.82rem; color: #8ee4b0;
}
.req-access-form .auth-candidate-preview.visible { display: block; }
.req-access-form .auth-pay-box {
  background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(77, 184, 217, 0.15);
  border-radius: 10px; padding: 0.85rem; margin: 0.85rem 0; font-size: 0.78rem;
}
.req-access-form .auth-pay-head { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; color: #c8daf0; margin-bottom: 0.5rem; }
.req-access-form .auth-pay-badge { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.06em; padding: 0.15rem 0.45rem; border-radius: 999px; background: rgba(77, 184, 217, 0.12); color: #4db8d9; }
.req-access-form .auth-pay-badge.required { background: rgba(232, 166, 39, 0.15); color: #f5c842; }
.req-access-form .auth-pay-price { margin: 0 0 0.35rem; color: #94a8c4; }
.req-access-form .auth-pay-usd { font-weight: 400; font-size: 0.88em; opacity: 0.9; }
.req-access-form .auth-pay-min { margin: 0 0 0.45rem; font-size: 0.72rem; color: #6b84a8; }
.req-access-form .auth-pay-note { margin: 0 0 0.65rem; color: #6b84a8; line-height: 1.4; }
.req-access-form .auth-pay-row { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; color: #94a8c4; }
.req-access-form .auth-pay-val { font-family: 'Courier New', monospace; font-size: 0.82rem; color: #e2ecf8; cursor: pointer; }
.req-access-form .auth-pay-ref { margin: 0.55rem 0 0.65rem; font-size: 0.72rem; color: #6b84a8; }
.req-access-form .auth-pay-ref code { background: rgba(77, 184, 217, 0.1); padding: 0.1rem 0.35rem; border-radius: 4px; }
.req-access-form .auth-pay-check { display: flex; align-items: center; gap: 0.45rem; font-size: 0.78rem; color: #94a8c4; margin-bottom: 0.5rem; cursor: pointer; }
.req-access-form .auth-pay-ref-input {
  width: 100%; padding: 0.55rem 0.75rem; border: 1px solid rgba(77, 184, 217, 0.18);
  border-radius: 8px; background: rgba(255, 255, 255, 0.04); color: #c8daf0; font-size: 0.82rem;
}
