/* ==========================================================================
   Bolsa Trading — Official Zero-Layout-Shift Authentication UI (P0 Standard)
   ========================================================================== */

.bolsa-auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  grid-column: 1 / -1;
  min-height: 100vh;
  width: 100%;
  overflow-y: auto;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background:
    radial-gradient(circle at 20% 15%, rgba(236, 72, 153, 0.14), transparent 45%),
    radial-gradient(circle at 80% 85%, rgba(139, 92, 246, 0.16), transparent 48%),
    #09090f;
}

.bolsa-login-card {
  width: 100%;
  max-width: 420px;
  background: #141414;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 40px 36px 32px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.85);
  position: relative;
}

.bolsa-auth-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 24px;
}

.bolsa-auth-logo-ring {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.2), rgba(139, 92, 246, 0.22));
  border: 1px solid rgba(236, 72, 153, 0.32);
  margin-bottom: 12px;
  box-shadow: 0 10px 26px rgba(236, 72, 153, 0.2);
}

.bolsa-auth-logo-ring img {
  width: 32px;
  height: 32px;
}

.bolsa-auth-title {
  margin: 0;
  font-size: 1.32rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #f8fafc;
}

.bolsa-auth-subtitle {
  margin: 5px 0 0;
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.35;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Locked 254px stage: Login, Register and Forgot occupy exact same coordinates */
.auth-forms-stage {
  position: relative;
  height: 254px;
}

.auth-form-pane {
  position: absolute;
  inset: 0;
  height: 254px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: opacity 0.14s ease;
}

.auth-form-pane.is-hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.auth-slot-block {
  position: relative;
  height: 70px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.auth-slot-info-box {
  height: 70px;
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.22);
  color: #cbd5e1;
  font-size: 0.76rem;
  line-height: 1.38;
  display: flex;
  align-items: center;
}

.auth-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 20px;
  margin-bottom: 6px;
}

.auth-label-row label {
  font-size: 0.76rem;
  font-weight: 600;
  color: #cbd5e1;
  letter-spacing: 0.01em;
}

.auth-forgot-trigger {
  background: transparent;
  border: none;
  padding: 0;
  color: #ec4899;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease;
}

.auth-forgot-trigger:hover {
  color: #f472b6;
  text-decoration: underline;
}

.auth-input-box {
  position: relative;
  height: 44px;
  display: flex;
  align-items: center;
}

.auth-field-icon {
  position: absolute;
  left: 13px;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  pointer-events: none;
}

.auth-field-input {
  width: 100%;
  height: 44px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  padding: 0 40px 0 38px;
  color: #f8fafc;
  font-size: 0.86rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-field-input:focus {
  border-color: rgba(236, 72, 153, 0.65);
  box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.14);
}

.auth-field-input::placeholder {
  color: #64748b;
  text-transform: none;
}

.auth-eye-toggle {
  position: absolute;
  right: 10px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.auth-eye-toggle:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.06);
}

/* Absolute inline feedback immediately below email input: 0px layout shift */
.email-inline-feedback {
  position: absolute;
  left: 2px;
  right: 2px;
  top: 71px;
  font-size: 11px;
  line-height: 1.22;
  font-weight: 600;
  pointer-events: none;
  z-index: 10;
  min-height: 14px;
}

.email-inline-feedback.is-error {
  color: #fb7185;
}

.email-inline-feedback.is-ok {
  color: #34d399;
}

.auth-typo-suggestion-btn {
  pointer-events: auto;
  background: rgba(236, 72, 153, 0.16);
  border: 1px solid rgba(236, 72, 153, 0.42);
  color: #f9a8d4;
  border-radius: 6px;
  padding: 1px 6px;
  margin-left: 4px;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}

.auth-typo-suggestion-btn:hover {
  background: rgba(236, 72, 153, 0.28);
  color: #ffffff;
}

.auth-submit-btn {
  width: 100%;
  height: 46px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(236, 72, 153, 0.28);
  transition: transform 0.14s ease, opacity 0.14s ease;
}

.auth-submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.auth-submit-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.auth-footer-switch {
  height: 48px;
  margin-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #94a3b8;
}

.auth-switch-link {
  background: transparent;
  border: none;
  padding: 0;
  color: #ec4899;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
}

.auth-switch-link:hover {
  color: #f472b6;
  text-decoration: underline;
}

.auth-version-pill {
  margin-top: 4px;
  text-align: center;
  font-size: 0.68rem;
  font-family: 'JetBrains Mono', monospace;
  color: rgba(148, 163, 184, 0.55);
  letter-spacing: 0.04em;
}

/* Password Setup Modal (#setupPasswordPopup) */
.setup-pwd-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10005;
  background: rgba(5, 6, 12, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.setup-pwd-backdrop.is-hidden {
  display: none;
}

.setup-pwd-modal {
  width: 100%;
  max-width: 400px;
  background: #151621;
  border: 1px solid rgba(236, 72, 153, 0.35);
  border-radius: 22px;
  padding: 28px 26px 24px;
  box-shadow: 0 28px 65px rgba(0, 0, 0, 0.88);
}

.setup-pwd-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
  color: #f9a8d4;
  background: rgba(236, 72, 153, 0.14);
  border: 1px solid rgba(236, 72, 153, 0.3);
  margin-bottom: 12px;
}

.setup-pwd-title {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #f8fafc;
}

.setup-pwd-desc {
  margin: 0 0 18px;
  font-size: 0.81rem;
  color: #94a3b8;
  line-height: 1.45;
}

.setup-pwd-feedback {
  min-height: 18px;
  margin-top: 8px;
  margin-bottom: 10px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #fb7185;
}

@media (max-width: 460px) {
  .bolsa-login-card {
    padding: 30px 22px 24px;
    border-radius: 20px;
  }
}
