/* Profile owner invite — trigger in profile header meta + lightbox tweaks */

.profileTopInfoMetaRight .profileMembershipTitle[hidden],
.profileTopInfoMetaRight .profileMembership[hidden] {
  display: none !important;
}

.profileOwnerInviteBanner {
  display: none;
  margin: 0;
  padding: 0;
  width: 100%;
  text-align: right;
}

/* Same meta slot: never show Invite an owner beside Member Since */
.profileTopInfoMetaRight .profileMembership:not([hidden]) ~ .profileOwnerInviteBanner,
.profileTopInfoMetaRight .profileMembershipTitle:not([hidden]) ~ .profileOwnerInviteBanner {
  display: none !important;
}

.profileOwnerInviteBanner.is-visible {
  display: block;
  animation: profileOwnerInviteIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes profileOwnerInviteIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.profileOwnerInviteOpenBtn {
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #fff;
  background: linear-gradient(180deg, #6aa028 0%, #5c9120 100%);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 3px 10px rgba(92, 145, 32, 0.24);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.profileOwnerInviteOpenBtn:hover {
  filter: brightness(1.04);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.22) inset, 0 5px 14px rgba(92, 145, 32, 0.3);
}

.profileOwnerInviteOpenBtn:active {
  transform: translateY(1px);
}

/* Desktop: a little wider than the default card */
@media screen and (min-width: 768px) {
  #profileOwnerInviteSendForm > .accountForm,
  #profileOwnerInviteAcceptForm > .accountForm {
    width: 520px;
    max-width: 92%;
  }
}

.profileOwnerInvitePending {
  display: none;
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(44, 51, 64, 0.04);
  border: 1px solid rgba(44, 51, 64, 0.08);
}

.profileOwnerInvitePending.is-visible {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.profileOwnerInvitePendingText {
  margin: 0;
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 0.88rem;
  color: #3d4656;
  line-height: 1.4;
}

.profileOwnerInvitePendingText strong {
  font-weight: 700;
  color: #2c3340;
}

.profileOwnerInviteCancel {
  border: 1px solid rgba(44, 51, 64, 0.16);
  background: #fff;
  color: #2c3340;
  border-radius: 10px;
  padding: 8px 12px;
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.profileOwnerInviteCancel:hover {
  background: #f7f8fa;
  border-color: rgba(44, 51, 64, 0.28);
}

.profileOwnerInviteStatus {
  margin: 0 0 12px;
  min-height: 0;
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 0.9rem;
  text-align: center;
  color: #5a6578;
}

.profileOwnerInviteStatus:empty {
  display: none;
}

.profileOwnerInviteStatus.is-error {
  color: #a33b3b;
}

.profileOwnerInviteStatus.is-success {
  color: #3d6b4f;
}

.profileOwnerInviteAcceptHero {
  margin: 0 0 8px;
  text-align: center;
}

.profileOwnerInviteAcceptMark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin: 4px auto 12px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(92, 145, 32, 0.16), rgba(61, 107, 79, 0.1));
  color: #5c9120;
  font-size: 1.35rem;
}

.profileOwnerInviteAcceptLead {
  margin: 0 0 18px;
  text-align: center;
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 0.95rem;
  line-height: 1.55;
  color: #5a6578;
}

.profileOwnerInviteAcceptLead strong {
  color: #2c3340;
  font-weight: 700;
}

.profileOwnerInviteAcceptMeta {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(44, 51, 64, 0.04);
  border: 1px solid rgba(44, 51, 64, 0.08);
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 0.86rem;
  color: #5a6578;
  text-align: center;
}

.profileOwnerInviteAcceptActions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profileOwnerInviteAcceptActions .f2nFormPrimaryButton,
.profileOwnerInviteAcceptActions .f2nFormSecondaryButton {
  width: 100%;
  justify-content: center;
}

.profileOwnerInviteAcceptResponse {
  margin: 0 0 12px;
  min-height: 0;
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 0.9rem;
  text-align: center;
  color: #5a6578;
}

.profileOwnerInviteAcceptResponse.is-error {
  color: #a33b3b;
}

.profileOwnerInviteAcceptResponse.is-success {
  color: #3d6b4f;
}

@media (max-width: 767px) {
  /* Full-width row under avatar/name so the button can truly center */
  .profileTopInfo:has(#profileOwnerInviteBanner.is-visible) {
    flex-wrap: wrap;
  }

  .profileTopInfoMetaRight:has(#profileOwnerInviteBanner.is-visible) {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    align-items: center;
    text-align: center;
  }

  .profileTopInfoMetaRight .profileOwnerInviteBanner.is-visible {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    text-align: center;
  }

  .profileOwnerInviteOpenBtn {
    width: auto;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profileOwnerInviteBanner.is-visible {
    animation: none;
  }
}
